|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.isam.exehda.HierarchicalId | +--org.isam.exehda.HostId
Uniquely identifies a host in the scope of the distributed system. In order to guarantee unicity, a hierarchical approach is used to generate the identifiers. The id itself is built up of two parts:
CellId
,
Serialized FormMethod Summary | |
boolean |
equals(java.lang.Object obj)
Returns whether this object is equals to the given object. |
static HostId |
getByName(java.lang.String hostName)
Look ups a host with the given hostName in the local cell and, if
such host exists, returns it's system-wide HostId.
|
static HostId |
getByName(java.lang.String hostName,
java.lang.String cellName)
Look ups a host with the given hostName in the given cell and, if
such host exists, returns it's system-wide HostId.
|
CellId |
getCell()
Returns the ID of the cell to which the host refered by this HostId belongs. |
java.lang.String |
getCellName()
Returns the name of the cell to which the host refered by this HostId belongs. |
int |
getId()
Returns the cell-wide id of this host. |
java.net.InetAddress |
getInetAddress()
Returns the Internet address of this host. |
static HostId |
getLocalHost()
Returns the system-wide HostId that describes the local host. |
protected java.lang.Object |
getLocalId()
Subclasses must overwrite this method and return an Object representation of the local id. |
java.lang.String |
getName()
Returns the symbolic name of the host described by this HostId, if such name exists. |
protected java.lang.String |
getType()
Subclasses must overwrite this method and return a String
representation of the ID's type. |
int |
hashCode()
Returns a hash code suitable for the java.util.Hashtable semantics. |
Methods inherited from class org.isam.exehda.HierarchicalId |
getParentId, isRoot, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public static HostId getByName(java.lang.String hostName, java.lang.String cellName) throws java.net.UnknownHostException
hostName
in the given cell and, if
such host exists, returns it's system-wide HostId.
Note:The current scheme assumes the local id is generated from the
host's IP address and only works if the host name is resolvable throught an DNS
query. Such scheme will be improved in future to consider data stored in the
Cell Information Base as long as other local id association policies.
hostName
- a public name of the host (e.g. its internet name)cellName
- the name of the cell in which the search is to be
done. null
would be used to refer to the local cell. This
parameter is currently not considered in lookup process.
java.net.UnknownHostException
- if the given hostName do not exists in the
given cell.public static HostId getByName(java.lang.String hostName) throws java.net.UnknownHostException
hostName
in the local cell and, if
such host exists, returns it's system-wide HostId.
Note:The current scheme assumes the local id is generated from the
host's IP address and only works if the host name is resolvable trough an DNS
query. Such scheme will be improved in future to consider data stored in the
Cell Information Base as long as other local id association policies.
hostName
- a public name of the host (e.g. its internet name)
java.net.UnknownHostException
- if the given hostName do not exists in the
given cell.public static HostId getLocalHost()
HostId
valuepublic java.lang.String getName()
null otherwise.
public int getId()
public CellId getCell()
public java.lang.String getCellName()
getCell().getName()
.
public java.net.InetAddress getInetAddress()
InetAddress
value, or null if a real IP is not
available for this host.public boolean equals(java.lang.Object obj)
equals
in class HierarchicalId
obj
- an Object
value
public int hashCode()
java.util.Hashtable
semantics.
hashCode
in class HierarchicalId
protected final java.lang.String getType()
HierarchicalId
String
representation of the ID's type.
getType
in class HierarchicalId
String
valueprotected final java.lang.Object getLocalId()
HierarchicalId
getLocalId()
is invoked.
getLocalId
in class HierarchicalId
Object
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |