fr.dyade.aaa.agent
Class AgentId
java.lang.Object
fr.dyade.aaa.agent.AgentId
- Serializable
public final class AgentId
extends java.lang.Object
implements Serializable
An
AgentId
allows for uniquely identifying and localizing
an agent throughout the distributed system. It defines variable members
describing the identifier and all needed function members to manipulate
the structure (creation, serialization, etc).
However before describing the structure of an AgentId we must take into
account a second requirement: an agent may be created onto a remote agent
server, and the creating entity needs to know the new identifier created
for that agent. As agents live in an asynchronous world it is not so easy
to get back the identifier from the remote server. We decided instead to
make the creating entity responsible for creating the identifier.
The two requirements are then:
- static localization of agents to allow the system to forward
notifications ;
- local generation of identifiers for remote agents.
The AgentId is then built of three parts:
- the identification of the agent server hosting the creating agent
(from field),
- the identification of the agent server hosting the created agent
(to field),
- a stamp, local to the agent server hosting the creating agent (stamp
field) ; see AgentIdStamp class.
The three fields form the unique global identifier of the agent, that is
two agents may share a common stamp, as long as their from or to fields
differ. The to field identifies the agent server hosting the agent, so it
is used by the channel to forward notifications to the agent.
AgentIdStamp
AgentId(short from, short to, int stamp) - Allocates a new
AgentId object.
|
AdminIdStamp
public static final int AdminIdStamp
Reserved stamp for admin AgentId
.
- 2
ControlTopicStamp
public static int ControlTopicStamp
Reserved stamp for JMS topic AgentId
in charge ofsending control events.
FactoryIdStamp
public static final int FactoryIdStamp
Reserved stamp for factory AgentId
.
- 1
FileTransfertStamp
public static int FileTransfertStamp
Reserved stamp for fileTransfert service AgentId
.
JndiServiceStamp
public static int JndiServiceStamp
Reserved stamp for JNDI service AgentId
.
JoramAdminPxStamp
public static int JoramAdminPxStamp
Reserved stamp for JORAM administration proxy AgentId
.
JoramAdminStamp
public static int JoramAdminStamp
Reserved stamp for JORAM administration topic AgentId
.
LocalJndiServiceStamp
public static int LocalJndiServiceStamp
Reserved stamp for local JNDI service AgentId
.
MaxIdStamp
public static int MaxIdStamp
Maximum reserved stamp.
MaxSystemIdStamp
public static final int MaxSystemIdStamp
Maximum reserved stamp for system services.
- 2
MaxWKSIdStamp
public static int MaxWKSIdStamp
Maximum reserved stamp for well known services.
MinWKSIdStamp
public static int MinWKSIdStamp
Minimum reserved stamp for well known services.
NameServiceStamp
public static int NameServiceStamp
Reserved stamp for name service AgentId
.
NullIdStamp
public static final int NullIdStamp
Reserved stamp for NullId.
- 0
SCAdminProxyStamp
public static int SCAdminProxyStamp
Reserved stamp for SCAdmin proxy AgentId
.
SchedulerServiceStamp
public static int SchedulerServiceStamp
Reserved stamp for scheduler service AgentId
.
nullId
public static final AgentId nullId
null AgentId
.
AgentId
public AgentId(short from,
short to,
int stamp)
Allocates a new AgentId
object.
from
- The identification of the agent server hosting the
creating agent.to
- The identification of the agent server hosting the agent.stamp
- The stamp of agent.
equals
public boolean equals(Object obj)
Indicates whether some other agent id. is "equal to" this one. This method
returns true
if and only if obj is an AgentId
and refer to the same agent (from, to and stamp fields are equals).
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.
factoryId
public static final AgentId factoryId(short sid)
Returns the AgentId
for a remote factory agent.
sid
- remote server id.
- the
AgentId
for a remote factory agent.
fromString
public static AgentId fromString(String str)
Parses the string argument as an AgentId
.
- The
AgentId
object represented by the argument.
getFrom
public final short getFrom()
getStamp
public final int getStamp()
getTo
public final short getTo()
hashCode
public int hashCode()
Returns a hashcode for this AgentId
object.
- a hash code value for this object, equal to the primitive
int
value represented by the stamp field.
isNullId
public final boolean isNullId()
true
if this id is equals to NullId;
false
otherwise.
localId
public static final AgentId localId(short sid)
toString
public final String toString()
Returns a string representation of this AgentId
object.
- A string representation of this object.
Copyright B) 2004 Scalagent - All rights reserved