/** {@inheritDoc} */ @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final ProfileInterceptorContext interceptorContext) { if (!super.doPreExecute(profileRequestContext, interceptorContext)) { return false; } results = interceptorContext.getResults(); if (results.isEmpty()) { log.debug("{} No results available from interceptor context, nothing to store", getLogPrefix()); return false; } flowDescriptor = interceptorContext.getAttemptedFlow(); if (flowDescriptor == null) { log.warn("{} No flow descriptor within interceptor context", getLogPrefix()); return false; } storageService = flowDescriptor.getStorageService(); if (storageService == null) { log.warn("{} No storage service available from interceptor flow descriptor", getLogPrefix()); return false; } return true; }
/** * Get the storage service from the flow descriptor of the profile interceptor context. The profile interceptor * context is retrieved by applying the profile interceptor context lookup strategy to the profile request context. * The storage service is retrieved from the flow descriptor of the last interceptor flow which was attempted. * * @param profileRequestContext the profile request context * @return the storage service * @throws net.shibboleth.utilities.java.support.logic.ConstraintViolationException if the lookup strategy returns * <code>null</code>, the interceptor flow descriptor is <code>null</code>, or the storage service is * <code>null</code> */ @Nonnull protected StorageService getStorageService(@Nonnull final ProfileRequestContext profileRequestContext) { Constraint.isNotNull(profileRequestContext, "Profile request context cannot be null"); final ProfileInterceptorContext interceptorContext = interceptorContextlookupStrategy.apply(profileRequestContext); Constraint.isNotNull(interceptorContext, "Profile interceptor context not available from profile request context"); final ProfileInterceptorFlowDescriptor flowDescriptor = interceptorContext.getAttemptedFlow(); Constraint.isNotNull(flowDescriptor, "Profile interceptor flow descriptor not available from profile interceptor context"); return Constraint.isNotNull(flowDescriptor.getStorageService(), "Storage service not available from interceptor flow descriptor"); }
/** * Get the storage service from the flow descriptor of the profile interceptor context. The profile interceptor * context is retrieved by applying the profile interceptor context lookup strategy to the profile request context. * The storage service is retrieved from the flow descriptor of the last interceptor flow which was attempted. * * @param profileRequestContext the profile request context * @return the storage service * @throws net.shibboleth.utilities.java.support.logic.ConstraintViolationException if the lookup strategy returns * <code>null</code>, the interceptor flow descriptor is <code>null</code>, or the storage service is * <code>null</code> */ @Nonnull protected StorageService getStorageService(@Nonnull final ProfileRequestContext profileRequestContext) { Constraint.isNotNull(profileRequestContext, "Profile request context cannot be null"); final ProfileInterceptorContext interceptorContext = interceptorContextlookupStrategy.apply(profileRequestContext); Constraint.isNotNull(interceptorContext, "Profile interceptor context not available from profile request context"); final ProfileInterceptorFlowDescriptor flowDescriptor = interceptorContext.getAttemptedFlow(); Constraint.isNotNull(flowDescriptor, "Profile interceptor flow descriptor not available from profile interceptor context"); return Constraint.isNotNull(flowDescriptor.getStorageService(), "Storage service not available from interceptor flow descriptor"); }
storageService = flowDescriptor.getStorageService(); log.trace("{} Storage service '{}'", getLogPrefix(), storageService); if (storageService == null) {
storageService = flowDescriptor.getStorageService(); log.trace("{} Storage service '{}'", getLogPrefix(), storageService); if (storageService == null) {