|
||||||||||
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.semoa.net.AbstractServer de.fhg.igd.atlas.core.LSServer
Provides a server of the location service which stores implicit name
to contact address mappings.
This Location Service Server (LSServer
) is used by a Location
Service Client (LSClient
) to lookup or register the location
of mobile objects.
Following request are accepted as LSP messages from the network:
LSPLookup
LSPRegisterPlain
LSPRegisterEncrypted
LSPRegisterEncoded
LSPRefresh
A LSServer
is responsible for all implicit names with
a certain prefix.
LSServerService
,
ServerInfo
Nested Class Summary |
Nested classes inherited from class de.fhg.igd.semoa.net.AbstractServer |
AbstractServer.Job |
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 |
static int |
MAX_CAPACITY
The maximum capacity of this server. |
static String |
OPT_DESCR
The ArgsParser option descriptor for the case
that this class is initiated from command line. |
static String |
PROTOCOL
The string identifier of the protocol spoken by this server. |
protected LSServerServiceImpl |
serverService_
The reference to the LSServerService interface. |
static long |
STORAGE_DB_TIMEOUT
Timeout for entries of the internal storage database in milli seconds. |
Fields inherited from class de.fhg.igd.semoa.net.AbstractServer |
bad_, DEFAULT_CAPACITY, good_, thread_ |
Fields inherited from class de.fhg.igd.semoa.service.AbstractService |
REV_POSTFIX, REV_PREFIX |
Fields inherited from interface de.fhg.igd.semoa.net.Server |
BOUND_TO_PORT, ERROR, RUNNING, SHUTDOWN, UNDEFINED |
Constructor Summary | |
protected |
LSServer(StorageDB storageDB,
boolean verifyContactAddress)
Creates an instance of this class and initializes the LSServerService
with the given parameters. |
Method Summary | |
String |
author()
Returns the String with the author's name. |
String[] |
dependencies()
Returns the dependencies of this service as described in Service . |
protected void |
handleConnection(Socket connection)
Handles the given connection according to a simple request/response scheme. |
protected LSPReply |
handleRequest(LSPRequest request)
Handles the given request
and returns a corresponding reply. |
String |
info()
Returns the String with the service's short description. |
static void |
main(String[] argv)
Initializes the LSServer from command line. |
String |
protocol()
|
String |
revision()
Returns the revision number of this class as a string. |
Methods inherited from class de.fhg.igd.semoa.net.AbstractServer |
bad, createJob, createServerSocket, exceptionInfo, getCapacity, getMaximumSize, getPort, getServerState, good, isEnabled, localURL, rebind, run, serverStateChanged, setCapacity, setEnabled, setMaximumSize, setPort, shutdown, signal, 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
.
public static final String PROTOCOL
public static final int MAX_CAPACITY
public static long STORAGE_DB_TIMEOUT
public static final String OPT_DESCR
ArgsParser
option descriptor for the case
that this class is initiated from command line.
protected LSServerServiceImpl serverService_
LSServerService
interface.
Constructor Detail |
protected LSServer(StorageDB storageDB, boolean verifyContactAddress)
LSServerService
with the given parameters.
If storageDB
is null
, the
MemoryDB
is used as default database for the server.
storageDB
- The storage database to
use as part of the LSServer
.verifyContactAddress
- If this flag is set,
contact addresses to register are verified first
(see LSServerServiceImpl
).Method Detail |
public String info()
info
in interface Service
info
in class AbstractService
public String author()
author
in interface Service
author
in class AbstractServer
public String revision()
revision
in class AbstractService
public String[] dependencies()
Service
.
dependencies
in interface Service
dependencies
in class AbstractService
public String protocol()
protocol
in interface Server
protocol
in class AbstractServer
protected void handleConnection(Socket connection)
WRONG_VERSION
REQUEST_TYPE_INVALID
REQUEST_BODY_INVALID
handleConnection
in class AbstractServer
connection
- The socket connection that must be
handled by this method.protected LSPReply handleRequest(LSPRequest request)
request
and returns a corresponding reply.
Following requests are allowed:
LSPLookup
LSPRegisterPlain
LSPRegisterEncrypted
LSPRegisterEncoded
LSPRefresh
request
- The request to be handled.
public static void main(String[] argv) throws ArgsParserException, ObjectExistsException
LSServer
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 |