SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.netaddr
Class StunDiscoveryReport

java.lang.Object
  extended by net.java.sip.communicator.impl.netaddr.StunDiscoveryReport

public class StunDiscoveryReport
extends Object

The class is used to deliver results from a STUN Discovery Process. It contains information about the NAT Server (or firewall )this client is behind, and a mapped address value (if discovered)

Organisation:

Louis Pasteur University, Strasbourg, France

Network Research Team (http://www-r2.u-strasbg.fr)

Version:
0.1
Author:
Emil Ivov

Field Summary
static String FULL_CONE_NAT
          NAT type is full cone.
static String OPEN_INTERNET
          Means, there's no NAT or firewall.
static String PORT_RESTRICTED_CONE_NAT
          NAT type is port restricted cone.
static String RESTRICTED_CONE_NAT
          NAT type is Restricted Cone.
static String SYMMETRIC_NAT
          We are behind a symmetric nat.
static String SYMMETRIC_UDP_FIREWALL
          Means we are behind a symmetric udp firewall.
static String UDP_BLOCKING_FIREWALL
          Indicates that UDP communication is not possible.
static String UNKNOWN
          Indicates that NAT detection has failed or not yet initiated.
 
Constructor Summary
StunDiscoveryReport()
          Creates a discovery report with natType = UNKNOWN and a null public address.
 
Method Summary
 boolean equals(Object obj)
          Compares this object with obj.
 String getNatType()
          Returns the type of the NAT described in the report.
 net.java.stun4j.StunAddress getPublicAddress()
          Returns the public addressed discovered by a discovery process.
(package private)  void setNatType(String natType)
          Sets the type of the NAT indicated by the report.
(package private)  void setPublicAddress(net.java.stun4j.StunAddress stunAddress)
          Sets a public address.
 String toString()
          Returns a readable representation of the report.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final String UNKNOWN
Indicates that NAT detection has failed or not yet initiated.

See Also:
Constant Field Values

OPEN_INTERNET

public static final String OPEN_INTERNET
Means, there's no NAT or firewall.

See Also:
Constant Field Values

UDP_BLOCKING_FIREWALL

public static final String UDP_BLOCKING_FIREWALL
Indicates that UDP communication is not possible.

See Also:
Constant Field Values

SYMMETRIC_UDP_FIREWALL

public static final String SYMMETRIC_UDP_FIREWALL
Means we are behind a symmetric udp firewall.

See Also:
Constant Field Values

FULL_CONE_NAT

public static final String FULL_CONE_NAT
NAT type is full cone.

See Also:
Constant Field Values

SYMMETRIC_NAT

public static final String SYMMETRIC_NAT
We are behind a symmetric nat.

See Also:
Constant Field Values

RESTRICTED_CONE_NAT

public static final String RESTRICTED_CONE_NAT
NAT type is Restricted Cone.

See Also:
Constant Field Values

PORT_RESTRICTED_CONE_NAT

public static final String PORT_RESTRICTED_CONE_NAT
NAT type is port restricted cone.

See Also:
Constant Field Values
Constructor Detail

StunDiscoveryReport

StunDiscoveryReport()
Creates a discovery report with natType = UNKNOWN and a null public address.

Method Detail

getNatType

public String getNatType()
Returns the type of the NAT described in the report.

Returns:
the type of the NAT that this report is about.

setNatType

void setNatType(String natType)
Sets the type of the NAT indicated by the report.

Parameters:
natType - the type of the NAT.

getPublicAddress

public net.java.stun4j.StunAddress getPublicAddress()
Returns the public addressed discovered by a discovery process.

Returns:
an Inetner address for public use.

setPublicAddress

void setPublicAddress(net.java.stun4j.StunAddress stunAddress)
Sets a public address.

Parameters:
stunAddress - An address that's accesible from everywhere.

equals

public boolean equals(Object obj)
Compares this object with obj. Two reports are considered equal if and only if both have the same nat type and their public addresses are equal or are both null.

Overrides:
equals in class Object
Parameters:
obj - the object to compare against.
Returns:
true if the two objects are equal and false otherwise.

toString

public String toString()
Returns a readable representation of the report.

Overrides:
toString in class Object
Returns:
a readable representation of the report.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

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