osl.nameservice.subnet
Class NSName

java.lang.Object
  |
  +--osl.nameservice.subnet.NSName

public class NSName
extends java.lang.Object
implements Name

This class defines the name service name, which is used by the name service for identification of the entities. The name service name is composed by three parts:

  • The physical address of the creating node,
  • A timstamp, uniquely identifying the time of creation with milisecond precition.
  • An identifyer, assigned by the name service. This is required as it obviously is possoble to create two instances of NSName within the same milisecond (Thanks SUN for making fast machines, and thanks IBM for making my laptop so slow, that I did not discover this before).

    Version:
    0.2 (980331)
    See Also:
    Serialized Form

    Constructor Summary
    NSName(PhysicalAddress creator, long counter)
              Default constructor.
     
    Method Summary
     boolean equals(java.lang.Object o)
              Compares two instances and returns true if they should be considered "equal".
     int hashCode()
              The canonical hashCode()
     void readExternal(java.io.ObjectInput in)
              Deserialize into a new instnace of NSName by reading from the given input stream.
     java.lang.String toString()
              The canoncial toString method.
     void writeExternal(java.io.ObjectOutput out)
              Serialize the contents of this class to the output stream.
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    NSName

    public NSName(PhysicalAddress creator,
                  long counter)
    Default constructor.
    Parameters:
    PhysicalAddress - creator
    PhysicalAddress - counter
    Method Detail

    equals

    public boolean equals(java.lang.Object o)
    Compares two instances and returns true if they should be considered "equal".
    Parameters:
    NSName - name
    Overrides:
    equals in class java.lang.Object

    toString

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

    hashCode

    public int hashCode()
    The canonical hashCode()
    Overrides:
    hashCode in class java.lang.Object

    writeExternal

    public void writeExternal(java.io.ObjectOutput out)
                       throws java.io.IOException
    Serialize the contents of this class to the output stream.
    Parameters:
    out - The OutputStream to which we should write this instance.

    readExternal

    public void readExternal(java.io.ObjectInput in)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
    Deserialize into a new instnace of NSName by reading from the given input stream.

    Parameters:
    in - The InputStream from which we should deserialize this instance.
    Throws:
    java.io.IOException - Thrown if an I/O error is encountered while reading the input stream.
    java.lang.ClassNotFoundException - Thrown if a class being deserialized from the input stream cannot be found by the class loader.
    java.lang.ClassCastException - Thrown if a class deserialized from the input stream had an unexpected type.