com.waveset.object
Class MetaViewTarget

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

public class MetaViewTarget
extends AbstractXmlObject

A class that represents a target for a MetaViewAttribute. This encapsulates the target resource, the condition on which the target is flowed, and the event types on which target is flowed.

Version:
$Revision: 1.9 $

Field Summary
static java.lang.String ATT_EVENT_TYPES
           
static java.lang.String ATT_GLOBAL
           
static java.lang.String ATT_TARGET_ATTRIBUTE_NAME
           
static java.lang.String code_id
           
static java.lang.String CREATE
           
static java.lang.String EL_CONDITION
           
static java.lang.String EL_TARGET_RESOURCE
           
static java.lang.String ELEMENT
           
static java.lang.String[] EVENT_TYPES
           
static java.lang.String UPDATE
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
MetaViewTarget(org.w3c.dom.Element e)
          Construct from an XML element.
MetaViewTarget(ObjectRef target, java.lang.String targetAttributeName, ObjectRef condition, boolean global)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean flowsOnEventType(java.lang.String eventType)
          Return whether this target should receive its attribute for the given event type.
 ObjectRef getConditionRef()
          Return the ObjectRef of the condition that can restrict the flow to this target, or null if there is no condition.
 java.lang.String getElementName()
          Return the element name.
 java.util.List getReferences()
          Return all ObjectRefs referenced by this attribute.
 java.lang.String getTargetAttributeName()
          Return the name of the attribute on the target resource.
 ObjectRef getTargetRef()
          Return the target ObjectRef, or null if the target is assumed to be the MetaView itself.
 int hashCode()
           
 boolean isGlobal()
          Return whether the target is global or not.
 void setConditionRef(ObjectRef condition)
           
 void setFlowsOnEventType(java.lang.String eventType, boolean flows)
          Set whether this target should (or should not) receive its attribute for the given event type.
 void setGlobal(boolean global)
          Set whether the target is global or not.
 void setTargetAttributeName(java.lang.String name)
           
 void setTargetRef(ObjectRef ref)
           
 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

CREATE

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

UPDATE

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

EVENT_TYPES

public static final java.lang.String[] EVENT_TYPES

ELEMENT

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

ATT_GLOBAL

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

ATT_TARGET_ATTRIBUTE_NAME

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

ATT_EVENT_TYPES

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

EL_TARGET_RESOURCE

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

EL_CONDITION

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

MetaViewTarget

public MetaViewTarget(ObjectRef target,
                      java.lang.String targetAttributeName,
                      ObjectRef condition,
                      boolean global)
Constructor.

Parameters:
target - The ObjectRef of the target resource. This can be null if the target is IDM (either a local, global, or operational attribute).
targetAttributeName - The name of the attribute on the target to be set.
condition - The ObjectRef of the condition to be applied to this target.
global - Whether this is a global target.

MetaViewTarget

public MetaViewTarget(org.w3c.dom.Element e)
               throws WavesetException
Construct from an XML element.

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()

getTargetRef

public ObjectRef getTargetRef()
Return the target ObjectRef, or null if the target is assumed to be the MetaView itself.

Returns:
The target ObjectRef, or null if the target is assumed to be the MetaView itself.

setTargetRef

public void setTargetRef(ObjectRef ref)

getConditionRef

public ObjectRef getConditionRef()
Return the ObjectRef of the condition that can restrict the flow to this target, or null if there is no condition.

Returns:
The ObjectRef of the condition that can restrict the flow to this target, or null if there is no condition.

setConditionRef

public void setConditionRef(ObjectRef condition)

isGlobal

public boolean isGlobal()
Return whether the target is global or not.

Returns:
True if the target is global, false otherwise.

setGlobal

public void setGlobal(boolean global)
Set whether the target is global or not.

Parameters:
global - Whether the target is global or not.

getTargetAttributeName

public java.lang.String getTargetAttributeName()
Return the name of the attribute on the target resource.

Returns:
The name of the attribute on the target resource.

setTargetAttributeName

public void setTargetAttributeName(java.lang.String name)

flowsOnEventType

public boolean flowsOnEventType(java.lang.String eventType)
Return whether this target should receive its attribute for the given event type.

Parameters:
eventType - The event type to check - should be one of the event type constants (CREATE, UPDATE, etc...).
Returns:
True if this target should receive its attribute for the given event type.

setFlowsOnEventType

public void setFlowsOnEventType(java.lang.String eventType,
                                boolean flows)
Set whether this target should (or should not) receive its attribute for the given event type.

Parameters:
eventType - The event type for which to set the flow status - should be one of the event type constants (CREATE, UPDATE, etc...)
flows - Whether or not the target should receive its attribute for the given eventType.

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

toString

public java.lang.String toString()

getElementName

public java.lang.String getElementName()
Description copied from class: AbstractXmlObject
Return the element name.

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