/** * 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; }
/** * 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; }
/** * Constructor. * * @param connector data connector that was resolved to produce the attributes * @param attributes attributes produced by the resolved data connector */ public ResolvedDataConnector(@Nonnull final DataConnector connector, @Nullable final Map<String, IdPAttribute> attributes) { resolvedConnector = Constraint.isNotNull(connector, "Resolved data connector cannot be null"); resolvedAttributes = attributes; Constraint.isTrue(connector.isInitialized(), "Provided connector should be initialized"); Constraint.isFalse(connector.isDestroyed(), "Provided connector must not be destroyed"); }
/** * 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(); }