appilog.common.system.types
Class ObjectStateHolder

java.lang.Object
  extended by appilog.common.system.types.ObjectStateHolder
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class ObjectStateHolder
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

The ObjectStateHolder class is a way to represent an object or link defined in the CMDB. The ObjectStateHolder object contains the CIT name and a list of attributes and their values. The jython script formats each discovered CI to ObjectStateHolder instance, and then sends all the discovered CIs as a vector.
In order to create a new CI in the uCMDB, create AN ObjectStateHolder with the relevant CIT name and all the key attributes. The CIT can be specified in the constructor (see the following examples) or by the function setObjectClass(String className) The attributes can be set by the different setAttribute(String attrName, Object value) functions.
If a CI with the same type and the same key attributes already exists in the CMDB, the CI will be updated.
For example, the following object represents an IP CI:


 // Create a CI of type IP
 ObjectStateHolder ipOSH = new ObjectStateHolder("ip");
 // Set the key attributes
 ipOSH.setStringAttribute("ip_address", ipAddress);
 ipOSH.setStringAttribute("ip_domain", domainName);
 ipOSH.setStringAttribute("ip_probename", probeName);
 // Set some other attribute
 if (dnsname != null)
      ipOSH.setStringAttribute("ip_dnsname", dnsname);
 
If you know the CI object ID and just want to update attributes, you can create an ObjectStateHolder instance with the object type and the object ID and set only those attributes that need to be updated.

Links
The link can also be defined by ObjectStateHolder object:

 // Init the Host and IP CIs
 end1 = new ObjectStateHolder("ip");
 end2 = new ObjectStateHolder("host");
 
// Create the link ObjectStateHolder link = ObjectStateHolder(linkTypeName); link.setAttribute("link_end1", end1); link.setAttribute("link_end2", end2);
The end1 and end2 attributes of the link specify the nodes at the end of each link. These attributes must be specified because they are the minimal key attributes of each link. The attribute values are ObjectStateHolders.
Important: A link is directed! Verify in the MAM that end1 and end2 nodes correspond to valid types at each end. If this is not done, the result object will fail discovery validation and will not be reported correctly.

Containers
In order to set the container of an object you can use the setContainer(ObjectStateHolder container) method. For example, creating a Siebel application server CI contained inside a host:

 // create a CI of type ‘siebelappserver’
 ObjectStateHolder appServerOSH = ObjectStateHolder('siebelappserver' );
 // set the 'data_name' and 'application_ip' attributes
 appServerOSH.setStringAttribute('data_name', siebelServerName);
 appServerOSH.setStringAttribute ('application_ip', ip);
 

// bind it to a Host as a container (The host is another ObjectStateHolder defined in our scope) appServerOSH.setContainer(appServerHostOSH);

See Also:
Serialized Form

Field Summary
static java.lang.String ATTR_CLASS
           
static java.lang.String ATTR_ID
           
static CmdbObjectID CMDB_ID_UNKNOWN
          CMDB ID that represents an Unknown ID
static java.lang.String NAME_DELIM
          delimeter hierarchical names
static java.lang.String XML_ATTR_ANCHOR_ID
           
static java.lang.String XML_ATTR_CLASS
           
static java.lang.String XML_ATTR_CONTAINER
           
static java.lang.String XML_ATTR_ID
           
static java.lang.String XML_ATTR_ID_TYPE
           
static java.lang.String XML_ATTR_IS_ANCHOR
           
static java.lang.String XML_ATTR_IS_REFERENCE
           
static java.lang.String XML_ATTR_SUBSYSTEM
           
static java.lang.String XML_ROOT_ELEMENT_NAME
           
 
Constructor Summary
ObjectStateHolder()
          Constructs a default object state holder
ObjectStateHolder(boolean isReferenceOnly)
           
ObjectStateHolder(Element element)
          Constructs an object state holder
ObjectStateHolder(java.lang.String objectClass)
          Constructs an object state holder
ObjectStateHolder(java.lang.String objectClass, CmdbLinkID objectId)
           
ObjectStateHolder(java.lang.String objectClass, CmdbLinkID objectId, java.util.Collection attrColl)
           
ObjectStateHolder(java.lang.String objectClass, CmdbLinkID objectId, java.util.Collection attrColl, boolean isReferenceOnly)
           
ObjectStateHolder(java.lang.String objectClass, CmdbObjectID objectId)
           
