|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the interface to an AgentTracer
implementation,
which provides a watch list for agents.
All agents in this list are tracked in certain intervalls and their
current contact address is stored.
Field Summary | |
static String |
WHATIS
The WhatIs entry key for this service. |
Method Summary | |
void |
addAgentToWatchList(AgentCard agentCard)
Adds an agent to the agent tracer's watch list. |
void |
addAgentToWatchList(byte[] implicitName)
Adds an agent to the agent tracer's watch list. |
TrustedListener |
addListener(Listener listener)
Adds a Listener . |
long |
getUpdateTime()
Returns the update interval of the agent tracer. |
SortedMap |
list()
Returns a copy of the internally used map which holds the (implicit name, contact address) correlations of the last update. |
void |
refresh()
Initiates a contact address update for all agents in the agent tracer's watch list. |
void |
removeAgentFromWatchList(AgentCard card)
Removes an agent from the agent tracer's watch list. |
void |
removeAgentFromWatchList(byte[] implicitName)
Removes an agent from the agent tracer's watch list. |
void |
setUpdateTime(long updateTime)
Sets the update interval of the agent tracer. |
Field Detail |
public static final String WHATIS
WhatIs
entry key for this service.
Method Detail |
public void addAgentToWatchList(AgentCard agentCard)
agentCard
will be registered within the agent tracer and lookups
will be initiated in certain update intervals to resolve
its current contact address.
If the contact address of an agent in the watch list
could not be resolved for a certain number of update cycles,
it is automatically removed from the list, again.
Theadded to the watch list if not already
agentCard
- The agent card of the agent.public void addAgentToWatchList(byte[] implicitName)
implicitName
will be registered within the agent tracer and lookups
will be initiated in certain update intervals to resolve
its current contact address.
If the contact address of an agent in the watch list
could not be resolved for a certain number of update cycles,
it is automatically removed from the list, again.
Theadded to the watch list if not already
public void removeAgentFromWatchList(AgentCard card)
agentCard
can be found in the watch list, it is removed immediately.
public void removeAgentFromWatchList(byte[] implicitName)
implicitName
can be found in the watch list, it is removed immediately.
implicitName
- The implicit name of the agent.public void refresh()
public SortedMap list()
Map.Entry
consist
of the implicit name of the agent (byte[]
)
as key and the contact address (URL
) as
corresponding value.
If the contact address of an agent could not be resolved
the n
th time, a URL of following format
is returned:
error://unknown/n
public TrustedListener addListener(Listener listener)
Listener
.
The Listener
will receive events of the type
String
every time an update has been initiated
by the agent tracer's update daemon respectively by a call
of refresh
.
Listener
instances passed to this method shall be
wrapped in a TrustedListener
which is then
returned.
listener
- The Listener
to be registered.
TrustedListener
that wraps around
the given Listener
.
NullPointerException
- if listener
is null
.public void setUpdateTime(long updateTime)
updateTime
of 0 deactivates the update
mechanism.
public long getUpdateTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |