ikrs.yuccasrv
Class DefaultConnectionUserID

java.lang.Object
  extended by ikrs.yuccasrv.DefaultConnectionUserID
Direct Known Subclasses:
TCPConnectionUserID, UDPConnectionUserID

public class DefaultConnectionUserID
extends java.lang.Object

The DefaultConnectionUserID implements the ConnectionUserID interface for the use of incoming connections. Essentials required to identify users are: - serverID - bind address - bind port - remote address (when the remote address changes the user is considered 'new' -> session timeout) NOTE: this class DOES NOT implement the ConnectionUserID interface to allow subclasses to define custom comparison methods.


Constructor Summary
DefaultConnectionUserID(java.util.UUID serverID, java.net.InetAddress localAddress, int localPort, java.net.InetAddress remoteAddress)
           
 
Method Summary
 int compareTo(DefaultConnectionUserID userID)
          This method compares this connection user ID with the given ID.
 boolean equals(DefaultConnectionUserID userID)
          This method compares this connection user ID with the given ID.
 boolean equals(java.lang.Object o)
          This method compares this connection user ID with the given object.
 java.lang.String toString()
           
 java.lang.StringBuffer toString(java.lang.StringBuffer b)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultConnectionUserID

public DefaultConnectionUserID(java.util.UUID serverID,
                               java.net.InetAddress localAddress,
                               int localPort,
                               java.net.InetAddress remoteAddress)
                        throws java.lang.NullPointerException
Throws:
java.lang.NullPointerException
Method Detail

equals

public boolean equals(java.lang.Object o)
This method compares this connection user ID with the given object.

Overrides:
equals in class java.lang.Object
Returns:
true if and only if this and the given object are equal.
See Also:
java.lang.Object.equals( Object )

equals

public boolean equals(DefaultConnectionUserID userID)
This method compares this connection user ID with the given ID.

Returns:
true if and only if this and the given ID are equal.
See Also:
java.lang.Object.equals( Object )

compareTo

public int compareTo(DefaultConnectionUserID userID)
This method compares this connection user ID with the given ID. If this ID is 'smaller' than the passed ID, the method returns a negative integer. If this ID is 'bigger' than the passed ID, the method returns a positive integer. If this ID equals the passed ID, the method returns 0.

Returns:
A value indicating the order of the two ID.
See Also:
equals( ConnectionUserID )

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.StringBuffer toString(java.lang.StringBuffer b)