|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDiscoveryEntity
Represents an entity in a discovery cache.
A discovery cache contains entities discovered via the entity discovery protocol. This interface represents an entity in the cache.
Entities are immutable objects i.e. they cannot be modified once created in the cache (either explicitly or discovered). If the contents of an entity need to be changed, then the entity needs to be removed from the cache, modified and then re-added to the cache.
Method Summary | |
---|---|
List<UtlAddressDescriptor> |
getAddressDescriptors()
Get an entity's address descriptors. |
short |
getAge()
Get an entity's current age. |
IDiscoveryCache |
getCache()
Get an entity's container cache. |
String |
getHost()
Get the host machine on which an entity resides. |
XString |
getHostAsRaw()
Get the host machine on which an entity resides in its raw (buffer backed) format. |
UUID |
getInstance()
Get an entity's instance id. |
com.neeve.raw.RawUUID |
getInstanceAsRaw()
Get an entity's instance id in its raw (buffer backed) format. |
short |
getMaxAge()
Get an entity's maximum age. |
String |
getName()
Get an entity's name. |
XString |
getNameAsRaw()
Get an entity's name in its raw (buffer backed) format. |
String |
getOwner()
Get an entity's owner. |
XString |
getOwnerAsRaw()
Get an entity's owner in its raw (buffer backed) format. |
String |
getType()
Get an entity's type. |
XString |
getTypeAsRaw()
Get an entity's type in its raw (buffer backed format). |
boolean |
wasDiscovered()
Get whether a cache entity was discovered or locally added. |
Method Detail |
---|
IDiscoveryCache getCache()
String getOwner()
Each cache entity is owned by the cache member that added the entity to the cache. This method returns the owner of a cache entity.
XString getOwnerAsRaw()
Each cache entity is owned by the cache member that added the entity to the cache. This method returns the owner of a cache entity.
String getType()
Each entity in the system is categorized by a type. Entity type's are hierarchical in nature allowing for entitis to be organized using a taxonomy that is hierarchical in nature. This method returns an entity's type.
XString getTypeAsRaw()
Each entity in the system is categorized by a type. Entity type's are hierarchical in nature allowing for entitis to be organized using a taxonomy that is hierarchical in nature. This method returns an entity's type.
String getName()
Each entity in the system is uniquely identified within its type. The name is hierarchical in nature allowing for the entities to be organized using a naming taxonomy that is hierachical in nature. This method returns an entity's name.
XString getNameAsRaw()
Each entity in the system is uniquely identified within its type. The name is hierarchical in nature allowing for the entities to be organized using a naming taxonomy that is hierachical in nature. This method returns an entity's name.
String getHost()
This method returns the host on which an entity resides. The discovery
cache runtime uses InetAddress.getLocalHost().getHostName
to determine an entity's host.
XString getHostAsRaw()
This method returns the host on which an entity resides. The discovery
cache runtime uses InetAddress.getLocalHost().getHostName
to determine an entity's host.
UUID getInstance()
Each cache entity is uniquely identified by its instance (a UUID assigned
to the entity at time of creation). The purpose of the instance is to
distinguish between two entities with the same type and name. When the
user invokes IDiscoveryCache.add(com.neeve.discovery.IDiscoveryEntity)
with the type and name of an
existing entity, the existing entity is removed and a new entity object
with a different instance is placed in the cache. This enables an entity
to be migrated across cache members.
com.neeve.raw.RawUUID getInstanceAsRaw()
Each cache entity is uniquely identified by its instance (a UUID assigned
to the entity at time of creation). The purpose of the instance is to
distinguish between two entities with the same type and name. When the
user invokes IDiscoveryCache.add(com.neeve.discovery.IDiscoveryEntity)
with the type and name of an
existing entity, the existing entity is removed and a new entity object
with a different instance is placed in the cache. This enables an entity
to be migrated across cache members.
short getMaxAge()
Each entity instance is associated with a maximum age and, at any point in time, a current age. A cache member 'expires' (removes from its local cache) a discovered entity when its current age reaches its maximum age. To prevent entity expiry, member owners periodically broadcast ESA (Entity State Advertisement) packets. The receipt of a ESA by non-owner causes the entity's age to be reset.
An entity's maximum age is also used (in conjunction with other configurable parameters) by owner members to determine when to send ESAs.
This method returns an entity's maximum age
short getAge()
See getMaxAge()
for information on the role played by an entity's age
in its lifecyle management.
This method returns an entity's current age.
boolean wasDiscovered()
This method will return true if and only if the entity's owner is the same as the name of the local cache member.
List<UtlAddressDescriptor> getAddressDescriptors()
This method returns an entity's address descriptors. The address descriptors describe how the entity can be contacted. The descriptors are returned in a list in order of priority in which the entity would like to be contacted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |