com.waveset.object
Class MetaViewAttribute

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.object.MetaViewAttribute
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject

public class MetaViewAttribute
extends AbstractXmlObject

A MetaViewAttribute represents a single attribute on a MetaView. This contains information such as a name, from where the attribute is derived, and to where the attribute should flow.

Version:
$Revision: 1.12 $

Field Summary
static java.lang.String ATT_AUTHORITATIVE
           
static java.lang.String ATT_MERGE
           
static java.lang.String ATT_NAME
           
static java.lang.String ATT_STORE_LOCALLY
           
static java.lang.String code_id
           
static java.lang.String EL_SOURCES
           
static java.lang.String EL_TARGETS
           
static java.lang.String ELEMENT
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
MetaViewAttribute(org.w3c.dom.Element e)
          Constructor that takes an Element (required by XmlObject).
MetaViewAttribute(java.lang.String name)
          Constructor that takes a name.
 
Method Summary
 void addSource(MetaViewSource source)
          Add a source to this MetaViewAttribute.
 void addTarget(MetaViewTarget target)
          Add a target to this MetaViewAttribute.
 boolean equals(java.lang.Object o)
           
 MetaViewTarget fillInIDMUserTarget(boolean isOperational)
          Create an "IDM User" target for this MetaViewAttribute if the attribute is local or operational - unless this attribute already has a global target.
 java.lang.String getElementName()
          Return the element name for the MetaViewAttribute element.
 java.lang.String getLocalAttributeName()
          Get the target attribute name of the User Extended Attribute that stores this MetaViewAttribute's value (if the attribute is local).
 java.lang.String getName()
           
 java.util.List getReferences()
          Return all ObjectRefs referenced by this attribute.
 java.util.List getSources()
          Return the List of MetaViewSources, or an empty list if none have been set.
 java.util.List getTargets()
           
 int hashCode()
           
 boolean isAuthoritative()
           
 boolean isMergeWithValues()
           
 boolean isStoredLocally()
           
 void parseXml(org.w3c.dom.Element e)
          Parse the given XML into a MetaViewAttribute.
 void removeSource(ObjectRef sourceRef, java.lang.String attrName)
          Remove a MetaViewSource with the given source ObjectRef and attribute name.
 void removeTarget(ObjectRef targetRef, java.lang.String attrName)
          Remove a MetaViewTarget with the given target ObjectRef and attribute name.
 void setAuthoritative(boolean authoritative)
           
 void setMergeWithValues(boolean mergeWithValues)
           
 void setName(java.lang.String name)
           
 void setSources(java.util.List sources)
           
 void setStoreLocally(boolean storeLocally)
           
 void setTargets(java.util.List targets)
           
 java.lang.String toString()
           
 void toXml(java.lang.StringBuffer b, int indent)
          Serialize into a buffer with optional indentation.
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

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

ELEMENT

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

ATT_NAME

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

ATT_STORE_LOCALLY

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

ATT_AUTHORITATIVE

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

ATT_MERGE

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

EL_SOURCES

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

EL_TARGETS

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

MetaViewAttribute

public MetaViewAttribute(java.lang.String name)
                  throws WavesetException
Constructor that takes a name.

Throws:
WavesetException - If the name is null.

MetaViewAttribute

public MetaViewAttribute(org.w3c.dom.Element e)
                  throws WavesetException
Constructor that takes an Element (required by XmlObject).

Parameters:
e - The Element from which to construct this object.
Method Detail

getReferences

public java.util.List getReferences()
Return all ObjectRefs referenced by this attribute.

Returns:
All ObjectRefs referenced by this attribute.
See Also:
PersistentObject.getReferences()

getName

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

setName

public void setName(java.lang.String name)
             throws WavesetException
Parameters:
name - The name to set.
Throws:
WavesetException - If the name is null.

getSources

public java.util.List getSources()
Return the List of MetaViewSources, or an empty list if none have been set.

Returns:
Returns the List of MetaViewSources, or an empty list if none have been set.

setSources

public void setSources(java.util.List sources)
                throws WavesetException
Parameters:
sources -
Throws:
WavesetException

addSource

public void addSource(MetaViewSource source)
               throws WavesetException
Add a source to this MetaViewAttribute.

Parameters:
source - The source to add.
Throws:
WavesetException - If adding the source would cause a circular reference, or the source is a duplicate.

removeSource

public void removeSource(ObjectRef sourceRef,
                         java.lang.String attrName)
Remove a MetaViewSource with the given source ObjectRef and attribute name.

Parameters:
sourceRef - The ObjectRef of the source to be removed.
attrName - The attribute name of the source to be removed.

isStoredLocally

public boolean isStoredLocally()
Returns:
Returns the storeLocally.

setStoreLocally

public void setStoreLocally(boolean storeLocally)
Parameters:
storeLocally - The storeLocally to set.

isAuthoritative

public boolean isAuthoritative()
Returns:
Returns whether the attribute is authoritative. Ignored when mergeWithValues is true.

setAuthoritative

public void setAuthoritative(boolean authoritative)
Parameters:
authoritative - Whether the attribute is authoritative or not.

isMergeWithValues

public boolean isMergeWithValues()
Returns:
Returns whether the attribute is to be mergedWithValues.

setMergeWithValues

public void setMergeWithValues(boolean mergeWithValues)
Parameters:
mergeWithValues - Whether the attribute values is to merged or not. When this is true, the authoritative attribute is ignored.

getTargets

public java.util.List getTargets()
Returns:
Returns the targets.

setTargets

public void setTargets(java.util.List targets)
                throws WavesetException
Parameters:
targets -
Throws:
WavesetException

addTarget

public void addTarget(MetaViewTarget target)
               throws WavesetException
Add a target to this MetaViewAttribute.

Parameters:
target - The target to add to this MetaViewAttribute.
Throws:
WavesetException - If the target is a circular reference or is a duplicate.

removeTarget

public void removeTarget(ObjectRef targetRef,
                         java.lang.String attrName)
Remove a MetaViewTarget with the given target ObjectRef and attribute name.

Parameters:
targetRef - The ObjectRef of the target to be removed.
attrName - The attribute name of the target to be removed.

fillInIDMUserTarget

public MetaViewTarget fillInIDMUserTarget(boolean isOperational)
                                   throws WavesetException
Create an "IDM User" target for this MetaViewAttribute if the attribute is local or operational - unless this attribute already has a global target.

Parameters:
isOperational - Whether this attribute is operational.
Returns:
The new or existing MetaViewTarget for the IDM User, or null if this attribute has a global target, is not local, or is not operational.
Throws:
WavesetException

getLocalAttributeName

public java.lang.String getLocalAttributeName()
Get the target attribute name of the User Extended Attribute that stores this MetaViewAttribute's value (if the attribute is local).

Returns:
The target attribute name of the User Extended Attribute that stores this MetaViewAttribute's value (if the attribute is local).

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

toString

public java.lang.String toString()

getElementName

public java.lang.String getElementName()
Return the element name for the MetaViewAttribute element.

Specified by:
getElementName in interface XmlObject
Specified by:
getElementName in class AbstractXmlObject

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Description copied from class: AbstractXmlObject
Serialize into a buffer with optional indentation. This must be implemented by the subclass.

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject

parseXml

public void parseXml(org.w3c.dom.Element e)
              throws WavesetException
Parse the given XML into a MetaViewAttribute.

Parameters:
e - The XML element to parse.
Throws:
WavesetException