ObjectStateHolder(java.lang.String objectClass, CmdbObjectID objectId, java.util.Collection attrColl)
           
ObjectStateHolder(java.lang.String objectClass, CmdbObjectID objectId, java.util.Collection attrColl, boolean isReferenceOnly)
           
ObjectStateHolder(java.lang.String objectClass, java.util.Collection attrColl)
           
ObjectStateHolder(java.lang.String objectClass, int objectSubSystem, CmdbLinkID objectId)
          Deprecated.  
ObjectStateHolder(java.lang.String objectClass, int objectSubSystem, CmdbLinkID objectId, java.util.Collection attrColl)
          Deprecated.  
ObjectStateHolder(java.lang.String objectClass, int objectSubSystem, CmdbLinkID objectId, java.util.Collection attrColl, boolean isReferenceOnly)
           
ObjectStateHolder(java.lang.String objectClass, int objectSubSystem, CmdbObjectID objectId)
          Deprecated.  
ObjectStateHolder(java.lang.String objectClass, int objectSubSystem, CmdbObjectID objectId, java.util.Collection attrColl)
          Deprecated.  
ObjectStateHolder(java.lang.String objectClass, int objectSubSystem, CmdbObjectID objectId, java.util.Collection attrColl, boolean isReferenceOnly)
           
ObjectStateHolder(java.lang.String objectClass, int objectSubSystem, java.lang.String id, int type)
          Deprecated.  
ObjectStateHolder(java.lang.String objectClass, java.lang.String id, int type)
           
 
Method Summary
 void addAttributeToList(AttributeStateHolder attrSH)
          Adds new element to the list of elements for the current attribute.
 void addAttributeToList(java.lang.String name, java.lang.Object value)
          Adds new element to the list of elements for the current attribute.
 java.lang.Object clone()
          Returns a clone of this state holder.
 int compareTo(java.lang.Object o)
          Compares this ObjectStateHolder to another Object.
 int compareTo(ObjectStateHolder other)
          Compares two ObjectStateHolders by their IDs.
 java.lang.Object deepClone()
          Returns a deep clone of this state holder.
 boolean equals(java.lang.Object anObject)
          Compares this state holder to the specified object.
 AttributeStateHolder findAttr(java.lang.String attrName)
           
 java.lang.String getAnchorID()
           
 AttributeStateHolder getAttribute(java.lang.String attrName)
          Gets an attribute state holder by attribute name
 java.util.Collection<AttributeStateHolder> getAttributeAll()
          Returns an object attributes collection
 java.lang.Object getAttributeValue(java.lang.String attrName)
           
 CmdbDataID getCmdbId()
          Gets the CMDB identifier as a object
 int getCmdbIdType()
          Returns the type of the CMDB identifier
 CmdbLinkID getCmdbLinkId()
          Gets the CMDB link ID
 CmdbObjectID getCmdbObjectId()
          Returns the CMDB object ID
 java.lang.String getObjectClass()
          Returns the object class of the ObjectStateHolder
 int hashCode()
          Returns a hash code to identify this object.
 boolean isAnchor()
           
 boolean isReference()
           
static ObjectStateHolder parseXml(java.io.InputStream xmlStream)
           
