|
||||||||||
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.LSProxyServiceImpl
Provides the functionality of the Location Server Proxy
(LSProxy
) which can be seen as gateway between
Location Service Client (LSClient
) and Location
Service Server (LSServer
).
LSProxyService
,
LSProxy
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 |
protected boolean |
securityOptions_
This flag is set, when it's possible to use registerEncrypted and
registerEncoded , which
need special security algorithms. |
protected LSServerServiceImpl |
serverService_
The reference to the LSServerService interface. |
Fields inherited from class de.fhg.igd.semoa.service.AbstractService |
REV_POSTFIX, REV_PREFIX |
Constructor Summary | |
LSProxyServiceImpl(StorageDB storageDB,
boolean verifyContactAddress)
Creates an instance of this class with the given parameters. |
Method Summary | |
TrustedListener |
addListener(Listener listener)
Adds a Listener . |
String |
author()
Returns the String with the author's name. |
String[] |
dependencies()
Returns the dependencies of this service as described in Service . |
boolean |
getEventFlag()
Returns the current state of the event flag of the server's internal database. |
long |
getTimeout()
Returns the timeout of entries in the server database. |
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. |
LSPReply |
list(LSPList request)
Handles the given list request
(see LSPList ). |
LSPReply |
lookup(LSPLookup request)
Handles the given lookup request
(see LSPLookup ). |
LSPReply |
proxyInvalidate(LSPProxyInvalidate request)
Handles the given proxy invalidate request
(see LSPProxyInvalidate ). |
LSPReply |
refresh(LSPRefresh request)
Handles the given refresh request
(see LSPRefresh ). |
LSPReply |
registerPlain(LSPRegisterPlain request)
Handles the given register plain request
(see LSPRegister ). |
String |
revision()
Returns the revision number of this class as a string. |
boolean |
securityAvailable()
Returns the availability of encryption and encoding what needs special cryptographic algorithms. |
void |
setEventFlag(boolean flag)
Sets the event flag to enable respectively disable the generation of events within the proxy's internal database. |
void |
setTimeout(long timeout)
Sets the timeout of entries in the proxy database. |
String |
toString()
|
Methods inherited from class de.fhg.igd.semoa.service.AbstractService |
checkDependencies, docs, doPrivileged, doPrivileged, getACC, getEnvironment, majorVersion, minorVersion |
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
.
protected LSServerServiceImpl serverService_
LSServerService
interface.
protected LSClientServiceImpl clientService_
LSClientService
interface.
protected boolean securityOptions_
registerEncrypted
and
registerEncoded
, which
need special security algorithms.
Constructor Detail |
public LSProxyServiceImpl(StorageDB storageDB, boolean verifyContactAddress)
storageDB
is null
, the
MemoryDB
is used as default database for the server.
storageDB
- The storage database used to store
the location entries of mobile objects.verifyContactAddress
- If this flag is set, the contact
address given in a call of registerPlain
is verified (see LSServerServiceImpl
.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 String toString()
toString
in class AbstractService
public long getTimeout()
getTimeout
in interface LSAdminService
public void setTimeout(long timeout)
timeout
of 0 deactivates the timeout mechanism.
setTimeout
in interface LSAdminService
timeout
- The timeout in milli seconds.public boolean securityAvailable()
securityAvailable
in interface LSAdminService
true
if secure register requests can be
handled; false
otherwise.public TrustedListener addListener(Listener listener)
Listener
.
The Listener
will receive events of the type
StorageDBEvent
. Iff the event flag has been set,
those events are triggered by the internal database
of the proy to incrementally describe its state.
Listener
instances passed to this method shall be
wrapped in a TrustedListener
which is then
returned.
addListener
in interface LSAdminService
listener
- The Listener
to be registered.
TrustedListener
that wraps around
the given Listener
.
NullPointerException
- if listener
is null
.public void setEventFlag(boolean flag)
setEventFlag
in interface LSAdminService
flag
- The event flag to be set.public boolean getEventFlag()
getEventFlag
in interface LSAdminService
public LSPReply lookup(LSPLookup request)
request
(see LSPLookup
).
lookup in local database
|
+--globalLookup
LSServer
and this result is returned.
Following reply
states and bodies are possible
(see LSPReply
):
ACKNOWLEDGE
(LSPLookupResult
body)
IMPLICIT_NAME_NOT_FOUND
(no body)
WRONG_VERSION
(no body)
REQUEST_TYPE_INVALID
(no body)
REQUEST_BODY_INVALID
(no body)
INTERNAL_CLIENT_ERROR
(no body)
IO_ERROR
(no body)
The SERVER_ERROR_FLAG
of the reply is set,
if the reply state of the LSServer
has
been an IO_ERROR
.
lookup
in interface LSProxyService
request
- The register lookup.
public LSPReply registerPlain(LSPRegisterPlain request)
request
(see LSPRegister
).
+--registerPlain in local database | +--globalRegisterEncrypted/Encoded | +--globalRegisterPlain
ACKNOWLEDGE
, registration
is aborted and the reply is returned directly.
If the reply was succesful the request is forwarded to the
corresponding LSServer
by using encryption respectively
encoding of the request message if security options are available,
using plain messages otherwise.
Nevertheless the result of the request processed on the local database will be returned (the proxy's state is more important than the serer's one)
Following reply
states are possible
(see LSPReply
):
ACKNOWLEDGE
REQUEST_BODY_INVALID
CONTACT_ADDRESS_NOT_EXISTENT
COOKIE_INVALID
IMPLICIT_NAME_NOT_PRESENT
The SERVER_ERROR_FLAG
of the reply is set,
if the reply state of the LSServer
has
been an IO_ERROR
.
In the case that an update request could not be processed succesfully on proxy respectively server side, because the corresponding entry has not been found, it's tried to reinitialize the entry with an init request.
registerPlain
in interface LSProxyService
request
- The register plain request.
public LSPReply refresh(LSPRefresh request)
request
(see LSPRefresh
).
Following reply
states and bodies are possible
(see LSPReply
):
ACKNOWLEDGE
(no body)
SOME_IMPLICIT_NAMES_NOT_PRESENT
(LSPRefreshResult
body)
refresh
in interface LSProxyService
request
- The refresh request.
public LSPReply list(LSPList request)
request
(see LSPList
).
Following reply
states and bodies are possible
(see LSPReply
):
ACKNOWLEDGE
(LSPListResult
body)
list
in interface LSAdminService
request
- The list request.
public LSPReply proxyInvalidate(LSPProxyInvalidate request)
request
(see LSPProxyInvalidate
).
Following reply
states are possible
(see LSPReply
):
ACKNOWLEDGE
IMPLICIT_NAME_NOT_PRESENT
proxyInvalidate
in interface LSProxyService
request
- The proxy invalidate request.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |