com.waveset.object
Class AccountAttributeType

java.lang.Object
  extended bycom.waveset.object.AccountAttributeType
All Implemented Interfaces:
java.lang.Comparable

public class AccountAttributeType
extends java.lang.Object
implements java.lang.Comparable

Provides the mapping between a Waveset user attribute and a resource-specific account attribute. It can also provide default values for the resource account attribute if the Waveset user does not have a value.

If a Waveset user attribute is used across multiple resources, it should be defined globally as an AttributeDefinition.

See Also:
setAttributeDefinition(AttributeDefinition),

If a Waveset user attribute is used only for a single resource, it can be described locally using methods of this class:

  • {@link #setName()}
  • {@link #setSyntax()}
  • {@link #setMulti()}
  • {@link #setOrdered()}
  • {@link #setReadOnly()}
  • {@link #setWriteOnly()}

it should refer to an AttributeDefinition.

NOTE:Fields that describe how the attribute maps to a Resource are always defined locally:

  • {@link #setMapName()}
  • {@link #setMapType()}
  • {@link #setRequired()}
  • {@link #setIsAuditable()}

Field Summary
static java.lang.String ATT_ID
           
static java.lang.String ATT_MULTI
           
static java.lang.String ATT_ORDERED
           
static java.lang.String ATT_READONLY
           
static java.lang.String ATT_VISUALIZE
           
static java.lang.String ATT_WRITEONLY
           
static java.lang.String code_id
           
static java.lang.String EL_VIEWS
           
protected static Trace trace
           
 
Constructor Summary
AccountAttributeType()
          Be sure to use setParent() to set the parent of this account attribute type, so it can use the parent to resolve the object reference to the Attribute Definition object.
AccountAttributeType(PersistentObject parent)
           
AccountAttributeType(PersistentObject parent, ObjectRef attrDefRef, java.lang.String mapName, java.lang.String mapType, boolean required)
           
 
Method Summary
 int compareTo(java.lang.Object what)
          Implement compareTo for comparable.
 java.lang.Object[] getAllValues()
          Returns an array of the the attribute's values.
 AttributeDefinition getAttributeDefinition()
           
 ObjectRef getAttributeDefinitionRef()
          Method for callers that cannot resolve references but still need to know whether this is a global attribute definition.
 java.lang.String getAttrType()
          Deprecated. since 2.5. Use getSyntax() instead.
 AttributeValues getAttrValues()
           
 int getId()
           
 boolean getIsOrdered()
           
 java.lang.String getMapName()
           
 java.lang.String getMapType()
           
 java.lang.String getName()
           
 PersistentObject getParent()
           
 boolean getRequired()
           
 Syntax getSyntax()
           
 java.lang.Object getValue()
          Returns one of the attribute's values.
 java.util.List getViews()
           
 boolean isAuditable()
           
 boolean isMulti()
          Return true if the attribute supports multiple values.
 boolean isOrdered()
           
 boolean isReadOnly()
           
 boolean isRequired()
           
 boolean isWriteOnly()
           
 void parseXml(org.w3c.dom.Element e)
           
 void parseXml(java.lang.String xml)
           
 void prepareForSerialization()
          Override PersistentObject to resolve any reference to an instance of AttributeDefinition this object may need in order to serialize itself as XML.
 void setAttributeDefinition(AttributeDefinition attrDef)
           
 void setAttributeDefinitionRef(ObjectRef ref)
           
 void setAttrType(java.lang.String attrType)
          Deprecated. since 2.5. Use setSyntax() instead.
 void setIsAuditable(boolean auditable)
           
 void setMapName(java.lang.String mapName)
           
 void setMapType(java.lang.String mapType)
           
 void setMulti(boolean b)
           
 void setName(java.lang.String name)
          Sets the _name value.
 void setOrdered(boolean b)
           
 void setParent(PersistentObject parent)
           
 void setReadOnly(boolean b)
           
 void setRequired(boolean required)
           
 void setSyntax(java.lang.String syntaxName)
           
 void setSyntax(Syntax syntax)
          Sets the _syntax value.
 void setValue(java.lang.Object value)
          Adds the value to the attribute's values.
 void setValue(java.lang.Object value, java.lang.String type)
          Method that should only be used for testing
 void setViews(java.util.List views)
           
 void setVisualize(boolean b)
           
 void setWriteOnly(boolean b)
           
 java.lang.String toString()
           
 java.lang.String toXml()
           
 void toXml(java.lang.StringBuffer buf)
           
 boolean visualize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

trace

protected static final Trace trace

EL_VIEWS

public static final java.lang.String EL_VIEWS
See Also:
Constant Field Values

ATT_ID

public static final java.lang.String ATT_ID
See Also:
Constant Field Values

ATT_MULTI

public static final java.lang.String ATT_MULTI
See Also:
Constant Field Values

ATT_ORDERED

public static final java.lang.String ATT_ORDERED
See Also:
Constant Field Values

ATT_READONLY

public static final java.lang.String ATT_READONLY
See Also:
Constant Field Values

ATT_WRITEONLY

public static final java.lang.String ATT_WRITEONLY
See Also:
Constant Field Values

ATT_VISUALIZE

public static final java.lang.String ATT_VISUALIZE
See Also:
Constant Field Values
Constructor Detail

AccountAttributeType

public AccountAttributeType(PersistentObject parent)

AccountAttributeType

public AccountAttributeType()
Be sure to use setParent() to set the parent of this account attribute type, so it can use the parent to resolve the object reference to the Attribute Definition object. Note: when you add an account attribute type to a Resource, the resource will set the parent.


AccountAttributeType

public AccountAttributeType(PersistentObject parent,
                            ObjectRef attrDefRef,
                            java.lang.String mapName,
                            java.lang.String mapType,
                            boolean required)
Method Detail

getId

public int getId()

setMulti

public void setMulti(boolean b)

setOrdered

public void setOrdered(boolean b)

setReadOnly

public void setReadOnly(boolean b)

setWriteOnly

public void setWriteOnly(boolean b)

setVisualize

public void setVisualize(boolean b)

setViews

public void setViews(java.util.List views)

getParent

public PersistentObject getParent()

setParent

public void setParent(PersistentObject parent)

toString

public java.lang.String toString()

getName

public java.lang.String getName()
Returns:
the name of the attribute. The name of the associated attribute definition (if any) overrides the local name.

getSyntax

public Syntax getSyntax()
Returns:
the syntax of the attribute . The syntax of the associated attribute definition (if any) overrides the local syntax.

getAttrType

public java.lang.String getAttrType()
Deprecated. since 2.5. Use getSyntax() instead.

Gets the syntax of the attribute from the associated attribute definition.


isOrdered

public boolean isOrdered()
Returns:
true if the order of attribute values is significant; otherwise false.

Normally this will be specified with the _ordered field though we also allow it to be defined in an external AttributeDefinition object.


isMulti

public boolean isMulti()
Return true if the attribute supports multiple values. Normally this will be specified with the _multi field though we also allow it to be defined in an external AttributeDefinition object.


getValue

public java.lang.Object getValue()
Returns one of the attribute's values.


getAllValues

public java.lang.Object[] getAllValues()
Returns an array of the the attribute's values.


getAttrValues

public AttributeValues getAttrValues()

getMapName

public java.lang.String getMapName()

getMapType

public java.lang.String getMapType()

getRequired

public boolean getRequired()

isRequired

public boolean isRequired()

isAuditable

public boolean isAuditable()

isReadOnly

public boolean isReadOnly()

isWriteOnly

public boolean isWriteOnly()

visualize

public boolean visualize()

getViews

public java.util.List getViews()

getIsOrdered

public boolean getIsOrdered()

getAttributeDefinition

public AttributeDefinition getAttributeDefinition()
                                           throws WavesetException
Returns:
AttributeDefinition.
Throws:
WavesetException - if no AttributeDefinition can be found.

getAttributeDefinitionRef

public ObjectRef getAttributeDefinitionRef()
Method for callers that cannot resolve references but still need to know whether this is a global attribute definition.


setName

public void setName(java.lang.String name)
Sets the _name value. Extraneous when there is an attribute definition since the attribute definition name overrides any local value.


setSyntax

public void setSyntax(Syntax syntax)
Sets the _syntax value. Extraneous when there is an attribute definition since the attribute definition syntax overrides any local value.


setSyntax

public void setSyntax(java.lang.String syntaxName)

setAttrType

public void setAttrType(java.lang.String attrType)
Deprecated. since 2.5. Use setSyntax() instead.


setValue

public void setValue(java.lang.Object value)
              throws WavesetException
Adds the value to the attribute's values. If the value is null, then all of the attribute's values are cleared (i.e., the attribute no longer has a value).

Throws:
WavesetException

setValue

public void setValue(java.lang.Object value,
                     java.lang.String type)
              throws WavesetException
Method that should only be used for testing

Throws:
WavesetException

setMapName

public void setMapName(java.lang.String mapName)

setMapType

public void setMapType(java.lang.String mapType)

setRequired

public void setRequired(boolean required)

setIsAuditable

public void setIsAuditable(boolean auditable)

setAttributeDefinition

public void setAttributeDefinition(AttributeDefinition attrDef)

setAttributeDefinitionRef

public void setAttributeDefinitionRef(ObjectRef ref)

compareTo

public int compareTo(java.lang.Object what)
Implement compareTo for comparable. Used for sorting, sort by name and then by value.

Specified by:
compareTo in interface java.lang.Comparable

prepareForSerialization

public void prepareForSerialization()
                             throws WavesetException
Override PersistentObject to resolve any reference to an instance of AttributeDefinition this object may need in order to serialize itself as XML.

Throws:
WavesetException

toXml

public java.lang.String toXml()

toXml

public void toXml(java.lang.StringBuffer buf)

parseXml

public void parseXml(java.lang.String xml)
              throws WavesetException
Throws:
WavesetException

parseXml

public void parseXml(org.w3c.dom.Element e)
              throws WavesetException
Throws:
WavesetException