/** * Constructor. * * @param objectSource the object source byte[] */ public XMLObjectSource(@Nonnull @NotEmpty final byte[] objectSource) { source = Constraint.isNotNull(objectSource, "Object source byte[] may not be null"); Constraint.isGreaterThan(0, source.length, "Object source byte[] length must be greater than zero"); }
/** * Set the RSA public exponent below which a warning should result. * * @param length the RSA public exponent below which a warning should result */ public void setWarningBoundary(final long length) { Constraint.isGreaterThanOrEqual(0, length, "boundary value must not be negative"); warningBoundary = BigInteger.valueOf(length); }
/** * Set the HTTP method. * * <p>Defaults to "POST".</p> * * @param m method */ public void setMethod(@Nonnull @NotEmpty final String m) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); ComponentSupport.ifDestroyedThrowDestroyedComponentException(this); method = Constraint.isNotNull(StringSupport.trimOrNull(m), "HTTP method cannot be null or empty"); Constraint.isTrue(HttpPost.METHOD_NAME.equals(method) || HttpPut.METHOD_NAME.equals(method), "HTTP method must be POST or PUT"); }
/** * Sets the HTTP response codes permitted for successful authentication of the proxy callback URL. * * @param responseCodes One or more HTTP response codes. */ public void setAllowedResponseCodes(@NotEmpty @NonnullElements final Set<Integer> responseCodes) { Constraint.isNotEmpty(responseCodes, "Response codes cannot be null or empty."); Constraint.noNullItems(responseCodes.toArray(), "Response codes cannot contain null elements."); allowedResponseCodes = responseCodes; }
/** * Constructor. * * @param invokedPipeline the pipeline that will be invoked; must be initialized; can not be null * @param items the collection of items upon which the pipeline will operate, can not be null */ public PipelineCallable(@Nonnull final Pipeline<T> invokedPipeline, @Nonnull @NonnullElements final Collection<Item<T>> items) { pipeline = Constraint.isNotNull(invokedPipeline, "To-be-invoked pipeline can not be null"); Constraint.isTrue(invokedPipeline.isInitialized(), "To-be-invoked pipeline must be initialized"); itemCollection = Constraint.isNotNull(items, "Item collection can not be null"); }
/** * Constructor. * * @param definition attribute definition that was resolved to produce the given attribute * @param attribute attribute produced by the given attribute definition */ public ResolvedAttributeDefinition(@Nonnull final AttributeDefinition definition, @Nullable final IdPAttribute attribute) { resolvedDefinition = Constraint.isNotNull(definition, "Resolved attribute definition can not be null"); Constraint.isTrue(definition.isInitialized(), "Resolved definition must have been initialized"); Constraint.isFalse(definition.isDestroyed(), "Resolved definition can not have been destroyed"); resolvedAttribute = attribute; }
/** * Set the property names to treat as defunct. * * @param properties defunct property names */ public void setDeadProperties(@Nonnull @NonnullElements final Collection<String> properties) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); Constraint.isNotNull(properties, "Property collection cannot be null"); deadProperties = StringSupport.normalizeStringCollection(properties); }
/** {@inheritDoc} */ @Nullable @NonnullElements @Unmodifiable @NotLive public Set<MetadataIndexKey> generateKeys(@Nonnull final EntityDescriptor descriptor) { Constraint.isNotNull(descriptor, "EntityDescriptor was null"); return descriptorStrategy.apply(descriptor); }
/** {@inheritDoc} */ @Override @Nullable public String apply(@Nullable final String input) { final String entityID = Constraint.isNotNull(StringSupport.trimOrNull(input), "Entity ID was null or empty"); final String digested = digester.apply(entityID); if (digested == null) { return null; } return "{sha1}" + digested; }
/** * Set the profile configurations for this relying party. * * @param configs the configurations to set */ public void setProfileConfigurations(@Nullable @NonnullElements final Collection<ProfileConfiguration> configs) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); if (configs == null) { profileConfigurations = Collections.emptyMap(); } else { profileConfigurations = new HashMap<>(); for (final ProfileConfiguration config : Collections2.filter(configs, Predicates.notNull())) { final String trimmedId = Constraint.isNotNull(StringSupport.trimOrNull(config.getId()), "ID of profile configuration class " + config.getClass().getName() + " cannot be null"); profileConfigurations.put(trimmedId, config); } } }
/** * Creates a new instance. * * @param registries One or more service registries to query for CAS services. */ public BuildRelyingPartyContextAction(@Nonnull @NotEmpty final ServiceRegistry ... registries) { serviceRegistries = Arrays.asList(Constraint.isNotEmpty(registries, "Service registries cannot be null")); }
/** * Set time in milliseconds to expire consent storage records. * * @param consentLifetime time in milliseconds to expire consent storage records */ public void setLifetime(@Nonnull @Duration @NonNegative final Long consentLifetime) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); Constraint.isNotNull(consentLifetime, "Lifetime cannot be null"); lifetime = Constraint.isGreaterThanOrEqual(0, consentLifetime, "Lifetime must be greater than or equal to 0"); }
/** * Set the backing store for the cache. * * @param storageService backing store to use */ public void setStorage(@Nonnull final StorageService storageService) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); storage = Constraint.isNotNull(storageService, "StorageService cannot be null"); final StorageCapabilities caps = storage.getCapabilities(); if (caps instanceof StorageCapabilitiesEx) { Constraint.isTrue(((StorageCapabilitiesEx) caps).isServerSide(), "StorageService cannot be client-side"); } }
/** * Set the service principal name. Required. * * @param principal service principal */ public void setServicePrincipal(@Nonnull @NotEmpty final String principal) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); servicePrincipal = Constraint.isNotEmpty(StringSupport.trim(principal), "Principal cannot be null or empty"); }
/** * Constructor. * * @param descriptorIndexingFunctions the functions used to produce index keys from an entity descriptor */ public SAMLArtifactMetadataIndex( @Nonnull final List<Function<EntityDescriptor, Set<MetadataIndexKey>>> descriptorIndexingFunctions) { indexingFunctions = new ArrayList<>(Collections2.filter( Constraint.isNotNull(descriptorIndexingFunctions, "EntityDescriptor indexing functions list may not be null"), Predicates.notNull())); Constraint.isNotEmpty(indexingFunctions, "EntityDescriptor indexing functions list may not be empty"); }
/** * Set the confirmation methods to use. * * @param methods confirmation methods to use */ public void setMethods(@Nonnull @NonnullElements final Collection<String> methods) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); Constraint.isNotEmpty(methods, "Confirmation method collection cannot be null or empty"); confirmationMethods = new ArrayList<>(Collections2.filter(methods, Predicates.notNull())); }
/** * Set the map entry factory. * * <p> * In addition to implementing the {@link SAMLArtifactMapEntryFactory} interface, the injected * object must support the {@link StorageSerializer} interface to enable entries to be stored via the injected * {@link StorageService} instance. * </p> * * @param factory map entry factory */ public void setEntryFactory(@Nonnull final SAMLArtifactMapEntryFactory factory) { Constraint.isTrue(factory != null && factory instanceof StorageSerializer<?>, "SAMLArtifactMapEntryFactory cannot be null and must support the StorageSerializer interface"); entryFactory = factory; }
/** * Get an immutable collection of RP contexts associated with a label. * * @param label the label to search for * * @return corresponding RP contexts */ @Nonnull @NonnullElements @NotLive @Unmodifiable public Collection<RelyingPartyContext> getRelyingPartyContexts( @Nonnull @NotEmpty final String label) { return ImmutableList.copyOf(relyingPartyLabelMap.get( Constraint.isNotNull(StringSupport.trimOrNull(label), "Label cannot be null or empty"))); }