/** {@inheritDoc} */ @Override public boolean apply(@Nullable final ProfileRequestContext input) { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return activationCondition.apply(input); }
/** {@inheritDoc} */ @Override protected boolean canEncodeValue(@Nonnull final IdPAttribute attribute, @Nonnull final IdPAttributeValue value) { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return value instanceof ScopedStringAttributeValue; }
/** {@inheritDoc} */ @Override protected boolean canEncodeValue(@Nonnull final IdPAttribute attribute, @Nonnull final IdPAttributeValue value) { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return value instanceof ScopedStringAttributeValue; }
/** * Get Information about the attribute whose first value is used when generating the computed ID. * This is derived from the sourceID (if present) and/or the dependencies. * Public purely as an aid to testing. * * @return log-friend information. */ @Nullable @NonnullAfterInit public String getSourceAttributeInformation() { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return sourceInformation; }
/** {@inheritDoc} */ @Override @Nullable public XMLObject filter(@Nullable final XMLObject metadata) throws FilterException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); if (metadata == null) { return null; } processNode(metadata); return metadata; }
/** {@inheritDoc} */ @Override public Iterable<EntityDescriptor> resolve(@Nullable final CriteriaSet criteria) throws ResolverException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return new CompositeMetadataResolverIterable(resolvers, criteria); }
/** {@inheritDoc} */ @Override @Nullable public EntityDescriptor resolveSingle(@Nullable final CriteriaSet criteria) throws ResolverException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); final Iterable<EntityDescriptor> iterable = resolve(criteria); if (iterable != null) { final Iterator<EntityDescriptor> iterator = iterable.iterator(); if (iterator != null && iterator.hasNext()) { return iterator.next(); } } return null; }
/** {@inheritDoc} */ @Override public EntityDescriptor resolveSingle(@Nullable final CriteriaSet criteria) throws ResolverException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); EntityDescriptor metadata = null; for (final MetadataResolver resolver : resolvers) { metadata = resolver.resolveSingle(criteria); if (metadata != null) { return metadata; } } return null; }
/** {@inheritDoc} */ @Override @Nullable public RelyingPartyConfiguration resolveSingle(@Nullable final CriteriaSet criteria) throws ResolverException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); ComponentSupport.ifDestroyedThrowDestroyedComponentException(this); final Iterator<RelyingPartyConfiguration> results = resolve(criteria).iterator(); if (results.hasNext()) { return results.next(); } else { return null; } }
/** {@inheritDoc} */ @Override @Nonnull protected IdPAttribute doAttributeDefinitionResolve( final AttributeResolutionContext resolutionContext, @Nonnull final AttributeResolverWorkContext workContext) throws ResolutionException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); ComponentSupport.ifDestroyedThrowDestroyedComponentException(this); log.debug("{} resolving static attribute {}", getLogPrefix(), value); return value; }
/** {@inheritDoc} */ @Override @Nonnull @NotEmpty public String serialize(@Nonnull final AuthenticationResult instance) throws IOException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return resultSerializer.serialize(instance); }
/** {@inheritDoc} */ @Override public Iterator<EntityDescriptor> iterator() { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return Collections.unmodifiableList(getBackingStore().getOrderedDescriptors()).iterator(); }
/** {@inheritDoc} */ @Override @Nonnull public Event execute(@Nonnull final RequestContext springRequestContext) { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); final ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext = profileContextLookupStrategy.apply(springRequestContext); if (profileRequestContext == null) { log.error("{} IdP profile request context is not available", getLogPrefix()); return ActionSupport.buildEvent(this, EventIds.INVALID_PROFILE_CTX); } return doExecute(springRequestContext, profileRequestContext); }
/** * get the compiled pattern. This is compiled in init and hence there is a guard. * * @return Returns the pattern. */ @Nonnull public Pattern getPattern() { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); Constraint.isFalse(isPartialMatch(), "getPattern is only meaningful for a non partial Match, use getValue()"); return pattern; }
/** {@inheritDoc} */ @Nonnull @NonnullElements public Iterable<String> resolve( @Nullable final CriteriaSet criteria) throws ResolverException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); ComponentSupport.ifDestroyedThrowDestroyedComponentException(this); final String entityID = resolveSingle(criteria); if (entityID != null) { return Collections.singletonList(entityID); } else { return Collections.emptyList(); } }
/** {@inheritDoc} */ @Override @Nonnull @NotEmpty public String generate(@Nonnull @NotEmpty final String relyingPartyId, @Nonnull @NotEmpty final String principalName) throws SAMLException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); final StringBuilder principalTokenIdBuilder = new StringBuilder(); principalTokenIdBuilder.append(relyingPartyId).append("!").append(principalName); try { return dataSealer.wrap(principalTokenIdBuilder.toString(), System.currentTimeMillis() + idLifetime); } catch (final DataSealerException e) { throw new SAMLException("Exception wrapping principal identifier", e); } }
/** * Get whether the configured {@link StorageService}'s * {@link org.opensaml.storage.StorageCapabilities#getValueSize()} method meets the * value set via {@link #setStorageServiceThreshold(long)}. * * @return true iff the threshold is met */ public boolean storageServiceMeetsThreshold() { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); return storageService.getCapabilities().getValueSize() >= storageServiceThreshold; }
/** {@inheritDoc} */ @Override @Nullable public NameIdType generate(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty final String theFormat) throws SAMLException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); if (!Objects.equals(format, theFormat)) { throw new SAMLException("The format to generate does not match the value configured"); } else if (!apply(profileRequestContext)) { return null; } return doGenerate(profileRequestContext); }
/** {@inheritDoc} */ @Override @Nonnull @NonnullElements public Iterable<RelyingPartyConfiguration> resolve(@Nullable final CriteriaSet criteria) throws ResolverException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); ComponentSupport.ifDestroyedThrowDestroyedComponentException(this); final ProfileRequestContext prc = buildContext(criteria); if (prc != null) { return delegate.resolve(prc); } else { return Collections.emptyList(); } }
/** {@inheritDoc} */ @Override @Nullable protected XMLObject encodeValue(@Nonnull final IdPAttribute attribute, @Nonnull final ScopedStringAttributeValue value) throws AttributeEncodingException { ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this); if ("attribute".equals(getScopeType())) { return SAMLEncoderSupport.encodeScopedStringValueAttribute(attribute, AttributeValue.DEFAULT_ELEMENT_NAME, value, getScopeAttributeName(), encodeType()); } else { return SAMLEncoderSupport.encodeScopedStringValueInline( attribute, AttributeValue.DEFAULT_ELEMENT_NAME, value, getScopeDelimiter(), encodeType()); } }