com.sun.identity.sm
Class AttributeSchema

java.lang.Object
  |
  +--com.sun.identity.sm.AttributeSchema

public class AttributeSchema
extends java.lang.Object

The class AttributeSchema provides methods to access the schema of a configuration parameter. Also, it provides methods to set default and choice values.


Inner Class Summary
static class AttributeSchema.Syntax
          The class Syntax defines the syntax of the schema attributes and provides static constants for these types.
static class AttributeSchema.Type
          The class Type defines the types of schema attributes and provides static constants for these types.
static class AttributeSchema.UIType
          The class UIType defines the UI types of schema attributes and provides static constants for these types.
 
Method Summary
 void addChoiceValue(java.lang.String value, java.lang.String i18nKey)
          Adds a choice value and its i18n key to the existing set of choice values.
 void addDefaultValue(java.lang.String value)
          Adds a default value to the existing set of default values.
 java.lang.String getAny()
          Method to get service specific attributes.
 java.lang.String getChoiceValueI18NKey(java.lang.String cValue)
          Returns the I18N key for the given choice value.
 java.lang.String[] getChoiceValues()
          Returns the possible choice values for the attribute if the attribute type is either SINGLE_CHOICE or MULTIPLE_CHOICE.
 java.lang.String getCosQualifier()
          Returns the value of the cosQualifier for this attribute i.e.
 java.util.Set getDefaultValues()
          Returns the default values of the attribute.
 java.lang.String getEndRange()
          Returns the end range if the attribute syntax is either NUMBER_RANGE or DECIMAL_RANGE.
 java.lang.String getFalseValue()
          Returns the string value for BooleanFalseValue.
 java.lang.String getFalseValueI18NKey()
          Returns the I18N Key for BooleanFalseValue.
 java.lang.String getI18NKey()
          Returns the I18N key to describe the configuration attribute.
 int getMaxValue()
          Returns the maximum number of values for the attribute if the attribute is of type MULTIPLE_CHOICE.
 int getMinValue()
          Returns the minimum number of values for the attribute if the attribute is of type MULTIPLE_CHOICE.
 java.lang.String getName()
          Returns the name of the attribute.
 java.lang.String getPropertiesViewBeanURL()
          Returns URL of the view bean for the attribute.
 java.lang.String getStartRange()
          Returns the start range if the attribute syntax is either NUMBER_RANGE or DECIMAL_RANGE.
 AttributeSchema.Syntax getSyntax()
          Returns the syntax of the attribute.
 java.lang.String getTrueValue()
          Returns the string value for BooleanTrueValue.
 java.lang.String getTrueValueI18NKey()
          Retruns the I18N Key for BooleanTrueValue.
 AttributeSchema.Type getType()
          Returns the type of the attribute.
 AttributeSchema.UIType getUIType()
          Returns the UI type of the attribute.
 java.lang.String getValidator()
          Method to get the validator name for using to validate this service attribute
 boolean isOptional()
          Checks if the attribute is an optional attribute.
 boolean isResourceNameAllowed()
          Checks if the attribute allows to have resource name.
 boolean isServiceIdentifier()
          Chekcs if the attribute is a service identifier (i.e., in the case of LDAP it would be the COS Specifier attribute).
 boolean isStatusAttribute()
          Checkds if the attribute is a service's status attribute.
 void removeChoiceValue(java.lang.String value)
          Removes the given value from the set of choice values.
 void removeDefaultValue(java.lang.String value)
          Removes the given value from the set of default values.
 void removeDefaultValues()
          Removes the all the default values for the attribute.
 void setDefaultValues(java.util.Set values)
          Sets the default values of the attribute.
 void setI18NKey(java.lang.String i18nKey)
          Sets the I18N key to describe the configuration attribute.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Returns the name of the attribute.
Returns:
the name of the attribute

getType

public AttributeSchema.Type getType()
Returns the type of the attribute.
Returns:
the type of the attribute

getUIType

public AttributeSchema.UIType getUIType()
Returns the UI type of the attribute.
Returns:
the UI type of the attribute; or null if the UI Type is not defined

getSyntax

public AttributeSchema.Syntax getSyntax()
Returns the syntax of the attribute.
Returns:
the syntax of the attribute

getI18NKey

public java.lang.String getI18NKey()
Returns the I18N key to describe the configuration attribute.
Returns:
the I18N key to describe the configuration attribute

setI18NKey

