org.kth.dks.dks_comm
Class DKSRef

java.lang.Object
  extended by org.kth.dks.dks_comm.DKSRef

public class DKSRef
extends java.lang.Object


Method Summary
 boolean equals(java.lang.Object b)
           
 DKSNetAddress getDKSNetAddress()
           
 java.lang.String getDKSURL()
          Returns the DKS URL representing this DKSRef with the following format: dks://[IP]:[PORT]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification).
 java.lang.String getDKSWebURL()
          Returns the DKS WEB server URL representing this DKSRef with the following format: dks://[IP]:[PORT+1]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification).
 long getGUID()
           
 long getID()
           
 java.lang.String getIP()
           
 long getNonce()
           
 DKSOverlayAddress getOverlayAddress()
           
 int getPort()
           
 long getR_GUID()
           
 int hashCode()
           
static DKSRef newDKSRef(java.lang.String dksURL)
          Constructs a DKSRef from a DKS URL string having the following format: dksref://[IP]:[PORT]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification).
static DKSRef newDKSRefByParts(DKSOverlayAddress oa, DKSNetAddress na)
          Creates a DKSRef with references to a DKSOverlayAddress and a DKSNetAddress.
 java.lang.String toString()
           
static DKSRef valueOf(java.lang.String dksREF)
          Constructs a DKSRef from a DKS URL string having the following format: dks://[IP]:[PORT]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID]/[NONCE])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification).
static DKSRef valueOfByParts(DKSOverlayAddress oa, DKSNetAddress na, long nonce)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

newDKSRef

public static DKSRef newDKSRef(java.lang.String dksURL)
                        throws java.net.MalformedURLException
Constructs a DKSRef from a DKS URL string having the following format: dksref://[IP]:[PORT]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification). The scheme of the url can be in any case, e.g. "dksref://" or "DKSref://".

Example DKS URL "dksref://localhost:8080/2/431/5156164356"

Parameters:
dksURL - String with the above described format
Throws:
java.net.MalformedURLException - if the string does not match the above description

valueOf

public static DKSRef valueOf(java.lang.String dksREF)
                      throws java.net.MalformedURLException
Constructs a DKSRef from a DKS URL string having the following format: dks://[IP]:[PORT]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID]/[NONCE])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification). NONCE random id generated once each time a node joins the network The scheme of the url can be in any case, e.g. "dksref://" or "DKSREF://".

Example DKS URL "dks://localhost:8080/2/431/5156164356/145135314"

Parameters:
dksURL - String with the above described format
Throws:
java.net.MalformedURLException - if the string does not match the above description

newDKSRefByParts

public static DKSRef newDKSRefByParts(DKSOverlayAddress oa,
                                      DKSNetAddress na)
Creates a DKSRef with references to a DKSOverlayAddress and a DKSNetAddress. Notice, it keeps references and does not make defensive/deep copies

Parameters:
oa - DKSOverlayAddress
na - DKSNetAddress

valueOfByParts

public static DKSRef valueOfByParts(DKSOverlayAddress oa,
                                    DKSNetAddress na,
                                    long nonce)

getDKSURL

public java.lang.String getDKSURL()
Returns the DKS URL representing this DKSRef with the following format: dks://[IP]:[PORT]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification). The scheme of the url can be in any case, e.g. "dksref://" or "DKSREF://".

Example DKS URL "dksref://localhost:8080/2/431/5156164356"

Returns:
String the DKS URL representing this object

getDKSWebURL

public java.lang.String getDKSWebURL()
Returns the DKS WEB server URL representing this DKSRef with the following format: dks://[IP]:[PORT+1]/[GROUP_ID]/[NODE_ID]/[UNIQUE_GUID])
IP can be either an IP number of a hostname, PORT must be an integer (<=65535) describing the port number of the DKS, GROUP_ID must be a number describing the unique DKS ring/group identifier, NODE_ID must be a number describing the node logical identifier, UNIQUE_GUID must be a number describing the node unique identifier (only for identification). The scheme of the url can be in any case, e.g. "http://" or "HTTP://".

Example DKS URL "http://localhost:8080/2/431/5156164356"

Returns:
String the DKS URL representing this object

getNonce

public long getNonce()

getPort

public int getPort()

getIP

public java.lang.String getIP()

getID

public long getID()

getGUID

public long getGUID()

getR_GUID

public long getR_GUID()

getOverlayAddress

public DKSOverlayAddress getOverlayAddress()

getDKSNetAddress

public DKSNetAddress getDKSNetAddress()

toString

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

equals

public boolean equals(java.lang.Object b)
Overrides:
equals in class java.lang.Object

hashCode

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


Copyright © 2010. All Rights Reserved.