Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.caps
Class EntityCapsManager.Caps

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.extensions.caps.EntityCapsManager.Caps
Enclosing class:
EntityCapsManager

public static class EntityCapsManager.Caps
extends Object

Implements an immutable value which stands for a specific node, a specific hash (algorithm) and a specific ver.

Author:
Lubomir Marinov

Field Summary
 String ext
          The ext info of this Caps value.
 String hash
          The hash (algorithm) of this Caps value.
 String node
          The node of this Caps value.
 String ver
          The ver of this Caps value.
 
Constructor Summary
EntityCapsManager.Caps(String node, String hash, String ver, String ext)
          Initializes a new Caps instance which is to represent a specific node, a specific hash (algorithm) and a specific ver.
 
Method Summary
 String getNodeVer()
          Gets a String which represents the concatenation of the node property of this instance, the character '#' and the ver property of this instance.
 boolean isValid(org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo)
          Determines whether a specific DiscoverInfo is valid according to this Caps i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hash

public final String hash
The hash (algorithm) of this Caps value.


node

public final String node
The node of this Caps value.


ext

public String ext
The ext info of this Caps value.


ver

public final String ver
The ver of this Caps value.

Constructor Detail

EntityCapsManager.Caps

public EntityCapsManager.Caps(String node,
                              String hash,
                              String ver,
                              String ext)
Initializes a new Caps instance which is to represent a specific node, a specific hash (algorithm) and a specific ver.

Parameters:
node - the node to be represented by the new instance
hash - the hash (algorithm) to be represented by the new instance
ver - the ver to be represented by the new instance
ext - the ext to be represented by the new instance
Method Detail

getNodeVer

public final String getNodeVer()
Gets a String which represents the concatenation of the node property of this instance, the character '#' and the ver property of this instance.

Returns:
a String which represents the concatenation of the node property of this instance, the character '#' and the ver property of this instance

isValid

public boolean isValid(org.jivesoftware.smackx.packet.DiscoverInfo discoverInfo)
Determines whether a specific DiscoverInfo is valid according to this Caps i.e. whether the discoverInfo has the node and the ver of this Caps and the ver calculated from the discoverInfo using the hash (algorithm) of this Caps is equal to the ver of this Caps.

Parameters:
discoverInfo - the DiscoverInfo to be validated by this Caps
Returns:
true if the specified DiscoverInfo has the node and the ver of this Caps and the ver calculated from the discoverInfo using the hash (algorithm) of this Caps is equal to the ver of this Caps; otherwise, false

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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