Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Class JingleNodeDescriptor

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.JingleNodeDescriptor

public class JingleNodeDescriptor
extends Object

A JingleNodesDescriptor stores information necessary to create a JingleNodes tracker or relay candidate harvester that we could use with ICE4J. Descriptors are normally initialized by protocol wizards. They are then used to convert the data into a String form suitable for storage in an accounts properties Map.

Author:
Yana Stamcheva, Emil Ivov, Sebastien Vincent

Field Summary
static String JN_ADDRESS
          JingleNodes prefix to store server address in configuration.
static String JN_IS_RELAY_SUPPORTED
          JingleNodes prefix to store the relay capabilities in configuration.
static String JN_PREFIX
          JingleNodes prefix to store configuration.
static int MAX_JN_RELAY_COUNT
          The maximum number of stun servers that we would allow.
 
Constructor Summary
JingleNodeDescriptor(String address, boolean relaySupported)
          Creates an instance of JingleNodes by specifying all parameters.
 
Method Summary
 String getJID()
          Returns the address of the JingleNodes
 boolean isRelaySupported()
          Returns if the JID has relay support.
static JingleNodeDescriptor loadDescriptor(Map<String,String> props, String namePrefix)
          Loads this descriptor from the specified Map.The method is meant for use with account property maps.
 void setAddress(String address)
          Sets the address of the JingleNodes.
 void setRelay(boolean relaySupported)
          Sets the relay support corresponding to this JID.
 void storeDescriptor(Map<String,String> props, String namePrefix)
          Stores this descriptor into the specified Map.The method is meant for use with account property maps.
 String toString()
          Returns a String representation of this descriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JN_PREFIX

public static final String JN_PREFIX
JingleNodes prefix to store configuration.

See Also:
Constant Field Values

JN_ADDRESS

public static final String JN_ADDRESS
JingleNodes prefix to store server address in configuration.

See Also:
Constant Field Values

JN_IS_RELAY_SUPPORTED

public static final String JN_IS_RELAY_SUPPORTED
JingleNodes prefix to store the relay capabilities in configuration.

See Also:
Constant Field Values

MAX_JN_RELAY_COUNT

public static final int MAX_JN_RELAY_COUNT
The maximum number of stun servers that we would allow.

See Also:
Constant Field Values
Constructor Detail

JingleNodeDescriptor

public JingleNodeDescriptor(String address,
                            boolean relaySupported)
Creates an instance of JingleNodes by specifying all parameters.

Parameters:
address - address of the JingleNodes
relaySupported - if the JingleNodes supports relay
Method Detail

getJID

public String getJID()
Returns the address of the JingleNodes

Returns:
the address of the JingleNodes

setAddress

public void setAddress(String address)
Sets the address of the JingleNodes.

Parameters:
address - the JID of the JingleNodes

isRelaySupported

public boolean isRelaySupported()
Returns if the JID has relay support.

Returns:
true if relay is supported, false otherwise

setRelay

public void setRelay(boolean relaySupported)
Sets the relay support corresponding to this JID.

Parameters:
relaySupported - relay value to set

storeDescriptor

public void storeDescriptor(Map<String,String> props,
                            String namePrefix)
Stores this descriptor into the specified Map.The method is meant for use with account property maps. It also allows prepending an account prefix to all property names so that multiple descriptors can be stored in a single Map.

Parameters:
props - the account properties Map that we'd like to store this descriptor in.
namePrefix - the prefix that we should prepend to every property name.

loadDescriptor

public static JingleNodeDescriptor loadDescriptor(Map<String,String> props,
                                                  String namePrefix)
Loads this descriptor from the specified Map.The method is meant for use with account property maps. It also allows prepending an account prefix to all property names so that multiple descriptors can be read in a single Map.

Parameters:
props - the account properties Map that we'd like to load this descriptor from.
namePrefix - the prefix that we should prepend to every property name.
Returns:
the newly created descriptor or null if no descriptor was found.

toString

public String toString()
Returns a String representation of this descriptor

Overrides:
toString in class Object
Returns:
a String representation of this descriptor.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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