/** * Sets the service ticket prefix. Default is ST. * * @param prefix Service ticket prefix. */ public void setServiceTicketPrefix(final String prefix) { serviceTicketPrefix = Constraint.isNotEmpty(prefix, "Prefix cannot be null or empty"); }
/** * Sets the proxy ticket prefix. Default is PGT. * * @param prefix Proxy ticket prefix. */ public void setProxyTicketPrefix(final String prefix) { proxyTicketPrefix = Constraint.isNotEmpty(prefix, "Prefix cannot be null or empty"); }
/** * 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")); }
/** * Constructor. * * @param attributeValue value of the attribute */ public ByteAttributeValue(@Nonnull @ParameterName(name="attributeValue") final byte[] attributeValue) { value = Constraint.isNotEmpty(attributeValue, "Attribute value 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())); }
/** * Constructor. * * @param id storage service ID * @param key storage key to update * @param value storage value * @param source storage source */ public ClientStorageServiceOperation(@Nonnull @NotEmpty final String id, @Nonnull @NotEmpty final String key, @Nullable final String value, @Nonnull final ClientStorageSource source) { storageServiceId = Constraint.isNotEmpty(id, "StorageService ID cannot be null or empty"); storageKey = Constraint.isNotEmpty(key, "Key cannot be null or empty"); storageValue = value; storageSource = Constraint.isNotNull(source, "Storage source cannot be null"); }
/** * Constructor. * * @param pw the password */ public PasswordPrincipal(@Nonnull @NotEmpty @ParameterName(name="pw") final String pw) { password = Constraint.isNotEmpty(pw, "Password cannot be null or empty"); }
/** * Constructor. * * @param attributeValue the attribute value */ public StringAttributeValue(@Nonnull @NotEmpty @ParameterName(name="attributeValue") final String attributeValue) { value = Constraint.isNotEmpty(attributeValue, "Attribute value cannot be null or empty"); }
/** * 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"); }
Constraint.isNotEmpty(metricName, "Metric name cannot be null or empty");
/** * Computes the appropriate location to pass control to to invoke an external authentication mechanism. * * <p>The input location should be suitable for use in a Spring "externalRedirect" expression, and may * contain a query string. The result will include any additional parameters needed to invoke the * mechanism.</p> * * @param baseLocation the base location to build off of * @param conversationValue the value to include as a conversation ID * * @return the computed location * * @since 3.2.0 */ @Nonnull @NotEmpty public static String getExternalRedirect(@Nonnull @NotEmpty final String baseLocation, @Nonnull @NotEmpty final String conversationValue) { Constraint.isNotEmpty(baseLocation, "Base location cannot be null or empty"); final StringBuilder url = new StringBuilder(baseLocation); // Add a parameter separator for the conversation ID. url.append(baseLocation.indexOf('?') == -1 ? '?' : '&'); url.append(CONVERSATION_KEY).append('=').append( UrlEscapers.urlFormParameterEscaper().escape(conversationValue)); return url.toString(); }
/** * 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; }
@Nonnull @NotEmpty final String pattern, @Nonnull final AttributeMap<Object> attributes) throws IOException { Constraint.isNotEmpty(basePath, "Base location cannot be null or empty"); Constraint.isNotEmpty(pattern, "Flow pattern cannot be null or empty"); if (!(resourceLoader instanceof ResourcePatternResolver)) { throw new IllegalStateException(
@Nonnull @NotEmpty final String path, @Nonnull final AttributeMap<Object> attributes, @Nonnull @NotEmpty final String flowId) { Constraint.isNotEmpty(path, "Flow path cannot be null or empty"); Constraint.isNotEmpty(flowId, "Flow ID cannot be null or empty");
/** * Adds a <code>soap11:encodingStyle</code> attribute to the given SOAP object. * * @param soapObject the SOAP object to add the attribute to * @param encodingStyles the list of encoding styles to add */ public static void addSOAP11EncodingStyles(@Nonnull final XMLObject soapObject, @Nonnull final List<String> encodingStyles) { Constraint.isNotEmpty(encodingStyles, "Encoding styles list cannot be empty"); if (soapObject instanceof EncodingStyleBearing) { ((EncodingStyleBearing) soapObject).setSOAP11EncodingStyles(encodingStyles); } else if (soapObject instanceof AttributeExtensibleXMLObject) { ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put( EncodingStyleBearing.SOAP11_ENCODING_STYLE_ATTR_NAME, StringSupport.listToStringValue(encodingStyles, " ")); } else { throw new IllegalArgumentException( "Specified object was neither EncodingStyleBearing nor AttributeExtensible"); } }
/** * Select the locations used to search for the target. Prefers the user-defined search location defined by * {@link #IDP_HOME_PROPERTY} in the application context. Defaults to the well-known search locations returned from * {@link #getSearchLocations()}. * * @deprecated in future versions there will only be one location returned. This method is not available yet since * the code cannot coexist with the legacy. See IDP-999 and IDP-991 * @param applicationContext the application context * @return the search locations used to search for the target * @throws ConstraintViolationException if the user-defined search location is empty or ends with '/' and * {@link #isFailFast(ConfigurableApplicationContext)} is true */ @Nonnull @Deprecated public String[] selectSearchLocations(@Nonnull final ConfigurableApplicationContext applicationContext) { Constraint.isNotNull(applicationContext, "Application context cannot be null"); final String homeProperty = applicationContext.getEnvironment().getProperty(IDP_HOME_PROPERTY); if (homeProperty != null && isFailFast(applicationContext)) { Constraint.isNotEmpty(homeProperty, "idp.home cannot be empty"); Constraint.isFalse(homeProperty.endsWith("/"), "idp.home cannot end with '/'"); } return (homeProperty != null) ? new String[] {homeProperty} : getSearchLocations(); }
Constraint.isNotEmpty(filteredConsents, "Consents cannot be empty");
Constraint.isNotEmpty(filteredConsents, "Consents cannot be empty");