|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.lib.collab.PresenceTuple
Field Summary | |
protected java.util.HashMap |
_namespaces
|
protected java.util.HashMap |
_notes
notes |
protected java.lang.String |
basicStatus
PIDF basic status (OPEN or CLOSED) |
protected java.lang.String |
contact
communication address |
protected java.lang.String |
id
Tuple ID |
protected Presence |
presentity
|
protected java.lang.String |
presentityID
Presence ID |
protected float |
priority
custom markup |
protected java.lang.String |
status
extended presence status |
Constructor Summary | |
PresenceTuple()
constructor without specified priority or id should be used when the presence is defined in XMPP format |
|
PresenceTuple(java.lang.String id)
constructor without specified priority (no priority attribute is added in pidf:tuple) |
|
PresenceTuple(java.lang.String id,
java.lang.String contact,
java.lang.String status)
constructor without specified priority (no priority attribute is added in pidf:tuple) |
|
PresenceTuple(java.lang.String id,
java.lang.String contact,
java.lang.String status,
float priority)
constructor with specified priority |
Method Summary | |
protected void |
addCustomStatusElement(org.w3c.dom.Element element)
add a custom status element as a Node. |
protected void |
addCustomTupleElement(org.w3c.dom.Element element)
add a custom tuple element as a Node. |
void |
addNote(java.lang.String text)
add a note in the default language. |
void |
addNote(java.lang.String lang,
java.lang.String text)
set the note for a specified language |
void |
addSerializedCustomStatusElement(java.lang.String sElement,
java.lang.String namespaceURI,
boolean validateXML)
Add a serialized custom status element as a Node. |
void |
addSerializedCustomTupleElement(java.lang.String sElement,
java.lang.String namespaceURI,
boolean validateXML)
Add a serialized custom tuple element as a Node. |
protected void |
copyTo(java.lang.StringBuffer buf)
append tag to StringBuffer |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getBasicStatus()
|
java.lang.String |
getContact()
|
java.util.List |
getCustomStatusElements(java.lang.String namespace)
returns a list of Element objects belonging to a specific XML namespace. |
java.util.List |
getCustomTupleElements(java.lang.String namespace)
returns a list of Element objects belonging to a specific XML namespace. |
java.lang.String |
getId()
|
java.lang.String |
getLastUpdateTimeStamp()
Get the last-update timestamp in XML dateTime format |
java.lang.String |
getNote()
get the note for the default language. |
java.lang.String |
getNote(java.lang.String lang)
get the note corresponding to a specified language |
java.util.Map |
getNotes()
get all the notes in all the language. |
java.lang.String |
getPresenceURL()
|
float |
getPriority()
|
java.lang.String |
getSerializedCustomStatusElements()
return a concatenation of all custom status elements. |
java.lang.String |
getSerializedCustomStatusElements(java.lang.String namespace)
return a serialized XML fragment which is a concatenation of all tuple sub-elements belonging to the specified namespace. |
java.lang.String |
getSerializedCustomTupleElements()
return a concatenation of all custom tuple elements. |
java.lang.String |
getSerializedCustomTupleElements(java.lang.String namespace)
return a serialized XML fragment which is a concatenation of all tuple sub-elements belonging to the specified namespace. |
java.lang.String |
getStatus()
|
void |
setContact(java.lang.String contact)
set communication address |
void |
setContact(java.lang.String contact,
float priority)
set communication address |
void |
setLastUpdateTimeStamp(java.lang.String ts)
Set the last-update timestamp in XML dateTime format |
void |
setPriority(float priority)
|
void |
setStatus(java.lang.String status)
set ICP and PIDF presence status |
java.lang.String |
toString()
returns an serialized XML fragment for this tuple |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.HashMap _notes
protected java.lang.String id
protected java.lang.String presentityID
protected float priority
protected java.lang.String contact
protected java.lang.String status
protected java.lang.String basicStatus
protected Presence presentity
protected java.util.HashMap _namespaces
Constructor Detail |
public PresenceTuple(java.lang.String id)
id
- tuple id. A tuple id must be unique within a presentity.
This argument is used to generate the id attribute of the PIDF
tuple element.public PresenceTuple()
public PresenceTuple(java.lang.String id, java.lang.String contact, java.lang.String status) throws java.lang.IllegalArgumentException
id
- tuple id. A tuple id must be unique within a presentity.
This argument is used to generate the id attribute of the PIDF
tuple element.contact
- contact address associated with this tuple.
This argument is used as the text inside the PIDF contact element.status
- status string. Must be one of the status values
defined in org.netbeans.lib.collab.PresenceService. This value
is used to create the contents of the PIDF basic element and the
ICP xstatus element.
java.lang.IllegalArgumentException
- unknown status value
or invalid address formatPresenceService
public PresenceTuple(java.lang.String id, java.lang.String contact, java.lang.String status, float priority) throws java.lang.IllegalArgumentException
id
- tuple id. A tuple id must be unique within a presentity.
This argument is used to generate the id attribute of the PIDF
tuple element.contact
- contact address associated with this tuple.
This argument is used as the text inside the PIDF contact element.status
- status string. Must be one of the status values
defined in org.netbeans.lib.collab.PresenceService. This value
is used to create the contents of the PIDF basic element and the
ICP xstatus element.priority
- priority to use as value the PIDF priority attribute
(part of tuple element).
java.lang.IllegalArgumentException
- priority not within the 0-1 range,
or unknown status value
or invalid address formatMethod Detail |
public java.lang.String getNote(java.lang.String lang)
lang
- language tag
public java.lang.String getNote()
public java.util.Map getNotes()
public void addNote(java.lang.String lang, java.lang.String text)
lang
- language tagtext
- note contentpublic void addNote(java.lang.String text)
public java.lang.String getLastUpdateTimeStamp()
public void setLastUpdateTimeStamp(java.lang.String ts)
ts
- new timestamppublic java.lang.String getId()
public java.lang.String getPresenceURL()
public float getPriority()
public java.lang.String getContact()
public java.lang.String getStatus()
PresenceService
public java.lang.String getBasicStatus()
public void setPriority(float priority) throws java.lang.IllegalArgumentException
priority
- priority to use as value the PIDF priority attribute
(part of tuple element).
java.lang.IllegalArgumentException
- priority not within the 0-1 rangepublic void setContact(java.lang.String contact, float priority) throws java.lang.IllegalArgumentException
contact
- contact address associated with this tuple.
This argument is used as the text inside the PIDF contact element.priority
- priority to use as value the PIDF priority attribute
(part of tuple element).
java.lang.IllegalArgumentException
- invalid address formatpublic void setContact(java.lang.String contact) throws java.lang.IllegalArgumentException
contact
- contact address associated with this tuple.
This argument is used as the text inside the PIDF contact element.
java.lang.IllegalArgumentException
- invalid address formatpublic void setStatus(java.lang.String status) throws java.lang.IllegalArgumentException
status
- status string. Must be one of the status values
defined in org.netbeans.lib.collab.PresenceService. This value
is used to create the contents of the PIDF basic element and the
ICP xstatus element.
java.lang.IllegalArgumentException
- unknown status valuePresenceService
public java.lang.String toString()
protected void copyTo(java.lang.StringBuffer buf) throws java.lang.Exception
buf
- buffer to copy to
java.lang.Exception
public boolean equals(java.lang.Object o)
protected void addCustomTupleElement(org.w3c.dom.Element element) throws org.netbeans.lib.collab.util.XMLProcessingException
element
- custom tuple sub-element to add
org.netbeans.lib.collab.util.XMLProcessingException
public void addSerializedCustomTupleElement(java.lang.String sElement, java.lang.String namespaceURI, boolean validateXML) throws org.netbeans.lib.collab.util.XMLProcessingException
Elements added using this method may not be retrieved immediately as a Node using getCustomTupleElement. To do this the presence document needs to be built and then parsed.
sElement
- custom tuple sub-element to add in serialized
form.validateXML
- verify that sElement contains well-formed
XML.namespaceURI
- XML namespace URI corresponding to the
prefix used in the XML fragment. Note that only one custom
namespace may be used in the xml fragment.
org.netbeans.lib.collab.util.XMLProcessingException
- ill-formed XML or missing or
unrecognized namespace prefixpublic java.lang.String getSerializedCustomTupleElements() throws org.netbeans.lib.collab.util.XMLProcessingException
org.netbeans.lib.collab.util.XMLProcessingException
public java.util.List getCustomTupleElements(java.lang.String namespace)
namespace
- namespace URI or prefix.public java.lang.String getSerializedCustomTupleElements(java.lang.String namespace) throws org.netbeans.lib.collab.util.XMLProcessingException
org.netbeans.lib.collab.util.XMLProcessingException
protected void addCustomStatusElement(org.w3c.dom.Element element) throws org.netbeans.lib.collab.util.XMLProcessingException
element
- custom tuple sub-element to add
org.netbeans.lib.collab.util.XMLProcessingException
public void addSerializedCustomStatusElement(java.lang.String sElement, java.lang.String namespaceURI, boolean validateXML) throws org.netbeans.lib.collab.util.XMLProcessingException
Elements added using this method may not be retrieved immediately as a Node using getCustomStatusElement. To do this the presence document needs to be built and then parsed.
sElement
- custom status sub-element to add in serialized
form.validateXML
- verify that sElement contains well-formed
XML.namespaceURI
- XML namespace URI corresponding to the
prefix used in the XML fragment. Note that only one custom
namespace may be used in the xml fragment.
org.netbeans.lib.collab.util.XMLProcessingException
- ill-formed XML or missing or
unrecognized namespace prefixpublic java.lang.String getSerializedCustomStatusElements() throws org.netbeans.lib.collab.util.XMLProcessingException
org.netbeans.lib.collab.util.XMLProcessingException
public java.util.List getCustomStatusElements(java.lang.String namespace)
namespace
- namespace URI or prefix.public java.lang.String getSerializedCustomStatusElements(java.lang.String namespace) throws org.netbeans.lib.collab.util.XMLProcessingException
org.netbeans.lib.collab.util.XMLProcessingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |