Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.caps
Class CapsPacketExtension

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.extensions.caps.CapsPacketExtension
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension

public class CapsPacketExtension
extends Object
implements org.jivesoftware.smack.packet.PacketExtension

A PacketExtension implementation for Entity Capabilities packets. This work is based on Jonas Adahl's smack fork.

Author:
Emil Ivov

Field Summary
static String ELEMENT_NAME
          The name of the "content" element.
static String HASH_METHOD
          The hash method we use for generating the ver string.
static String NAMESPACE
          The name space that the Entity Capabilities elements belong to.
 
Constructor Summary
CapsPacketExtension()
          An empty constructor for the CapsPacketExtension.
CapsPacketExtension(String ext, String node, String hash, String ver)
          Creates a new CapsPacketExtension using the specified parameters.
 
Method Summary
 String getElementName()
          Returns the name of the caps element.
 String getExtensions()
          Returns the value of the ext parameter as a string set of name tokens specifying additional feature bundles.
 String getHash()
          Returns the value of the hash parameter indicating the hashing algorithm used to generate the verification string.
 String getNamespace()
          Returns the Entity Capabilities namespace.
 String getNode()
          Returns the node URI.
 String getVersion()
          Returns the version associated with this packet.
 void setExtensions(String extensions)
          Sets the value of the ext parameter as a string set of name tokens specifying additional feature bundles.
 void setHash(String hash)
          Sets the value of the hash parameter indicating the hashing algorithm used to generate the verification string.
 void setNode(String node)
          Specifies the value of the node URI.
 void setVersion(String version)
          Sets the value of the ver parameter.
 String toXML()
          Returns the XML representation of the caps packet extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HASH_METHOD

public static final String HASH_METHOD
The hash method we use for generating the ver string.

See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
The name space that the Entity Capabilities elements belong to.

See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the "content" element.

See Also:
Constant Field Values
Constructor Detail

CapsPacketExtension

public CapsPacketExtension()
An empty constructor for the CapsPacketExtension.


CapsPacketExtension

public CapsPacketExtension(String ext,
                           String node,
                           String hash,
                           String ver)
Creates a new CapsPacketExtension using the specified parameters.

Parameters:
ext - a set of name tokens specifying additional info, that is deprecated and that we keep for backward compatibility.
node - a URI that uniquely identifies a software application
ver - a version String.representing the identity of the supported features.
hash - The hashing algorithm used to generate the verification String.
Method Detail

getElementName

public String getElementName()
Returns the name of the caps element.

Specified by:
getElementName in interface org.jivesoftware.smack.packet.PacketExtension
Returns:
the name of the caps element..

getNamespace

public String getNamespace()
Returns the Entity Capabilities namespace.

Specified by:
getNamespace in interface org.jivesoftware.smack.packet.PacketExtension
Returns:
the Entity Capabilities namespace.

getNode

public String getNode()
Returns the node URI. The node URI uniquely identifies a software application, typically a URL at the web site of the project or company that produces the software.

Returns:
the value of the node URI

setNode

public void setNode(String node)
Specifies the value of the node URI. The node URI uniquely identifies a software application, typically a URL at the web site of the project or company that produces the software.

Parameters:
node - a URI uniquely identifying the application.

getVersion

public String getVersion()
Returns the version associated with this packet. A version is a string that is used to verify the identity and supported features of the entity

Returns:
the value of the ver parameter.

setVersion

public void setVersion(String version)
Sets the value of the ver parameter. A version is a string that is used to verify the identity and supported features of the entity.

Parameters:
version - the value of the ver parameter.

getHash

public String getHash()
Returns the value of the hash parameter indicating the hashing algorithm used to generate the verification string.

Returns:
the value of the hash parameter indicating the hashing algorithm used to generate the verification string.

setHash

public void setHash(String hash)
Sets the value of the hash parameter indicating the hashing algorithm used to generate the verification string.

Parameters:
hash - the hashing algorithm used to generate the verification string.

getExtensions

public String getExtensions()
Returns the value of the ext parameter as a string set of name tokens specifying additional feature bundles. This attribute is deprecated indicating the hashing algorithm used to generate the verification string.

Returns:
the value of the ext parameter or null if it hasn't been specified.

setExtensions

public void setExtensions(String extensions)
Sets the value of the ext parameter as a string set of name tokens specifying additional feature bundles. This attribute is deprecated indicating the hashing algorithm used to generate the verification string.

Parameters:
extensions - the value of the ext parameter.

toXML

public String toXML()
Returns the XML representation of the caps packet extension.

Specified by:
toXML in interface org.jivesoftware.smack.packet.PacketExtension
Returns:
this packet extension as an XML String.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.