dk.i1.diameter.node
Class Peer

Object
  extended by dk.i1.diameter.node.Peer

public class Peer
extends Object

A Diameter peer. Hmmmm. more documentation here...

Note: According to DIME WG (Diameter Maintanence and Extentions Working Group) the use of raw ip-address as host identities is non-compliant, so it is strongly encouraged to use fully-qualified domain names


Nested Class Summary
static class Peer.TransportProtocol
           
 
Field Summary
 Capability capabilities
          Capabilities of this peer
 
Constructor Summary
Peer(java.net.InetAddress address)
          Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)
Peer(java.net.InetAddress address, int port)
          Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)
Peer(java.net.InetAddress address, int port, Peer.TransportProtocol transport_protocol)
          Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)
Peer(java.net.InetAddress address, Peer.TransportProtocol transport_protocol)
          Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)
Peer(java.net.InetSocketAddress address)
          Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)
Peer(Peer p)
          Copy constructor (deep copy)
Peer(String host)
          Constructs a peer from a host name.
Peer(String host, int port)
          Constructs a peer from a host name and port.
Peer(String host, int port, Peer.TransportProtocol transport_protocol)
          Constructs a peer from a host name, port and transport-protocol.
Peer(java.net.URI uri)
          Constructs a peer from a URI.
 
Method Summary
 boolean equals(Object o)
           
static Peer fromURIString(String s)
          Creates a peer from a Diameter URI string.
 int hashCode()
           
 String host()
           
 void host(String host)
           
 int port()
           
 void port(int port)
           
 boolean secure()
           
 void secure(boolean secure)
           
 String toString()
           
 Peer.TransportProtocol transportProtocol()
           
 void transportProtocol(Peer.TransportProtocol transport_protocol)
           
 java.net.URI uri()
          Returns the Diameter URI of the peer
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

capabilities

public Capability capabilities
Capabilities of this peer

Constructor Detail

Peer

public Peer(java.net.InetAddress address)
Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)

Constructs a peer from an IP address. The address is set to the specified address, the port is set to 3868, and the secure setting is off.

Parameters:
address - The IP address of the peer.

Peer

public Peer(java.net.InetAddress address,
            Peer.TransportProtocol transport_protocol)
Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)

Constructs a peer from an IP address and transport-protocol. The address is set to the specified address, the port is set to 3868, and the secure setting is off.

Parameters:
address - The IP address of the peer.
transport_protocol - TCP or SCTP
Since:
0.9.5

Peer

public Peer(java.net.InetAddress address,
            int port)
Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)

Constructs a peer from an IP address. The address is set to the specified address, the port is set to the specified port, and the secure setting is off.

Parameters:
address - The IP address of the peer.
port - The port of the peer.

Peer

public Peer(java.net.InetAddress address,
            int port,
            Peer.TransportProtocol transport_protocol)
Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)

Constructs a peer from IP address + port + transport-protocol. The address is set to the specified address, the port is set to the specified port, and the secure setting is off.

Parameters:
address - The IP address of the peer.
port - The port of the peer.
transport_protocol - TCP or SCTP
Since:
0.9.5

Peer

public Peer(String host)
     throws EmptyHostNameException
Constructs a peer from a host name. The address is set to the specified host-name. The IP-address of the host is not immediately resolved. The port is set to 3868, and the secure setting is off.

Parameters:
host - The host-name of the peer (preferably fully-qualified)
Throws:
EmptyHostNameException

Peer

public Peer(String host,
            int port)
     throws EmptyHostNameException
Constructs a peer from a host name and port. The address is set to the specified host-name. The IP-address of the host is not immediately resolved. The port is set to the specified port, and the secure setting is off.

Parameters:
host - The host-name of the peer (preferably fully-qualified)
port - The port of the peer.
Throws:
EmptyHostNameException

Peer

public Peer(String host,
            int port,
            Peer.TransportProtocol transport_protocol)
     throws EmptyHostNameException
Constructs a peer from a host name, port and transport-protocol. The address is set to the specified host-name. The IP-address of the host is not immediately resolved. The port is set to the specified port, and the secure setting is off.

Parameters:
host - The host-name of the peer (preferably fully-qualified)
port - The port of the peer.
transport_protocol - TCP or SCTP
Throws:
EmptyHostNameException
Since:
0.9.5

Peer

public Peer(java.net.InetSocketAddress address)
Deprecated. Use hostname instead of raw IP-address (preferably a FQDN)

Constructs a peer from a socket address. The address and port is set to the specifed socket address. The secure setting is off.

Parameters:
address - The socket address of the peer.

Peer

public Peer(java.net.URI uri)
     throws UnsupportedURIException
Constructs a peer from a URI. Only URIs as specified in RFC3855 section 4.3 are supported. Please note that the [transport] and [protocol] part are not supported and ignored because the URI class has problems with parsing them.

Parameters:
uri - The Diameter URI
Throws:
UnsupportedURIException

Peer

public Peer(Peer p)
Copy constructor (deep copy)

Method Detail

uri

public java.net.URI uri()
Returns the Diameter URI of the peer

Returns:
the Diameter URI of the peer, eg. "aaa://somehost.example.net"

fromURIString

public static Peer fromURIString(String s)
                          throws UnsupportedURIException
Creates a peer from a Diameter URI string.

Parameters:
s - The Diameter URI string, eg. "aaa://somehost.example.net"
Throws:
UnsupportedURIException

host

public String host()

host

public void host(String host)

port

public int port()

port

public void port(int port)

secure

public boolean secure()

secure

public void secure(boolean secure)

transportProtocol

public Peer.TransportProtocol transportProtocol()
Since:
0.9.5

transportProtocol

public void transportProtocol(Peer.TransportProtocol transport_protocol)
Since:
0.9.5

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object