public void setI18NKey(java.lang.String i18nKey)
                throws SMSException,
                       SSOException
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 schema
SSOException - if the SSO token is invalid or expired

getCosQualifier

public java.lang.String getCosQualifier()
Returns the value of the cosQualifier for this attribute i.e. default, overrid, operational or merge-cos.
Returns:
the value of the cosQualifier

getDefaultValues

public java.util.Set getDefaultValues()
Returns the default values of the attribute.
Returns:
set of default values of the attribute

setDefaultValues

public void setDefaultValues(java.util.Set values)
                      throws SMSException,
                             SSOException
Sets the default values of the attribute.
Parameters:
values - the set of default values
Throws:
SMSException -  

addDefaultValue

public void addDefaultValue(java.lang.String value)
                     throws SMSException,
                            SSOException
Adds a default value to the existing set of default values.
Parameters:
value - the default value to add
Throws:
SMSException -  

removeDefaultValues

public void removeDefaultValues()
                         throws SMSException,
                                SSOException
Removes the all the default values for the attribute.
Parameters:
value - the default value to remove
Throws:
SMSException -  

removeDefaultValue

public void removeDefaultValue(java.lang.String value)
                        throws SMSException,
                               SSOException
Removes the given value from the set of default values.
Parameters:
value - the default value to remove
Throws:
SMSException -  

getChoiceValues

public java.lang.String[] getChoiceValues()
Returns the possible choice values for the attribute if the attribute type is either SINGLE_CHOICE or MULTIPLE_CHOICE.
Returns:
set of possible choice values

getChoiceValueI18NKey

public java.lang.String getChoiceValueI18NKey(java.lang.String cValue)
Returns the I18N key for the given choice value.
Returns:
the I18N key for the given choice value

addChoiceValue

public void addChoiceValue(java.lang.String value,
                           java.lang.String i18nKey)
                    throws SMSException,
                           SSOException
Adds a choice value and its i18n key to the existing set of choice values.
Parameters:
value - the choice value to add
i18nKey - the I18N key for the choice value
Throws:
SMSException -  

removeChoiceValue

public void removeChoiceValue(java.lang.String value)
                       throws SMSException,
                              SSOException
Removes the given value from the set of choice values.
Parameters:
value - the choice value to remove
Throws:
SMSException -  

getStartRange

public java.lang.String getStartRange()
Returns the start range if the attribute syntax is either NUMBER_RANGE or DECIMAL_RANGE.
Returns:
the start range for the attribute value

getEndRange

public java.lang.String getEndRange()
Returns the end range if the attribute syntax is either NUMBER_RANGE or DECIMAL_RANGE.
Returns:
the end range for the attribute value

getValidator

public java.lang.String getValidator()
Method to get the validator name for using to validate this service attribute
Returns:
the validator name

getMinValue

public int getMinValue()
Returns the minimum number of values for the attribute if the attribute is of type MULTIPLE_CHOICE.
Returns:
the minimum number of values

getMaxValue

public int getMaxValue()
Returns the maximum number of values for the attribute if the attribute is of type MULTIPLE_CHOICE.
Returns:
the maximum number of values

getTrueValue

public java.lang.String getTrueValue()
Returns the string value for BooleanTrueValue.
Returns:
the string value for BooleanTrueValue

getTrueValueI18NKey

public java.lang.String getTrueValueI18NKey()
Retruns the I18N Key for BooleanTrueValue.
Returns:
the I18N key for BooleanTrueValue

getFalseValue

public java.lang.String getFalseValue()
Returns the string value for BooleanFalseValue.
Returns:
the string value for BooleanFalseValue

getFalseValueI18NKey

public java.lang.String getFalseValueI18NKey()
Returns the I18N Key for BooleanFalseValue.
Returns:
the I18N Key for BooleanFalseValue

isOptional

public boolean isOptional()
Checks if the attribute is an optional attribute.
Returns:
true if the attribute is an optional attribute; false otherwise

isServiceIdentifier

public boolean isServiceIdentifier()
Chekcs 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 attribte is service identifier attribute; false otherwise

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()
Checkds if the attribute is a service's status attribute.
Returns:
true if the attribute is a status attribtue; false otherwise

getAny

public java.lang.String 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

getPropertiesViewBeanURL

public java.lang.String getPropertiesViewBeanURL()
Returns URL of the view bean for the attribute.
Returns:
URL for view bean

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object