static ObjectStateHolder parseXml(java.lang.String xmlString)
           
 void removeAttribute(java.lang.String attrName)
          Removes the specified attribute
 void removeAttributeAll()
          Clears the object attributes table.
 void removeAttributeFromList(AttributeStateHolder attrSH)
          Adds new element to the list of elements for the current attribute.
 void removeAttributeFromList(java.lang.String name, java.lang.Object value)
          Adds new element to the list of elements for the current attribute.
 void resetId()
          Resets the ID of the configuration item.
 void setAnchor(boolean anchor)
           
 void setAnchorID(java.lang.String anchorID)
           
 void setAttribute(AttributeStateHolder attrSH)
          Sets value for current attribute.
 void setAttribute(java.lang.String attrName, java.lang.Object value)
          Sets the value for current attribute.
 void setAttributeAll(java.util.Collection attrColl)
          Sets an object attributes table.
 void setBoolAttribute(java.lang.String attrName, boolean value)
           
 void setBoolAttribute(java.lang.String attrName, java.lang.String value)
           
 void setBytesAttribute(java.lang.String attrName, byte[] data)
           
 void setBytesAttribute(java.lang.String attName, java.lang.String data)
           
 void setCmdbLinkId(CmdbLinkID id)
          Sets the CMDB link ID
 void setCmdbObjectId(CmdbObjectID id)
          Sets the CMDB object ID
 void setcomparator(AppilogComparator newComparator)
           
 void setContainer(CmdbObjectID container)
          Sets the container ID for this CI.
 void setContainer(java.lang.String attrName, ObjectStateHolder container)
          Deprecated.  
 void setDateAttribute(java.lang.String attrName, java.util.Date value)
           
 void setDateAttribute(java.lang.String attrName, java.lang.String dateStr)
           
 void setDoubleAttribute(java.lang.String attrName, double value)
           
 void setDoubleAttribute(java.lang.String attrName, java.lang.String value)
           
 void setEnumAttribute(java.lang.String attrName, int value)
           
 void setFloatAttribute(java.lang.String attrName, float value)
           
 void setFloatAttribute(java.lang.String attrName, java.lang.String value)
           
 void setIntegerAttribute(java.lang.String attrName, int value)
           
 void setIntegerAttribute(java.lang.String attrName, java.lang.String value)
           
 void setLinkIDAttribute(java.lang.String attrName, java.lang.Object value)
           
 void setListAttribute(AttributeStateHolder attrSH)
          Adds new element to the list of elements for the current attribute.
 void setListAttribute(java.lang.String name, java.lang.Object[] values)
          Sets new values to the list of elements for the current attribute (CLEARS EXISTING OSH ATTRIBUTE VALUES).
 void setLongAttribute(java.lang.String attrName, long value)
           
 void setLongAttribute(java.lang.String attrName, java.lang.String value)
           
 void setObjectClass(java.lang.String className)
          Sets an object class
 void setObjectIDAttribute(java.lang.String attrName, CmdbObjectID cmdbId)
           
 void setObjectIDAttribute(java.lang.String attrName, java.lang.String strIdValue)
           
 void setOSHAttribute(java.lang.String attrName, ObjectStateHolder value)
           
 void setStringAttribute(java.lang.String attrName, java.lang.String value)
           
 java.lang.String toString()
          Returns the object representation as a string.
 Element toXml()
          Returns the object representation as an XML string.
 java.lang.String toXmlString()
          Returns object state holder representation in XML string format
 java.lang.String toXmlString(boolean withEncoding)
          Returns object state holder representation in XML string format
 java.lang.StringBuffer toXmlString(java.lang.StringBuffer xml, boolean withEncoding)
           
 void undoReference()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME_DELIM

public static final java.lang.String NAME_DELIM
delimeter hierarchical names

See Also:
Constant Field Values

CMDB_ID_UNKNOWN

public static final CmdbObjectID CMDB_ID_UNKNOWN
CMDB ID that represents an Unknown ID


ATTR_CLASS

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

ATTR_ID

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

XML_ROOT_ELEMENT_NAME

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

XML_ATTR_ID

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

XML_ATTR_ID_TYPE

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

XML_ATTR_CLASS

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

XML_ATTR_SUBSYSTEM

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

XML_ATTR_CONTAINER

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

XML_ATTR_IS_REFERENCE

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

XML_ATTR_ANCHOR_ID

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

XML_ATTR_IS_ANCHOR

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

ObjectStateHolder

public ObjectStateHolder()
Constructs a default object state holder


ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         int objectSubSystem,
                         CmdbObjectID objectId,
                         java.util.Collection attrColl)
Deprecated. 

Constructs an object state holder

Parameters:
objectClass - The CIT of the object
objectSubSystem - The subsystem of the object
objectId - The object ID. Available values are:
  • ID_NEW - for new objects
  • ID_UNLNOWN - for unknown objects, that contain conditions
  • Any positive object ID
attrColl - The hash table of object attributes. The key should be an attribute name

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         int objectSubSystem,
                         CmdbObjectID objectId,
                         java.util.Collection attrColl,
                         boolean isReferenceOnly)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         CmdbObjectID objectId,
                         java.util.Collection attrColl)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         CmdbObjectID objectId,
                         java.util.Collection attrColl,
                         boolean isReferenceOnly)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         int objectSubSystem,
                         CmdbLinkID objectId,
                         java.util.Collection attrColl)
Deprecated. 

Constructs an object state holder

Parameters:
objectClass - The CIT of the object
objectSubSystem - The subsystem of the object
objectId - The object ID. Available values are:
  • ID_NEW - for new objects
  • ID_UNLNOWN - for unknown objects, that contain conditions
  • Any positive object ID
