org.objectweb.jonathan.protocols.ip.api

Class IpSessionIdentifier

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()
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.

Field Details

hostname

public String hostname
Hostname of this session identifier.


port

public int port
Port number of this session identifier.

Constructor Details

IpSessionIdentifier

public IpSessionIdentifier()
Constructs a new empty IpSessionIdentifier.


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;

Method Details

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.

Parameters:

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


getProtocolId

public final int getProtocolId()
Specified by:
getProtocolId in interface SessionIdentifier


hashCode

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

Returns:
a hash code value for this object.


next

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


toString

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

Returns:
a string representation of this session identifier.