com.waveset.object
Class LinkIdentifier

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.object.LinkIdentifier
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject
Direct Known Subclasses:
Link

public class LinkIdentifier
extends AbstractXmlObject

Used to uniquely identify an object (e.g. an account) on a single resource. This class stores a reference to the resource and an identifier for the object in the resource. This identifier is either a guid, an identity (e.g.accountId), or a temporary id if neither of these is available.


Field Summary
static java.lang.String ATT_GUID
           
static java.lang.String ATT_IDENTITY
           
static java.lang.String ATT_TEMPID
           
static java.lang.String code_id
           
static java.lang.String ELEMENT
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
LinkIdentifier()
           
LinkIdentifier(org.w3c.dom.Element e)
           
 
Method Summary
protected  void addXmlAttributes(java.lang.StringBuffer b)
           
protected  void addXmlElements(java.lang.StringBuffer b, int indent)
           
static LinkIdentifier fromResource(java.lang.String nameOrId)
           
 java.lang.String getElementName()
          Return the XmlObject name
 java.lang.String getGUID()
           
 java.lang.String getIdentity()
           
 PersistentObject getOwner()
           
 Resource getResource()
          Resolve the resource reference, and return the Resource object.
 Resource getResource(ObjectCache cache)
           
 ObjectRef getResourceRef()
           
 java.lang.String getTempId()
           
 void parseXml(org.w3c.dom.Element e)
           
protected  void parseXmlAttributes(org.w3c.dom.Element e)
           
protected  void parseXmlChild(java.lang.String tag, org.w3c.dom.Element child)
           
 void setGUID(java.lang.String s)
           
 void setIdentity(java.lang.String id)
           
 void setOwner(PersistentObject owner)
          Set the owning user object.
 void setResource(ObjectRef ref)
          Sets the resource reference.
 void setResource(Resource r)
          Sets the resource.
 void setTempId(java.lang.String tempId)
           
 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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_IDENTITY

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

ATT_GUID

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

ATT_TEMPID

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

LinkIdentifier

public LinkIdentifier()

LinkIdentifier

public LinkIdentifier(org.w3c.dom.Element e)
               throws WavesetException
Method Detail

fromResource

public static LinkIdentifier fromResource(java.lang.String nameOrId)

getElementName

public java.lang.String getElementName()
Return the XmlObject name

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

setOwner

public void setOwner(PersistentObject owner)
Set the owning user object.

Parameters:
owner - owner object

getOwner

public PersistentObject getOwner()
Returns:
the owning object.

getResourceRef

public ObjectRef getResourceRef()
Returns:
the resource reference

setResource

public void setResource(ObjectRef ref)
Sets the resource reference.

Parameters:
ref - resource reference

setResource

public void setResource(Resource r)
Sets the resource.

Parameters:
r - resource

getResource

public Resource getResource()
                     throws WavesetException
Resolve the resource reference, and return the Resource object. This may return null if the resource has been deleted after the object was provisioned.

Returns:
the Resource object
Throws:
WavesetException - if the ResourceInfo has no owner

getResource

public Resource getResource(ObjectCache cache)
                     throws WavesetException
Throws:
WavesetException

getIdentity

public java.lang.String getIdentity()

setIdentity

public void setIdentity(java.lang.String id)

getGUID

public java.lang.String getGUID()

setGUID

public void setGUID(java.lang.String s)

getTempId

public java.lang.String getTempId()

setTempId

public void setTempId(java.lang.String tempId)

addXmlAttributes

protected void addXmlAttributes(java.lang.StringBuffer b)

addXmlElements

protected void addXmlElements(java.lang.StringBuffer b,
                              int indent)

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

parseXmlAttributes

protected void parseXmlAttributes(org.w3c.dom.Element e)
                           throws WavesetException
Throws:
WavesetException

parseXmlChild

protected void parseXmlChild(java.lang.String tag,
                             org.w3c.dom.Element child)
                      throws WavesetException
Throws:
WavesetException

parseXml

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