attrColl - The hash table of object attributes. The key should be an attribute name

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         int objectSubSystem,
                         CmdbLinkID objectId,
                         java.util.Collection attrColl,
                         boolean isReferenceOnly)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         CmdbLinkID objectId,
                         java.util.Collection attrColl)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         CmdbLinkID objectId,
                         java.util.Collection attrColl,
                         boolean isReferenceOnly)

ObjectStateHolder

public ObjectStateHolder(boolean isReferenceOnly)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         java.util.Collection attrColl)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         int objectSubSystem,
                         CmdbObjectID objectId)
Deprecated. 

Constructs an object state holder

Parameters:
objectClass - The CIT of the object
objectSubSystem - The subsystem of the object
objectId - The object ID. Available values are:
  • ID_NEW - for new objects
  • ID_REQUIRED - for unknown objects, that contain conditions
  • Any positive object ID

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         CmdbObjectID objectId)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         int objectSubSystem,
                         CmdbLinkID objectId)
Deprecated. 

Constructs an object state holder

Parameters:
objectClass - The CIT of the object
objectSubSystem - The subsystem of the object
objectId - The object ID. Available values are:
  • ID_NEW - for new objects
  • ID_REQUIRED - for unknown objects, that contain conditions
  • Any positive object ID

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         CmdbLinkID objectId)

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass)
Constructs an object state holder

Parameters:
objectClass - The CIT of the object

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         int objectSubSystem,
                         java.lang.String id,
                         int type)
Deprecated. 

Parameters:
objectClass - The CIT of the object
objectSubSystem - The subsystem of the object
id -
type - the type of the ID - AppilogTypes.CMDB_OBJECT_ID or AppilogTypes.CMDB_LINK_ID_DEF

ObjectStateHolder

public ObjectStateHolder(java.lang.String objectClass,
                         java.lang.String id,
                         int type)

ObjectStateHolder

public ObjectStateHolder(Element element)
Constructs an object state holder

Parameters:
element - The XML element contains object definition
Method Detail

parseXml

public static ObjectStateHolder parseXml(java.io.InputStream xmlStream)
                                  throws AppilogIllegalParameterException
Throws:
AppilogIllegalParameterException

parseXml

public static ObjectStateHolder parseXml(java.lang.String xmlString)
                                  throws AppilogIllegalParameterException
Throws:
AppilogIllegalParameterException

getObjectClass

public java.lang.String getObjectClass()
Returns the object class of the ObjectStateHolder

Returns:
The class name

setObjectClass

public void setObjectClass(java.lang.String className)
Sets an object class

Parameters:
className - The class name of the ObjectStateHolder

getCmdbIdType

public int getCmdbIdType()
Returns the type of the CMDB identifier

Returns:
AppilogTypes.CMDB_OBJECT_ID_DEF or AppilogTypes.CMDB_LINK_ID_DEF

getCmdbObjectId

public CmdbObjectID getCmdbObjectId()
Returns the CMDB object ID

Returns:
cmdb object id or null if the object state holder represents cmdb link

setCmdbObjectId

public void setCmdbObjectId(CmdbObjectID id)
Sets the CMDB object ID

Parameters:
id - The cmdb object ID to be set

getCmdbLinkId

public CmdbLinkID getCmdbLinkId()
Gets the CMDB link ID

Returns:
CMDB link ID or null if the object state holder represents CMDB object

setCmdbLinkId

public void setCmdbLinkId(CmdbLinkID id)
Sets the CMDB link ID

Parameters:
id - the CMDB link ID to be set

getCmdbId

public CmdbDataID getCmdbId()
Gets the CMDB identifier as a object

Returns:
CMDB ID

getAttributeAll

public java.util.Collection<AttributeStateHolder> getAttributeAll()
Returns an object attributes collection

Returns:
A reference to the collection of the AttributeStateHolder part of this ObjectStateHolder

setAttributeAll

public void setAttributeAll(java.util.Collection attrColl)
Sets an object attributes table. If the attrColl parameter is null, the attribute table is cleared.

Parameters:
attrColl - The collection of attributes to set on this ObjectStateHolder instance

removeAttributeAll

public void removeAttributeAll()
Clears the object attributes table.


setContainer

public void setContainer(CmdbObjectID container)
Sets the container ID for this CI.


setContainer

