|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fhg.igd.semoa.service.AbstractService
de.fhg.igd.atlas.core.LSServerServiceImpl
Provides the functionality of the Location Server Server
(LSServer
) which can store location entries
of mobile agents in its internal storage database.
LSServerService
,
LSServer
Field Summary | |
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 cryptographic algorithms. |
private static X509Certificate |
serverCertificate_
The certificate of the server, used to decrypt LSP messages within registerEncrypted . |
private static PrivateKey |
serverPrivateKey_
The private key of the server, used to decrypt LSP messages within registerEncrypted . |
protected StorageDB |
storageDB_
The internal database which is used to store the location entries of mobile objects. |
protected boolean |
verifyContactAddress_
If this flag is set, the given contact address is verified, in a register ,
registerPlain , registerEncoded
or registerEncrypted call. |
Fields inherited from class de.fhg.igd.semoa.service.AbstractService |
REV_POSTFIX, REV_PREFIX |
Constructor Summary | |
LSServerServiceImpl(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. |
protected boolean |
checkURL(URL url)
Checks if the given url
describes an existing host. |
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. |
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 ). |
protected int |
register(LSPRegister request)
Handles the given register request
(see LSPRegister ). |
LSPReply |
registerEncoded(LSPRegisterEncoded request)
Handles the given register encoded request
(see LSPRegisterEncoded ). |
LSPReply |
registerEncrypted(LSPRegisterEncrypted request)
Handles the given register encrypted request
(see LSPRegisterEncrypted ). |
LSPReply |
registerPlain(LSPRegisterPlain request)
Handles the given register plain request
(see LSPRegisterPlain ). |
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 server's internal database. |
void |
setTimeout(long timeout)
Sets the timeout of entries in the server 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
.
private static X509Certificate serverCertificate_
registerEncrypted
.
private static PrivateKey serverPrivateKey_
registerEncrypted
.
protected boolean securityOptions_
registerEncrypted
and
registerEncoded
, which
need special cryptographic algorithms.
protected boolean verifyContactAddress_
register
,
registerPlain
, registerEncoded
or registerEncrypted
call.
Working in an intranet with NAT and an
external location server, it is usefull
to deactivate this option.
protected StorageDB storageDB_
Constructor Detail |
public LSServerServiceImpl(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 one of the four register methods
is verified (see verifyContactAddress_
).Method Detail |
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
protected boolean checkURL(URL url)
url
describes an existing host.
This is done by a sequence of lookup and reverse
lookup on the URL's hostname.
url
- The url to examine.
true
if url
is existent;
false
otherwise.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 server 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
protected int register(LSPRegister request)
request
(see LSPRegister
).
Depending on the given new and current cookie,
it is distinguished if the request is an init,
update or delete register request:
currentCookie
equal NULL_COOKIE
: init
newCookie
and currentCookie
unequal
NULL_COOKIE
: update
newCookie
equal NULL_COOKIE
: delete
newCookie
and currentCookie
equal
NULL_COOKIE
: invalid
Following reply
states are possible
(see LSPReply
):
ACKNOWLEDGE
(init, update, delete)
CONTACT_ADDRESS_NOT_EXISTENT
(init, update)
COOKIE_INVALID
(update, delete)
IMPLICIT_NAME_NOT_PRESENT
(update, delete)
REQUEST_BODY_INVALID
(invalid)
request
- The register request.
public LSPReply lookup(LSPLookup request)
request
(see LSPLookup
).
Following reply
states and bodies are possible
(see LSPReply
):
ACKNOWLEDGE
(LSPLookupResult
body)
IMPLICIT_NAME_NOT_FOUND
(no body)
lookup
in interface LSServerService
request
- The lookup request.
public LSPReply registerPlain(LSPRegisterPlain request)
request
(see LSPRegisterPlain
).
Following reply
states are possible
(see LSPReply
):
ACKNOWLEDGE
REQUEST_BODY_INVALID
CONTACT_ADDRESS_NOT_EXISTENT
COOKIE_INVALID
IMPLICIT_NAME_NOT_PRESENT
registerPlain
in interface LSServerService
request
- The register plain request.
public LSPReply registerEncrypted(LSPRegisterEncrypted request)
request
(see LSPRegisterEncrypted
).
Following reply
states are possible
(see LSPReply
):
ACKNOWLEDGE
REQUEST_BODY_INVALID
CONTACT_ADDRESS_NOT_EXISTENT
COOKIE_INVALID
IMPLICIT_NAME_NOT_PRESENT
ENCRYPTING_NOT_SUPPORTED
ENCRYPTED_DATA_INVALID
registerEncrypted
in interface LSServerService
request
- The register encrypted request.
public LSPReply registerEncoded(LSPRegisterEncoded request)
request
(see LSPRegisterEncoded
).
Following reply
states are possible
(see LSPReply
):
ACKNOWLEDGE
REQUEST_BODY_INVALID
CONTACT_ADDRESS_NOT_EXISTENT
COOKIE_INVALID
IMPLICIT_NAME_NOT_PRESENT
ENCODED_NOT_SUPPORTED
ENCODED_DATA_INVALID
registerEncoded
in interface LSServerService
request
- The register encoded 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 LSServerService
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
request
- The proxy invalidate request.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |