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[] getChoiceValues(java.util.Map envParams)
          Returns the possible choice values for the attribute if the attribute type is either SINGLE_CHOICE or MULTIPLE_CHOICE, for the given environment parameters.
 java.lang.String getCosQualifier()
          Returns the value of the cosQualifier for this attribute that is default, override, operational or merge-cos.
 java.util.Set getDefaultValues()
          Returns the default values of the attribute.
 java.util.Set getDefaultValues(java.util.Map envParams)
          Returns the default values of the attribute for the given environment parameters.
 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.
 ServiceSchema getServiceSchema()
          Returns Service Schema.
 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()
          Returns 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()
          Returns true if the attribute is an optional attribute.
 boolean isResourceNameAllowed()
          Checks if the attribute allows to have resource name.
 boolean isSearchable()
          Returns true if the attribute is searchable; false otherwise
 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).
 boolean isStatusAttribute()
          Returns true 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 setAny(java.lang.String a)
          Sets the any attribute.
 void setCosQualifier(java.lang.String cosq)
          Sets the cosQualifier attribute
 void setDefaultValues(java.util.Set values)
          Sets the default values of the attribute.
 void setEndRange(java.lang.String edRange)
          Sets the end range Attribute.
 void setI18NKey(java.lang.String i18nKey)
          Sets the I18N key to describe the configuration attribute.
 void setMaxValue(java.lang.String maxV)
          Sets the maximum value attribute.
 void setMinValue(java.lang.String minV)
          Sets the minimum value attribute.
 void setPropertiesViewBeanUR(java.lang.String prop)
          Sets the URL of the view bean for the attribute.
 void setSearchable(java.lang.String value)
          Sets the attribute isSearchable, if value is set to true , or false.
 void setStartRange(java.lang.String stRange)
          Sets the start range attribute.
 void setSyntax(java.lang.String synt)
          Sets the Syntax attribute.
 void setType(java.lang.String type)
          Sets the type.
 void setUIType(java.lang.String uiType)
          Sets the UIType attribute.
 void setValidator(java.lang.String valid)
          Sets the Validator attribute
 java.lang.String toString()
          Returns a string representation of this AttributeSchema object.
 
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

getServiceSchema

public ServiceSchema getServiceSchema()
Returns Service Schema.
Returns:
Service Schema.

setType

public void setType(java.lang.String type)
             throws SMSException,
                    SSOException
Sets the type.
Parameters:
type - to be changed to
Throws:
SMSException - if an error is encountered when trying to set
SSOException - if the single sign on token is invalid or expired

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

setUIType

public void setUIType(java.lang.String uiType)
               throws SMSException,
                      SSOException
Sets the UIType attribute.
Parameters:
uiType - user interface type.
Throws:
SMSException - if an error is encountered when trying to set UIType to the attribute schema.
SSOException - if the single sign on token is invalid or expired

getSyntax

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

setSyntax

public void setSyntax(java.lang.String synt)
               throws SMSException,
                      SSOException
Sets the Syntax attribute.
Parameters:
synt - syntax
Throws:
SMSException - if an error is encountered when trying to set the attribute syntax
SSOException - if the single sign on token is invalid or expired

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 single sign on token is invalid or expired

getCosQualifier

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

setCosQualifier

public void setCosQualifier(java.lang.String cosq)
                     throws SMSException,
                            SSOException
Sets the cosQualifier attribute
Parameters:
cosq - value of cosQualifier.
Throws:
SMSException - if an error is encountered when trying to set.
SSOException - if the single sign on token is invalid or expired

getDefaultValues

public java.util.Set 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

public java.util.Set getDefaultValues(java.util.Map envParams)
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

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 - if an error is encountered when trying to set.
SSOException - if the single sign on token is invalid or expired

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 - if an error is encountered when trying to set.
SSOException - if the single sign on token is invalid or expired

removeDefaultValues

public void removeDefaultValues()
                         throws SMSException,
                                SSOException
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

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 - if an error is encountered when trying to set.
SSOException - if the single sign on token is invalid or expired

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

getChoiceValues

public java.lang.String[] getChoiceValues(java.util.Map envParams)
Returns the possible choice values for the attribute if the attribute type is either SINGLE_CHOICE or MULTIPLE_CHOICE, for the given environment parameters.
Parameters:
envParams - Map of environment parameter to a set of values
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.
Parameters:
cValue - 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 - if an error is encountered when trying to set.
SSOException - if the single sign on token is invalid or expired

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 - if an error is encountered when trying to set.
SSOException - if the single sign on token is invalid or expired

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

setStartRange

public void setStartRange(java.lang.String stRange)
                   throws SMSException,
                          SSOException
Sets the start range attribute.
Parameters:
stRange - start range.
Throws:
SMSException - if an error is encountered when trying to set
SSOException - if the single sign on token is invalid or expired

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

setEndRange

public void setEndRange(java.lang.String edRange)
                 throws SMSException,
                        SSOException
Sets the end range Attribute.
Parameters:
edRange - end range.
Throws:
SMSException - if an error is encountered when trying to set
SSOException - if the single sign on token is invalid or expired

getValidator

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

setValidator

public void setValidator(java.lang.String valid)
                  throws SMSException,
                         SSOException
Sets the Validator attribute
Parameters:
valid - validator
Throws:
SMSException - if an error is encountered when trying to set
SSOException - 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 type MULTIPLE_CHOICE.
Returns:
the minimum number of values

setMinValue

public void setMinValue(java.lang.String minV)
                 throws SMSException,
                        SSOException
Sets the minimum value attribute.
Parameters:
minV - minimum value.
Throws:
SMSException - if an error is encountered when trying to set
SSOException - 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 type MULTIPLE_CHOICE.
Returns:
the maximum number of values

setMaxValue

public void setMaxValue(java.lang.String maxV)
                 throws SMSException,
                        SSOException
Sets the maximum value attribute.
Parameters:
maxV - maximum value.
Throws:
SMSException - if an error is encountered when trying to set
SSOException - if the single sign on token is invalid or expired

getTrueValue

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

getTrueValueI18NKey

public java.lang.String getTrueValueI18NKey()
Returns 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()
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

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

setAny

public void setAny(java.lang.String a)
            throws SMSException,
                   SSOException
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

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

setPropertiesViewBeanUR

public void setPropertiesViewBeanUR(java.lang.String prop)
                             throws SMSException,
                                    SSOException
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()
Returns true if the attribute is searchable; false otherwise
Returns:
true if the attribute is an optional attribute; false otherwise

setSearchable

public void setSearchable(java.lang.String value)
                   throws SMSException,
                          SSOException
Sets the attribute isSearchable, if value is set to true , or false.
Parameters:
value - if set to true the attribute will be searchable; else searches cannot be performed on this attribute.
Throws:
SMSException - if an error is encountered when trying to set
SSOException - if the single sign on token is invalid or expired

toString

public java.lang.String toString()
Returns a string representation of this AttributeSchema object.
Overrides:
toString in class java.lang.Object
Returns:
String representation of this object


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.