public void setContainer(java.lang.String attrName,
                         ObjectStateHolder container)
Deprecated. 

This method only for backword compatibility in Jython scripts

Parameters:
attrName - deprecated
container - container

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String attrName)

getAttribute

public AttributeStateHolder getAttribute(java.lang.String attrName)
Gets an attribute state holder by attribute name

Parameters:
attrName - The attribute name
Returns:
An AttributeStateHolder or null if no holder exists

setAttribute

public void setAttribute(AttributeStateHolder attrSH)
Sets value for current attribute. This function replaced by setAttribute(String, Object). Use this function only for types not defined for the setAttribute function.
If this attribute already exists and has a list value, the list will be replaced by the new one.

Parameters:
attrSH - The attribute state holder to be set
See Also:
setAttribute(String, Object)

setAttribute

public void setAttribute(java.lang.String attrName,
                         java.lang.Object value)
Sets the value for current attribute. If the value is a primitive type, use the relevant setAttribute function. For example, for a string, use setStringAttribute.
If this attribute already exist and has a list value, the list will be replaced by the new one.

Parameters:
attrName - The name of the attribute as defined in the CMDB
value - The new value

setStringAttribute

public void setStringAttribute(java.lang.String attrName,
                               java.lang.String value)

setIntegerAttribute

public void setIntegerAttribute(java.lang.String attrName,
                                int value)

setIntegerAttribute

public void setIntegerAttribute(java.lang.String attrName,
                                java.lang.String value)

setLongAttribute

public void setLongAttribute(java.lang.String attrName,
                             long value)

setLongAttribute

public void setLongAttribute(java.lang.String attrName,
                             java.lang.String value)

setDoubleAttribute

public void setDoubleAttribute(java.lang.String attrName,
                               double value)

setDoubleAttribute

public void setDoubleAttribute(java.lang.String attrName,
                               java.lang.String value)

setBytesAttribute

public void setBytesAttribute(java.lang.String attName,
                              java.lang.String data)

setBytesAttribute

public void setBytesAttribute(java.lang.String attrName,
                              byte[] data)

setDateAttribute

public void setDateAttribute(java.lang.String attrName,
                             java.util.Date value)

setDateAttribute

public void setDateAttribute(java.lang.String attrName,
                             java.lang.String dateStr)

setBoolAttribute

public void setBoolAttribute(java.lang.String attrName,
                             boolean value)

setBoolAttribute

public void setBoolAttribute(java.lang.String attrName,
                             java.lang.String value)

setEnumAttribute

public void setEnumAttribute(java.lang.String attrName,
                             int value)

setObjectIDAttribute

public void setObjectIDAttribute(java.lang.String attrName,
                                 java.lang.String strIdValue)

setLinkIDAttribute

public void setLinkIDAttribute(java.lang.String attrName,
                               java.lang.Object value)

setObjectIDAttribute

public void setObjectIDAttribute(java.lang.String attrName,
                                 CmdbObjectID cmdbId)

setFloatAttribute

public void setFloatAttribute(java.lang.String attrName,
                              float value)

setFloatAttribute

public void setFloatAttribute(java.lang.String attrName,
                              java.lang.String value)

setOSHAttribute

public void setOSHAttribute(java.lang.String attrName,
                            ObjectStateHolder value)

addAttributeToList

public void addAttributeToList(java.lang.String name,
                               java.lang.Object value)
Adds new element to the list of elements for the current attribute. Used for list attributes only. If the attribute already exist, the new elements are appended to current list. Used to APPEND (Union) the current attribute list for the UCMDB object!

Parameters:
name - - The attribute name
value - - The attribute value

removeAttributeFromList

public void removeAttributeFromList(java.lang.String name,
                                    java.lang.Object value)
Adds new element to the list of elements for the current attribute. Used for list attributes only. If the attribute already exist, the new elements are appended to current list. Used to REMOVE the given list values from the UCMDB object!

Parameters:
name - - The attribute name
value - - The attribute value

setListAttribute

public void setListAttribute(java.lang.String name,
                             java.lang.Object[] values)
Sets new values to the list of elements for the current attribute (CLEARS EXISTING OSH ATTRIBUTE VALUES). Used for list attributes only. If the attribute already exist, the new elements are appended to current list. Used to REPLACE the current attribute for the UCMDB object!

Parameters:
name - - The attribute name
values - - Array of new attributes that will replace the current OSH attribute values

addAttributeToList

public void addAttributeToList(AttributeStateHolder attrSH)
Adds new element to the list of elements for the current attribute. Used for list attributes only. If the attribute already exist, the new elements are appended to current list. Used to APPEND (Union) the current attribute list for the UCMDB object!

Parameters:
attrSH - The attribute state holder to be added

removeAttributeFromList

public void removeAttributeFromList(AttributeStateHolder attrSH)
Adds new element to the list of elements for the current attribute. Used for list attributes only. If the attribute already exist, the new elements are appended to current list. Used to REMOVE the given list values from the UCMDB object!

Parameters:
attrSH - The attribute state holder to be added

setListAttribute

public void setListAttribute(AttributeStateHolder attrSH)
Adds new element to the list of elements for the current attribute. Used for list attributes only. If the attribute already exist, the new elements are appended to current list. Used to REPLACE the current attribute for the UCMDB object!

Parameters:
attrSH - The attribute state holder to be added

removeAttribute

public void removeAttribute(java.lang.String attrName)
Removes the specified attribute

Parameters:
attrName - The name of attribute to be removed

toString

public java.lang.String toString()
Returns the object representation as a string.

Overrides:
toString in class java.lang.Object
Returns:
A string

toXml

public Element toXml()
Returns the object representation as an XML string.

Returns:
A string in XML format

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of this state holder. See also deepClone()

Overrides:
clone in class java.lang.Object
Returns:
A clone of this instance.
Throws:
java.lang.CloneNotSupportedException

deepClone

public java.lang.Object deepClone()
                           throws java.lang.CloneNotSupportedException
Returns a deep clone of this state holder. See also clone()

Returns:
A deep clone of this instance
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object anObject)
Compares this state holder to the specified object. The result is true if and only if the argument is not null and is an ObjectStateHolder that represents the same data as this object.

Overrides:
equals in class java.lang.Object
Parameters:
anObject - The object to compare this ObjectStateHolder against.
Returns:
true if the ObjectStateHolders are equal, otherwise false.

hashCode

public int hashCode()
Returns a hash code to identify this object. If not available, returns a hash code for the parent object.

Overrides:
hashCode in class java.lang.Object

setcomparator

public void setcomparator(AppilogComparator newComparator)

resetId

public void resetId()
Resets the ID of the configuration item.


compareTo

public int compareTo(java.lang.Object o)
Compares this ObjectStateHolder to another Object. If the Object is a ObjectStateHolder, this function behaves like compareTo(ObjectStateHolder). Otherwise, it throws a ClassCastException, because ObjectStateHolder objects are comparable only with other ObjectStateHolder objects.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the Object to be compared.
Returns:
The value 0 if the argument is a string lexicographically equal to this string.
A value less than 0 if the argument is a string lexicographically greater than this string.
A value greater than 0 if the argument is a string lexicographically less than this string.
Throws:
java.lang.ClassCastException - if the argument is not a String.
Since:
1.2
See Also:
Comparable

compareTo

public int compareTo(ObjectStateHolder other)
Compares two ObjectStateHolders by their IDs. The result is zero if the IDs are equal. If the IDs are different, compareTo returns the difference of the two IDs: this.getId() - anotherOSH.getId()

Parameters:
other - The String to be compared to this one.
Returns:
the value 0 if the argument's ID is equal to this ID; a value less than 0 if this ID less than the argument's ID; and a value greater than 0 if this ID is greater than the argument's ID.
Throws:
java.lang.NullPointerException - if anotherOSH is null.

toXmlString

public java.lang.String toXmlString()
Returns object state holder representation in XML string format

Returns:
The XML string representation of this ObjectStateHolder

toXmlString

public java.lang.String toXmlString(boolean withEncoding)
Returns object state holder representation in XML string format

Parameters:
withEncoding - should the XML string representation be prepended with the encoding info?
Returns:
XML string representation of this OSH

toXmlString

public java.lang.StringBuffer toXmlString(java.lang.StringBuffer xml,
                                          boolean withEncoding)

findAttr

public AttributeStateHolder findAttr(java.lang.String attrName)

isReference

public boolean isReference()

undoReference

public void undoReference()

getAnchorID

public java.lang.String getAnchorID()

setAnchorID

public void setAnchorID(java.lang.String anchorID)

isAnchor

public boolean isAnchor()

setAnchor

public void setAnchor(boolean anchor)


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.