Package com.sun.identity.sm
Class AttributeSchema
java.lang.Object
com.sun.identity.sm.AttributeSchema
The class
AttributeSchema provides methods to access the
schema of a configuration parameter. Also, it provides methods to set default
and choice values.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThis enumListOrderdefines the list orders of schema attributes and provides constants for these list orders.static enumThe classSyntaxdefines the syntax of the schema attributes and provides static constants for these types.static enumThe classTypedefines the types of schema attributes and provides static constants for these types.static enumThe classUITypedefines the UI types of schema attributes and provides static constants for these types. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAttributeSchema(com.sun.identity.sm.AttributeSchemaImpl as, com.sun.identity.sm.PluginSchema ps) protectedAttributeSchema(com.sun.identity.sm.AttributeSchemaImpl as, ServiceSchemaManager ssm, ServiceSchema ss) Constructor used by ServiceSchema to instantiateAttributeSchemaobjects. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChoiceValue(String value, String i18nKey) Adds a choice value and its i18n key to the existing set of choice values.voidaddDefaultValue(String value) Adds a default value to the existing set of default values.getAny()Method to get service specific attributes.getChoiceValueI18NKey(String cValue) Returns the I18N key for the given choice value.String[]Returns the possible choice values for the attribute if the attribute type is eitherSINGLE_CHOICEorMULTIPLE_CHOICE.String[]getChoiceValues(Map envParams) Returns the possible choice values for the attribute if the attribute type is eitherSINGLE_CHOICEorMULTIPLE_CHOICE, for the given environment parameters.getChoiceValuesMap(Map<String, Object> envParams) Returns the possible choice values for the attribute if the attribute type is eitherSINGLE_CHOICEorMULTIPLE_CHOICE, for the given environment parameters, along with the values' i18n keys.Returns the value of thecosQualifierfor this attribute that isdefault, override, operational or merge-cos.Returns the default values of the attribute.getDefaultValues(Map envParams) Returns the default values of the attribute for the given environment parameters.Returns the end range if the attribute syntax is eitherNUMBER_RANGEorDECIMAL_RANGE.Returns the example values of the attribute.Returns the string value forBooleanFalseValue.Returns theI18NKey forBooleanFalseValue.Returns the specified flagEnablingAttribute attribute, or null if not specified.Returns the I18N key to describe the configuration attribute.Returns the list order of the attribute.intReturns the maximum number of values for the attribute if the attribute is of typeMULTIPLE_CHOICE.intReturns the required minimum lenght of the attribute valueintReturns the minimum number of values for the attribute if the attribute is of typeMULTIPLE_CHOICE.getName()Returns the name of the attribute.getOrder()Returns the order of this attribute.Returns URL of the view bean for the attribute.Returns the name of this attribute when used in a CREST representation.Returns Service Schema.Returns the start range if the attribute syntax is eitherNUMBER_RANGEorDECIMAL_RANGE.Returns the syntax of the attribute.Returns the string value forBooleanTrueValue.Returns theI18Nkey forBooleanTrueValue.getType()Returns the type of the attribute.Returns the UI type of the attribute.Method to get the validator name for using to validate this service attributebooleanIndicates whether this AttributeSchema has choice values defined.isHiddenByFeatureFlag(com.iplanet.am.util.SystemPropertiesWrapper systemPropertiesWrapper) Return whether this attribute schema item should be considered hidden based on its flagEnablingAttribute value and the current value of the configured system property, if specified.booleanShould this attribute schema be hidden in the Configuration UI.booleanReturns true if the attribute is an optional attribute.booleanChecks if the attribute allows to have resource name.booleanReturnstrueif the attribute is searchable;falseotherwisebooleanReturns true if the attribute is a service identifier (i.e., in the case of LDAP it would be the COS Specifier attribute).booleanReturns true if the attribute is a service's status attribute.voidremoveChoiceValue(String value) Removes the given value from the set of choice values.voidremoveDefaultValue(String value) Removes the given value from the set of default values.voidRemoves the all the default values for the attribute.voidSets the any attribute.voidsetBooleanValues(String trueValue, String trueValueI18nKey, String falseValue, String falseValueI18nKey) Sets the boolean values of the attribute.voidsetCosQualifier(String cosq) Sets thecosQualifierattributevoidsetDefaultValues(Set<String> values) Sets the default values of the attribute.voidsetEndRange(String edRange) Sets the end range Attribute.voidsetI18NKey(String i18nKey) Sets the I18N key to describe the configuration attribute.voidsetMaxValue(String maxV) Sets the maximum value attribute.voidsetMinValue(String minV) Sets the minimum value attribute.voidSets the order of this attribute.voidSets the URL of the view bean for the attribute.voidsetResourceName(String name) Sets the CREST representation name for the attribute.voidsetSearchable(String value) Sets the attribute isSearchable, if value is set totrue, orfalse.voidsetStartRange(String stRange) Sets the start range attribute.voidSets the Syntax attribute.voidSets the type.voidSets theUITypeattribute.voidsetValidator(String valid) Sets the Validator attributetoString()Returns a string representation of thisAttributeSchemaobject.protected voidupdateBooleanValues(String trueValue, String trueValueI18nKey, String falseValue, String falseValueI18nKey, Document doc) protected voidupdateChoiceValues(Map<String, String> choiceValues) protected voidupdateChoiceValues(Map<String, String> choiceValues, Document doc) protected voidupdateDefaultValues(Set<String> defaultValues) Method for modifying default valuesprotected voidupdateDefaultValues(Set<String> defaultValues, Document doc) Method for modifying default values given the XML documentprotected voidupdateXMLDocument(StringBuffer sb, String elementName, Document updateDoc) protected voidupdateXMLDocument(String attrName, String attrValue) update attribute value in attribute schema element
-
Constructor Details
-
AttributeSchema
protected AttributeSchema(com.sun.identity.sm.AttributeSchemaImpl as, ServiceSchemaManager ssm, ServiceSchema ss) Constructor used by ServiceSchema to instantiateAttributeSchemaobjects. -
AttributeSchema
protected AttributeSchema(com.sun.identity.sm.AttributeSchemaImpl as, com.sun.identity.sm.PluginSchema ps)
-
-
Method Details
-
getName
Returns the name of the attribute.- Returns:
- the name of the attribute
-
isHiddenInConfigUI
public boolean isHiddenInConfigUI()Should this attribute schema be hidden in the Configuration UI.- Returns:
- {true} if it should be hidden.
-
getType
Returns the type of the attribute.- Returns:
- the type of the attribute
-
getServiceSchema
Returns Service Schema.- Returns:
- Service Schema.
-
setType
Sets the type.- Parameters:
type- to be changed to- Throws:
SMSException- if an error is encountered when trying to setSSOException- if the single sign on token is invalid or expired
-
getListOrder
Returns the list order of the attribute.- Returns:
- The list order of the attribute, or
nullif the list order is not defined.
-
getUIType
Returns the UI type of the attribute.- Returns:
- the UI type of the attribute; or null if the UI Type is not defined
-
setUIType
Sets theUITypeattribute.- Parameters:
uiType- user interface type.- Throws:
SMSException- if an error is encountered when trying to setUITypeto the attribute schema.SSOException- if the single sign on token is invalid or expired
-
getSyntax
Returns the syntax of the attribute.- Returns:
- the syntax of the attribute
-
getMinLength
public int getMinLength()Returns the required minimum lenght of the attribute value- Returns:
- the required minimum length of the attribute value
-
setSyntax
Sets the Syntax attribute.- Parameters:
synt- syntax- Throws:
SMSException- if an error is encountered when trying to set the attribute syntaxSSOException- if the single sign on token is invalid or expired
-
getI18NKey
Returns the I18N key to describe the configuration attribute.- Returns:
- the I18N key to describe the configuration attribute
-
getOrder
Returns the order of this attribute.- Returns:
- the order of this attribute, null if not defined
-
setI18NKey
Sets the I18N key to describe the configuration attribute.- Parameters:
i18nKey- the I18N key to describe the attribute- Throws:
SMSException- if an error is encountered when trying to set I18N key to the attribute schemaSSOException- if the single sign on token is invalid or expired
-
setOrder
Sets the order of this attribute.- Parameters:
order- the integer value representing the order- Throws:
SMSException- if an error is encounteredSSOException- if the single sign on token is invalid or expired
-
getCosQualifier
Returns the value of thecosQualifierfor this attribute that isdefault, override, operational or merge-cos.- Returns:
- the value of the
cosQualifier.
-
setCosQualifier
Sets thecosQualifierattribute- Parameters:
cosq- value ofcosQualifier.- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
getDefaultValues
Returns the default values of the attribute. If there are no default values defined for this attribute in the schema then this method returns a Collections.EMPTY_SET- Returns:
- set of default values of the attribute
-
getDefaultValues
Returns the default values of the attribute for the given environment parameters. If there are no default values defined for this attribute in the schema then this method returns a Collections.EMPTY_SET- Parameters:
envParams- Map of environment parameter to a set of values- Returns:
- set of default values of the attribute
-
getExampleValues
Returns the example values of the attribute. If there are no example values defined for this attribute in the schema then this method returns a Collections.EMPTY_SET- Returns:
- set of example values of the attribute
-
setDefaultValues
Sets the default values of the attribute.- Parameters:
values- the set of default values- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
addDefaultValue
Adds a default value to the existing set of default values.- Parameters:
value- the default value to add- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
removeDefaultValues
Removes the all the default values for the attribute.- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
removeDefaultValue
Removes the given value from the set of default values.- Parameters:
value- the default value to remove- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
getChoiceValues
Returns the possible choice values for the attribute if the attribute type is eitherSINGLE_CHOICEorMULTIPLE_CHOICE.- Returns:
- set of possible choice values
-
getChoiceValues
Returns the possible choice values for the attribute if the attribute type is eitherSINGLE_CHOICEorMULTIPLE_CHOICE, for the given environment parameters.- Parameters:
envParams- Map of environment parameter to a set of values- Returns:
- set of possible choice values
-
getChoiceValuesMap
Returns the possible choice values for the attribute if the attribute type is eitherSINGLE_CHOICEorMULTIPLE_CHOICE, for the given environment parameters, along with the values' i18n keys.- Parameters:
envParams- Map of environment parameter to a set of values- Returns:
- Map of value to i18n key.
-
hasChoiceValues
public boolean hasChoiceValues()Indicates whether this AttributeSchema has choice values defined. -
getChoiceValueI18NKey
Returns the I18N key for the given choice value.- Parameters:
cValue- choice value.- Returns:
- the I18N key for the given choice value
-
addChoiceValue
Adds a choice value and its i18n key to the existing set of choice values.- Parameters:
value- the choice value to addi18nKey- the I18N key for the choice value- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
removeChoiceValue
Removes the given value from the set of choice values.- Parameters:
value- the choice value to remove- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
getStartRange
Returns the start range if the attribute syntax is eitherNUMBER_RANGEorDECIMAL_RANGE.- Returns:
- the start range for the attribute value
-
setStartRange
Sets the start range attribute.- Parameters:
stRange- start range.- Throws:
SMSException- if an error is encountered when trying to setSSOException- if the single sign on token is invalid or expired
-
getEndRange
Returns the end range if the attribute syntax is eitherNUMBER_RANGEorDECIMAL_RANGE.- Returns:
- the end range for the attribute value
-
setEndRange
Sets the end range Attribute.- Parameters:
edRange- end range.- Throws:
SMSException- if an error is encountered when trying to setSSOException- if the single sign on token is invalid or expired
-
getValidator
Method to get the validator name for using to validate this service attribute- Returns:
- the validator name
-
setValidator
Sets the Validator attribute- Parameters:
valid- validator- Throws:
SMSException- if an error is encountered when trying to setSSOException- if the single sign on token is invalid or expired
-
getMinValue
public int getMinValue()Returns the minimum number of values for the attribute if the attribute is of typeMULTIPLE_CHOICE.- Returns:
- the minimum number of values
-
setMinValue
Sets the minimum value attribute.- Parameters:
minV- minimum value.- Throws:
SMSException- if an error is encountered when trying to setSSOException- if the single sign on token is invalid or expired
-
getMaxValue
public int getMaxValue()Returns the maximum number of values for the attribute if the attribute is of typeMULTIPLE_CHOICE.- Returns:
- the maximum number of values
-
setMaxValue
Sets the maximum value attribute.- Parameters:
maxV- maximum value.- Throws:
SMSException- if an error is encountered when trying to setSSOException- if the single sign on token is invalid or expired
-
setBooleanValues
public void setBooleanValues(String trueValue, String trueValueI18nKey, String falseValue, String falseValueI18nKey) throws SSOException, SMSException Sets the boolean values of the attribute.- Parameters:
trueValue- string value forBooleanTrueValue.trueValueI18nKey-I18Nkey forBooleanTrueValue.falseValue- string value forBooleanFalseValue.falseValueI18nKey-I18NKey forBooleanFalseValue.- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired
-
getTrueValue
Returns the string value forBooleanTrueValue.- Returns:
- the string value for
BooleanTrueValue.
-
getTrueValueI18NKey
Returns theI18Nkey forBooleanTrueValue.- Returns:
- the
I18Nkey forBooleanTrueValue.
-
getFalseValue
Returns the string value forBooleanFalseValue.- Returns:
- the string value for
BooleanFalseValue.
-
getFalseValueI18NKey
Returns theI18NKey forBooleanFalseValue.- Returns:
- the
I18NKey forBooleanFalseValue.
-
isOptional
public boolean isOptional()Returns true if the attribute is an optional attribute.- Returns:
- true if the attribute is an optional attribute.
-
isServiceIdentifier
public boolean isServiceIdentifier()Returns true if the attribute is a service identifier (i.e., in the case of LDAP it would be the COS Specifier attribute).- Returns:
- true if the attribute is service identifier attribute.
-
isResourceNameAllowed
public boolean isResourceNameAllowed()Checks if the attribute allows to have resource name.- Returns:
- true if the attribute allows to have resource name; false otherwise
-
isStatusAttribute
public boolean isStatusAttribute()Returns true if the attribute is a service's status attribute.- Returns:
- true if the attribute is a status attribute.
-
getAny
Method to get service specific attributes. It return the value of the "any" attribute, if set in the XML schema for the service- Returns:
- value of "any" attribute
-
setAny
Sets the any attribute.- Parameters:
a- value for any attribute.- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired.
-
getPropertiesViewBeanURL
Returns URL of the view bean for the attribute.- Returns:
- URL for view bean
-
setPropertiesViewBeanUR
Sets the URL of the view bean for the attribute.- Parameters:
prop- properties view bean URL.- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired.
-
isSearchable
public boolean isSearchable()Returnstrueif the attribute is searchable;falseotherwise- Returns:
trueif the attribute is an optional attribute;falseotherwise
-
setSearchable
Sets the attribute isSearchable, if value is set totrue, orfalse.- Parameters:
value- if set totruethe attribute will be searchable; else searches cannot be performed on this attribute.- Throws:
SMSException- if an error is encountered when trying to setSSOException- if the single sign on token is invalid or expired
-
getResourceName
Returns the name of this attribute when used in a CREST representation. -
setResourceName
Sets the CREST representation name for the attribute.- Parameters:
name- the name of the CREST property.- Throws:
SMSException- if an error is encountered when trying to set.SSOException- if the single sign on token is invalid or expired.
-
toString
Returns a string representation of thisAttributeSchemaobject. -
updateDefaultValues
Method for modifying default values- Throws:
SMSExceptionSSOException
-
updateDefaultValues
protected void updateDefaultValues(Set<String> defaultValues, Document doc) throws SMSException, SSOException Method for modifying default values given the XML document- Throws:
SMSExceptionSSOException
-
updateChoiceValues
protected void updateChoiceValues(Map<String, String> choiceValues) throws SMSException, SSOException- Throws:
SMSExceptionSSOException
-
updateChoiceValues
protected void updateChoiceValues(Map<String, String> choiceValues, Document doc) throws SMSException, SSOException- Throws:
SMSExceptionSSOException
-
updateBooleanValues
protected void updateBooleanValues(String trueValue, String trueValueI18nKey, String falseValue, String falseValueI18nKey, Document doc) throws SMSException, SSOException - Throws:
SMSExceptionSSOException
-
getFlagEnablingAttribute
Returns the specified flagEnablingAttribute attribute, or null if not specified. The flagEnablingAttribute is the name of the system property that unless enabled (i.e. present and true), indicates that this attribute should be hidden/disabled.- Returns:
- The flag that will enable this attribute.
-
isHiddenByFeatureFlag
public Boolean isHiddenByFeatureFlag(com.iplanet.am.util.SystemPropertiesWrapper systemPropertiesWrapper) Return whether this attribute schema item should be considered hidden based on its flagEnablingAttribute value and the current value of the configured system property, if specified.- Parameters:
systemPropertiesWrapper-SystemPropertiesWrapperfor retrieving server-specific system properties- Returns:
- Whether this attribute schema item is hidden by a system property flag
-
updateXMLDocument
protected void updateXMLDocument(StringBuffer sb, String elementName, Document updateDoc) throws SMSException, SSOException - Throws:
SMSExceptionSSOException
-
updateXMLDocument
protected void updateXMLDocument(String attrName, String attrValue) throws SMSException, SSOException update attribute value in attribute schema element- Throws:
SMSExceptionSSOException
-