org.objectweb.jonathan.protocols.ip.api
Class IpSessionIdentifier

java.lang.Object
  extended byorg.objectweb.jonathan.protocols.ip.api.IpSessionIdentifier
All Implemented Interfaces:
ProtocolIdentifiers, SessionIdentifier

public abstract class IpSessionIdentifier
extends Object
implements SessionIdentifier, ProtocolIdentifiers

IpSessionIdentifier is a specific SessionIdentifier type for IP protocols. An IP session identifier contains a host name, and a port number.


Field Summary
 String hostname
          Hostname of this session identifier.
 int port
          Port number of this session identifier.
 
Fields inherited from interface org.objectweb.jonathan.protocols.api.ProtocolIdentifiers
GIOP, HTTP, MULTICASTIP, MULTIPLEX, RTP, TCPIP
 
Constructor Summary
IpSessionIdentifier()
          Constructs a new empty IpSessionIdentifier.
IpSessionIdentifier(String hostname, int port)
          Constructs a new IpSessionIdentifier with the specified host name and port number.
 
Method Summary
 boolean equals(Object o)
          Compares this object to the specified object.
 int getProtocolId()
          What kind of protocol does this session identifier relate to?
 int hashCode()
          Returns a hash code value for this IpSessionIdentifier.
 SessionIdentifier[] next()
          Return an empty array: this is a leaf protocol in the protocol tree.
 String toString()
          Returns a string representation of this session identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonathan.protocols.api.SessionIdentifier
bind, getInfo, getProtocol, isLocal, unexport
 

Field Detail

hostname

public String hostname
Hostname of this session identifier.


port

public int port
Port number of this session identifier.

Constructor Detail

IpSessionIdentifier

public IpSessionIdentifier(String hostname,
                           int port)
Constructs a new IpSessionIdentifier with the specified host name and port number.

Parameters:
hostname - a host name;
port - a port number;

IpSessionIdentifier

public IpSessionIdentifier()
Constructs a new empty IpSessionIdentifier.

Method Detail

hashCode

public int hashCode()
Returns a hash code value for this IpSessionIdentifier.

Returns:
a hash code value for this object.

equals

public boolean equals(Object o)
Compares this object to the specified object.

The result is true if and only if the argument is not null and is a IpSessionIdentifier object that has the same host name and port number.

Returns:
true if the objects are the same; false otherwise.

toString

public String toString()
Returns a string representation of this session identifier.

Returns:
a string representation of this session identifier.

next

public SessionIdentifier[] next()
Return an empty array: this is a leaf protocol in the protocol tree.

Specified by:
next in interface SessionIdentifier

getProtocolId

public final int getProtocolId()
Description copied from interface: SessionIdentifier
What kind of protocol does this session identifier relate to?

Specified by:
getProtocolId in interface SessionIdentifier