|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.semoa.service.AbstractService de.fhg.igd.atlas.core.LSClient
Provides an interface between the SeMoA server and the location service.
All important agent events are caught by this Location Service Client
(LSClient
) to initialize, update or delete the location
entries of an existing Location Service Proxy (LSProxy
)
respectively the corresponding Location Service Server
(LSServer
). A refresh daemon is installed to refresh these
entries periodically after certain time intervals while they are running
on the local SeMoA server. Moreover the LSClientService
is
installed, which is used by this component and can be used by local agents
to lookup the current location of other agents.
LSClientService
Nested Class Summary |
Nested classes inherited from class de.fhg.igd.semoa.server.AgentFilter |
AgentFilter.In, AgentFilter.Out |
Field Summary | |
protected LSClientServiceImpl |
clientService_
The reference to the LSClientService interface. |
private static String[] |
DEPEND_
The dependencies to other objects in the global
Environment . |
private static Logger |
log_
The Logger instance for this class |
static String |
OPT_DESCR
The ArgsParser option descriptor for the case
that this class is initiated from command line. |
protected long |
proxyRefreshTime_
The time interval in milli seconds after that a proxy refresh of all local agent entries is initiated. |
protected Thread |
refreshThread_
Thread that provides a periodic refresh of all local agent entries. |
protected long |
serverRefreshTime_
The time interval in milli seconds after that a global refresh of all local agent entries is initiated. |
Fields inherited from class de.fhg.igd.semoa.service.AbstractService |
REV_POSTFIX, REV_PREFIX |
Constructor Summary | |
protected |
LSClient()
Creates an instance of this class and initializes the LSClientService
with the given parameters. |
Method Summary | |
String |
author()
Returns the String with the author's name. |
protected boolean |
checkLANLocality(Ticket ticket)
Checks the LAN locality of the destination URLs of the given ticket . |
String[] |
dependencies()
Returns the dependencies of this service as described in Service . |
ErrorCode |
filter(AgentContext agentContext)
Called from the information filter, which has to be installed within the incoming agent filter pipeline, whenever a new incomming agent has been detected. |
protected void |
globalRefreshAllAgents()
Refreshes the location entries on the LSServer
of all agents, which can be found on the local system through
localLookupAll . |
String |
info()
Returns the String with the service's short description. |
protected boolean |
initLSInfrastructure(String configFile)
Initialize the location service infrastructure of distributed LS-Servers by parsing the given configuration file. |
protected boolean |
initLSInfrastructure(URL configLdapServer)
Initialize the location service infrastructure of distributed LS-Servers by requesting the configuration from a LDAP server with the given URL. |
static void |
main(String[] argv)
Initializes the LSClient from command line. |
void |
notifiedOf(Object obj)
This method is called with the event that caused the notification. |
protected void |
proxyInvalidate(AgentContext ctx)
Invalidates the proxy location entry for the agent with the given agent context. |
protected void |
proxyRefreshAllAgents()
Refreshes the location entries on the LSProxy
of all agents which can be found on the local system through
localLokupAll . |
protected void |
register(AgentContext ctx,
boolean init)
Registers this system as new location for the agent with the given agent context. |
protected void |
registerDelete(AgentContext ctx)
Deletes the location entry for the agent with the given agent context. |
String |
revision()
Returns the revision number of this class as a string. |
void |
run()
This method represents the functionality of the refresh daemon. |
Methods inherited from class de.fhg.igd.semoa.service.AbstractService |
checkDependencies, docs, doPrivileged, doPrivileged, getACC, getEnvironment, majorVersion, minorVersion, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static Logger log_
Logger
instance for this class
private static final String[] DEPEND_
Environment
.
public static final String OPT_DESCR
ArgsParser
option descriptor for the case
that this class is initiated from command line.
protected LSClientServiceImpl clientService_
LSClientService
interface.
protected long proxyRefreshTime_
protected long serverRefreshTime_
protected Thread refreshThread_
Constructor Detail |
protected LSClient()
LSClientService
with the given parameters.
Moreover the refresh daemon is started.
Method Detail |
protected boolean initLSInfrastructure(String configFile)
configFile
is null
,
no server will be initialized.
configFile
- The name the configuration file
containing the configuration of the location service infrastructure.
protected boolean initLSInfrastructure(URL configLdapServer)
configLdapServer
is null
,
no server will be initialized.
configLdapServer
- The URL of the ldap server
maintaining the configuration of the location service infrastructure.
public String info()
info
in interface Service
info
in class AbstractService
public String author()
author
in interface Service
author
in class AbstractService
public String revision()
revision
in class AbstractService
public String[] dependencies()
Service
.
dependencies
in interface Service
dependencies
in class AbstractService
public void run()
run
in interface Runnable
public void notifiedOf(Object obj)
Listener
notifiedOf
in interface Listener
obj
- The object describing the event.public ErrorCode filter(AgentContext agentContext)
filter
in interface AgentFilter
agentContext
- The agent context of the agent that is to be
filtered.
OK
.protected boolean checkLANLocality(Ticket ticket) throws UnknownHostException
ticket
.
ticket
- The ticket.
true
if every destination URL
of the ticket
lies in the current subnet;
false
otherwise.
UnknownHostException
- if the IP address of
one of the ticket's URLs or the local Host could
not be resolved.protected void proxyRefreshAllAgents()
LSProxy
of all agents which can be found on the local system through
localLokupAll
.
protected void globalRefreshAllAgents()
LSServer
of all agents, which can be found on the local system through
localLookupAll
.
protected void register(AgentContext ctx, boolean init)
ctx
- The agent context.init
- true
if a new entry should be initialized;
true
for an update request.protected void registerDelete(AgentContext ctx)
ctx
- The agent context.protected void proxyInvalidate(AgentContext ctx)
ctx
- The agent context.public static void main(String[] argv) throws ArgsParserException, ObjectExistsException
LSClient
from command line.
argv
- The command line parameters.
ArgsParserException
ObjectExistsException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |