de.fhg.igd.atlas.core
Class LSClientServiceImpl

java.lang.Object
  extended byde.fhg.igd.semoa.service.AbstractService
      extended byde.fhg.igd.atlas.core.LSClientServiceImpl
All Implemented Interfaces:
LSClientService, Service

public class LSClientServiceImpl
extends AbstractService
implements LSClientService

Provides the functionality of the Location Server Client (LSClient) which allows a user to register and lookup locations of mobile objects.

Version:
"$Id: LSClientServiceImpl.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters
See Also:
LSClientService, LSClient

Field Summary
static String C_ALG
          The algorithm used to encrypt LSP messages within globalRegisterEncrypted.
static int C_STRENGTH
          The strengh of the cipher which is used to encrypt LSP messages within globalRegisterEncrypted.
protected  String cipherAlgorithm_
          The reference to the cipher algorithm (see C_ALG).
private static String[] DEPEND_
          The dependencies to other objects in the global Environment.
protected  KeyGenerator keygen_
          The reference to the key generator (see C_ALG).
private static Logger log_
          The Logger instance for this class
protected  int maximumSize_
          The maximum size of reply pakets which are accepted in return to a sent request message of the LSP.
protected  AlgorithmParameters parameters_
          The cipher parameters (see C_ALG).
protected  AlgorithmParameterGenerator pargen_
          The reference to the parameter generator (see C_ALG).
protected  ProxyInfo proxyInfo_
          The reference to an instance of , which is used to locate the elected LSProxy,
protected  boolean securityOptions_
          This flag is set, when it's possible to use registerEncrypted and registerEncoded, which need special security algorithms.
protected  ServerInfo serverInfo_
          The reference to an instance of , which is used to locate a certain LSServer,
protected  ShipService ship_
          The reference to the ShipService service.
 
Fields inherited from class de.fhg.igd.semoa.service.AbstractService
REV_POSTFIX, REV_PREFIX
 
Fields inherited from interface de.fhg.igd.atlas.core.LSClientService
WHATIS_PREFIX
 
Constructor Summary
LSClientServiceImpl()
          Creates an instance of this class 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.
 LSPReply globalLookup(byte[] implicitName)
          Lookups the given implicitName on the corresponding LSServer (see LSPLookup).
 LSPReply globalLookup(LSPLookup lookup)
          Processes the given lookup request on the corresponding LSServer.
 LSPReply globalRefresh(LSPRefresh refresh)
          Processes the given refresh request on the corresponding LSServer.
 LSPReply globalRefresh(SortedSet implicitNames)
          Refreshes the given implicitNames on the corresponding LSServer (see LSPRefresh).
 LSPReply globalRegister(byte[] implicitName, URL contactAddress, byte[] newCookie, byte[] currentCookie)
          Registers the given implicitName and contactAddress on the corresponding LSServer (see LSPRegister).
 LSPReply globalRegister(LSPRegister register)
          Processes the given register request on the corresponding LSServer.
 LSPReply globalRegisterEncoded(byte[] implicitName, URL contactAddress, byte[] newCookie, byte[] currentCookie)
          Registers the given implicitName and contactAddress on the corresponding LSServer using encoding of the request (see LSPRegisterEncoded).
 LSPReply globalRegisterEncoded(LSPRegister register)
          Processes the given register encoded request on the corresponding LSServer using encoding of the request.
 LSPReply globalRegisterEncrypted(byte[] implicitName, URL contactAddress, byte[] newCookie, byte[] currentCookie)
          Registers the given implicitName and contactAddress on the corresponding LSServer using encryption of the request (see LSPRegisterEncrypted).
 LSPReply globalRegisterEncrypted(LSPRegister register)
          Processes the given register encrypted request on the corresponding LSServer using encryption of the request.
 LSPReply globalRegisterPlain(byte[] implicitName, URL contactAddress, byte[] newCookie, byte[] currentCookie)
          Registers the given implicitName and contactAddress on the corresponding LSServer (see LSPRegisterPlain).
 LSPReply globalRegisterPlain(LSPRegister register)
          Processes the given register plain request on the corresponding LSServer.
 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.
 AgentContext localLookup(AgentCard card)
          Lookups the given agent card on the local SeMoA system.
 AgentContext localLookup(byte[] implicitName)
          Lookups the given implicitName on the local SeMoA system.
 AgentContext localLookup(LSPLookup lookup)
          Processes the given lookup request on the local SeMoA system.
 SortedSet localLookupAll()
          Lookups all agents on the local SeMoA system.
protected  URL localURL()
          Return the URL for the local agent server, used as contact address for local agents.
 LSPReply lookup(byte[] implicitName)
          Lookups the given implicitName on the local SeMoA system, on an existing LSProxy and/or the corresponding LSServer in following manner (see LSPLookup).
 LSPReply lookup(LSPLookup lookup)
          Processes the given lookup request on the local SeMoA system, on an existing LSProxy and/or the corresponding LSServer in following manner (see LSPLookup).
 LSPReply proxyInvalidate(byte[] implicitName)
          Invalidates the given implicitName on the LSProxy (see LSPProxyInvalidate).
 LSPReply proxyInvalidate(LSPProxyInvalidate invalidate)
          Processes the given invalidate request on the LSProxy.
 LSPReply proxyLookup(byte[] implicitName)
          Lookups the given implicitName on the LSProxy (see LSPLookup).
 LSPReply proxyLookup(LSPLookup lookup)
          Processes the given lookup request on the LSProxy.
 LSPReply proxyRefresh(LSPRefresh refresh)
          Processes the given refresh request on the LSProxy.
 LSPReply proxyRefresh(Set implicitNames)
          Refreshes the given implicitNames on the LSProxy (see LSPRefresh).
 LSPReply proxyRegisterPlain(byte[] implicitName, URL contactAddress, byte[] newCookie, byte[] currentCookie)
          Registers the given implicitName and contactAddress on the LSProxy (see LSPRegisterPlain).
 LSPReply proxyRegisterPlain(LSPRegister register)
          Processes the given register plain request on the LSProxy.
 LSPReply register(byte[] implicitName, URL contactAddress, byte[] newCookie, byte[] currentCookie)
          Registers the given implicitName and contactAddress on an existing LSProxy and/or the corresponding LSServer in following manner (see LSPRegister).
 LSPReply register(LSPRegister register)
          Processes the given register request on an existing LSProxy and/or the corresponding LSServer in following manner (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.
protected  LSPReply sendRequest(LSPRequest request, URL url)
          Sends the given request to the LSProxy or LSServer with the given url and waits for a reply.
protected  void setCipherAlgorithm(String alg, int strength)
          Initializes the given cipher algorithm alg with the given strength and sets the internal variables pargen_ and keygen_.
 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

log_

private static Logger log_
The Logger instance for this class


DEPEND_

private static final String[] DEPEND_
The dependencies to other objects in the global Environment.


C_ALG

public static final String C_ALG
The algorithm used to encrypt LSP messages within globalRegisterEncrypted.

See Also:
Constant Field Values

C_STRENGTH

public static final int C_STRENGTH
The strengh of the cipher which is used to encrypt LSP messages within globalRegisterEncrypted.

See Also:
Constant Field Values

cipherAlgorithm_

protected String cipherAlgorithm_
The reference to the cipher algorithm (see C_ALG).


keygen_

protected KeyGenerator keygen_
The reference to the key generator (see C_ALG).


pargen_

protected AlgorithmParameterGenerator pargen_
The reference to the parameter generator (see C_ALG).


parameters_

protected AlgorithmParameters parameters_
The cipher parameters (see C_ALG).


securityOptions_

protected boolean securityOptions_
This flag is set, when it's possible to use registerEncrypted and registerEncoded, which need special security algorithms.


ship_

protected ShipService ship_
The reference to the ShipService service.


serverInfo_

protected ServerInfo serverInfo_
The reference to an instance of , which is used to locate a certain LSServer,


proxyInfo_

protected ProxyInfo proxyInfo_
The reference to an instance of , which is used to locate the elected LSProxy,


maximumSize_

protected int maximumSize_
The maximum size of reply pakets which are accepted in return to a sent request message of the LSP. A maximumSize_ of 0 deactivates the size control.

Constructor Detail

LSClientServiceImpl

public LSClientServiceImpl()
Creates an instance of this class with the given parameters. If filename is null, no server will be initialized.

Method Detail

initLSInfrastructure

protected boolean initLSInfrastructure(String configFile)
Initialize the location service infrastructure of distributed LS-Servers by parsing the given configuration file. If configFile is null, no server will be initialized.

Parameters:
configFile - The name the configuration file containing the configuration of the location service infrastructure.
Returns:
true, if the given configuration file has been parsed successfully, false otherwise.

initLSInfrastructure

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. If configLdapServer is null, no server will be initialized.

Parameters:
configLdapServer - The URL of the ldap server maintaining the configuration of the location service infrastructure.
Returns:
true, if the configuration has been received successfully from the given LDAP server, false otherwise.

info

public String info()
Returns the String with the service's short description.

Specified by:
info in interface Service
Specified by:
info in class AbstractService
Returns:
The String with the service's short description.

author

public String author()
Returns the String with the author's name.

Specified by:
author in interface Service
Specified by:
author in class AbstractService
Returns:
The String with the author's name.

revision

public String revision()
Returns the revision number of this class as a string.

Specified by:
revision in class AbstractService
Returns:
The revision number of this class as a string.

dependencies

public String[] dependencies()
Returns the dependencies of this service as described in Service.

Specified by:
dependencies in interface Service
Overrides:
dependencies in class AbstractService
Returns:
The array of dependencies.

toString

public String toString()
Overrides:
toString in class AbstractService
Returns:
The string representation of this instance.

localURL

protected URL localURL()
Return the URL for the local agent server, used as contact address for local agents. If the ship service is available, this URL matches the URL of the ship server including "ship" as protocol identifier, the local host IP address and the port address of the ship server. If no ship service is running, this method returns the local URL using InternetAddress.getLocalHost, including "lsp" as protocol identifier, the local host as IP address, but no port address. If the URL could not be resolved due to Exceptions caused by network missconfiguration, a dummy URL of the following format will be returned: error://unknown

Returns:
The URL of the local agent server.

setCipherAlgorithm

protected void setCipherAlgorithm(String alg,
                                  int strength)
                           throws NoSuchAlgorithmException,
                                  IllegalArgumentException,
                                  NullPointerException
Initializes the given cipher algorithm alg with the given strength and sets the internal variables pargen_ and keygen_.

Parameters:
alg - The cipher algorithm to intitialize.
Throws:
NoSuchAlgorithmException - if alg could not be initialized.
IllegalArgumentException - if strength < 1 (RuntimeException).
NullPointerException - if alg is null (RuntimeException).

securityAvailable

public boolean securityAvailable()
Returns the availability of encryption and encoding what needs special cryptographic algorithms.

Returns:
true if secure register requests can be handled; false otherwise.

sendRequest

protected LSPReply sendRequest(LSPRequest request,
                               URL url)
Sends the given request to the LSProxy or LSServer with the given url and waits for a reply. In addition to the regular replies from the LSProxy or LSPServer, replies with the following states can be returned to sender in case of an error, which has been occured during request encoding or message transmission:

Parameters:
request - The request.
url - The destination URL of a LSProxy or LSServer
Returns:
The reply to the given request.

globalLookup

public LSPReply globalLookup(LSPLookup lookup)
Processes the given lookup request on the corresponding LSServer. Following reply states and bodies are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
lookup - The lookup request.
Returns:
The reply to the given request.

globalLookup

public LSPReply globalLookup(byte[] implicitName)
Lookups the given implicitName on the corresponding LSServer (see LSPLookup). Following reply states and bodies are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
implicitName - The implicit name.
Returns:
The reply to the given request.

globalRegisterPlain

public LSPReply globalRegisterPlain(LSPRegister register)
Processes the given register plain request on the corresponding LSServer. Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
register - The register plain request.
Returns:
The reply to the given request.

globalRegisterPlain

public LSPReply globalRegisterPlain(byte[] implicitName,
                                    URL contactAddress,
                                    byte[] newCookie,
                                    byte[] currentCookie)
Registers the given implicitName and contactAddress on the corresponding LSServer (see LSPRegisterPlain). Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
implicitName - The implicit name.
contactAddress - The contact address.
newCookie - The new cookie.
currentCookie - The current cookie
Returns:
The reply to the given request.

globalRegisterEncrypted

public LSPReply globalRegisterEncrypted(LSPRegister register)
                                 throws InvalidAlgorithmParameterException,
                                        GeneralSecurityException,
                                        BadNameException
Processes the given register encrypted request on the corresponding LSServer using encryption of the request. Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface without encryption, otherwise the request is send over the internet.

Parameters:
register - The register encrypted request.
Returns:
The reply to the given request.
Throws:
InvalidAlgorithmParameterException - if the secret key for bulk data encryption of the request cannot be generated successfully.
GeneralSecurityException - if some cipher operation fails.
BadNameException - if the issuer name in server's certificate cannot be parsed.

globalRegisterEncrypted

public LSPReply globalRegisterEncrypted(byte[] implicitName,
                                        URL contactAddress,
                                        byte[] newCookie,
                                        byte[] currentCookie)
                                 throws InvalidAlgorithmParameterException,
                                        GeneralSecurityException,
                                        BadNameException
Registers the given implicitName and contactAddress on the corresponding LSServer using encryption of the request (see LSPRegisterEncrypted). Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface without encryption, otherwise the request is send over the internet.

Parameters:
implicitName - The implicit name.
contactAddress - The contact address.
newCookie - The new cookie.
currentCookie - The current cookie
Returns:
The reply to the given request.
Throws:
InvalidAlgorithmParameterException - if the secret key for bulk data encryption of the request cannot be generated successfully.
GeneralSecurityException - if some cipher operation fails.
BadNameException - if the issuer name in server's certificate cannot be parsed.

globalRegisterEncoded

public LSPReply globalRegisterEncoded(LSPRegister register)
                               throws GeneralSecurityException
Processes the given register encoded request on the corresponding LSServer using encoding of the request. Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface without encoding, otherwise the request is send over the internet.

Parameters:
register - The register encoded request.
Returns:
The reply to the given request.
Throws:
GeneralSecurityException - if an error occurs while generating the message authentification code.

globalRegisterEncoded

public LSPReply globalRegisterEncoded(byte[] implicitName,
                                      URL contactAddress,
                                      byte[] newCookie,
                                      byte[] currentCookie)
                               throws GeneralSecurityException
Registers the given implicitName and contactAddress on the corresponding LSServer using encoding of the request (see LSPRegisterEncoded). Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface without encoding, otherwise the request is send over the internet.

Parameters:
implicitName - The implicit name.
contactAddress - The contact address.
newCookie - The new cookie.
currentCookie - The current cookie
Returns:
The reply to the given request.
Throws:
GeneralSecurityException - if an error occurs while generating the message authentification code.

globalRefresh

public LSPReply globalRefresh(LSPRefresh refresh)
Processes the given refresh request on the corresponding LSServer. Following reply states and bodies are possible (see LSPReply):

If an error occures on client side during the request is processed, the CLIENT_ERROR_FLAG of the reply is set; if an error occures on server side during the request is processed, the SERVER_ERROR_FLAG of the reply is set.

The given request is divided into sub requests: one request for each LSServer which has to be contacted. If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
refresh - The refresh request.
Returns:
The reply to the given request.

globalRefresh

public LSPReply globalRefresh(SortedSet implicitNames)
Refreshes the given implicitNames on the corresponding LSServer (see LSPRefresh). Following reply states and bodies are possible (see LSPReply):

If an error occures on client side during the request is processed, the CLIENT_ERROR_FLAG of the reply is set; if an error occures on server side during the request is processed, the SERVER_ERROR_FLAG of the reply is set.

The given request is divided into sub requests: one request for each LSServer which has to be contacted. If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
implicitNames - The sorted set of implicit names of the type byte[].
Returns:
The reply to the given request.

proxyLookup

public LSPReply proxyLookup(LSPLookup lookup)
Processes the given lookup request on the LSProxy. Following reply states and bodies are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the LSProxy has not found the implicit name in its internal database and the reply state of the LSServer received by the proxy had neither been ACKNOWLEDGE nor IMPLICIT_NAME_NOT_FOUND, but another error code.

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
lookup - The lookup request.
Returns:
The reply to the given request.

proxyLookup

public LSPReply proxyLookup(byte[] implicitName)
Lookups the given implicitName on the LSProxy (see LSPLookup). Following reply states and bodies are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the LSProxy has not found the implicit name in its internal database and the reply state of the LSServer received by the proxy had neither been ACKNOWLEDGE nor IMPLICIT_NAME_NOT_FOUND, but another error code.

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
implicitName - The implicit name.
Returns:
The reply to the given request.

proxyRegisterPlain

public LSPReply proxyRegisterPlain(LSPRegister register)
Processes the given register plain request on the LSProxy. Following reply states are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the reply state of the LSServer received by the proxy had been an IO_ERROR.

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
register - The register plain request.
Returns:
The reply to the given request.

proxyRegisterPlain

public LSPReply proxyRegisterPlain(byte[] implicitName,
                                   URL contactAddress,
                                   byte[] newCookie,
                                   byte[] currentCookie)
Registers the given implicitName and contactAddress on the LSProxy (see LSPRegisterPlain). Following reply states are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the reply state of the LSServer received by the proxy had been an IO_ERROR.

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
implicitName - The implicit name.
contactAddress - The contact address.
newCookie - The new cookie.
currentCookie - The current cookie
Returns:
The reply to the given request.

proxyRefresh

public LSPReply proxyRefresh(LSPRefresh refresh)
Processes the given refresh request on the LSProxy. Following reply states and bodies are possible (see LSPReply):

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
refresh - The refresh request.
Returns:
The reply to the given request.

proxyRefresh

public LSPReply proxyRefresh(Set implicitNames)
Refreshes the given implicitNames on the LSProxy (see LSPRefresh). Following reply states and bodies are possible (see LSPReply):

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
implicitNames - The sorted set of implicit names of the type byte[].
Returns:
The reply to the given request.

proxyInvalidate

public LSPReply proxyInvalidate(LSPProxyInvalidate invalidate)
Processes the given invalidate request on the LSProxy. Following reply states are possible (see LSPReply):

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
invalidate - The invalidate request.
Returns:
The reply to the given request.

proxyInvalidate

public LSPReply proxyInvalidate(byte[] implicitName)
Invalidates the given implicitName on the LSProxy (see LSPProxyInvalidate). Following reply states are possible (see LSPReply):

The PROXY_ERROR_FLAG of the reply is set, if no proxy is existent within the local LAN.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

Parameters:
implicitName - The implicit name.
Returns:
The reply to the given request.

localLookup

public AgentContext localLookup(AgentCard card)
Lookups the given agent card on the local SeMoA system.

Parameters:
card - The agent card.
Returns:
The agent's context, if the agent with the given agent card has been found on the local system; null otherwise.

localLookup

public AgentContext localLookup(LSPLookup lookup)
Processes the given lookup request on the local SeMoA system.

Parameters:
lookup - The lookup request.
Returns:
The agent's context, if the request has been processed successfully on the local system; null otherwise.

localLookup

public AgentContext localLookup(byte[] implicitName)
Lookups the given implicitName on the local SeMoA system.

Parameters:
implicitName - The implicit name.
Returns:
The agent's context, if the agent with the given implicit name has been found on the local system; null otherwise.

localLookupAll

public SortedSet localLookupAll()
Lookups all agents on the local SeMoA system.

Returns:
The sortet set of implicit names of the type byte[] corresponding to all agents found on the local system.

globalRegister

public LSPReply globalRegister(LSPRegister register)
Processes the given register request on the corresponding LSServer.

Dependent on the value of new cookie and current cooky it is decided which kind of register request demanded. In the case of an init request it is tried to register with globalRegisterEncrypted, in the case of update or delete request it is tried to register with globalRegisterEncoded. If the security options aren't available or an error occures during encryption/encoding on client side respectively decryption/decoding on server side, globalRegisterPlain is used.

Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
register - The register plain request.
Returns:
The reply to the given request.

globalRegister

public LSPReply globalRegister(byte[] implicitName,
                               URL contactAddress,
                               byte[] newCookie,
                               byte[] currentCookie)
Registers the given implicitName and contactAddress on the corresponding LSServer (see LSPRegister).

Dependent on the value of new cookie and current cooky it is decided which kind of register request demanded. In the case of an init request it is tried to register with globalRegisterEncrypted, in the case of update or delete request it is tried to register with globalRegisterEncoded. If the security options aren't available or an error occures during encryption/encoding on client side respectively decryption/decoding on server side, globalRegisterPlain is used.

Following reply states are possible (see LSPReply):

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Parameters:
implicitName - The implicit name.
contactAddress - The contact address.
newCookie - The new cookie.
currentCookie - The current cookie
Returns:
The reply to the given request.

register

public LSPReply register(LSPRegister register)
Processes the given register request on an existing LSProxy and/or the corresponding LSServer in following manner (see LSPRegister).

  +--proxyRegisterPlain
  |  |
  |  +--globalRegisterEncrypted/Encoded
  |     |
  |     +--globalRegisterPlain
  |
  +--globalRegisterEncrypted/Encoded
     |
     +--globalRegisterPlain
 
If a LSProxy is existent in the local LAN, it is used to process the register request. The proxy itself forwards the request to the corresponding LSServer by using encryption respectively encoding of the request message if security options are available, using plain messages otherwise.

If no LSProxy is existent in the local LAN, the request is processed directly by the corresponding LSServer as described.

Following reply states are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the reply state of the LSServer received by the proxy had been an IO_ERROR.

The PROXY_ERROR_FLAG of the reply is set, if the reply state of the LSProxy received by the client had been an IO_ERROR.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Specified by:
register in interface LSClientService
Parameters:
register - The register request.
Returns:
The reply to the given request.

register

public LSPReply register(byte[] implicitName,
                         URL contactAddress,
                         byte[] newCookie,
                         byte[] currentCookie)
Registers the given implicitName and contactAddress on an existing LSProxy and/or the corresponding LSServer in following manner (see LSPRegister).

  +--proxyRegisterPlain
  |  |
  |  +--globalRegisterEncrypted/Encoded
  |     |
  |     +--globalRegisterPlain
  |
  +--globalRegisterEncrypted/Encoded
     |
     +--globalRegisterPlain
 
If a LSProxy is existent in the local LAN, it is used to process the register request. The proxy itself forwards the request to the corresponding LSServer by using encryption respectively encoding of the request message if security options are available, using plain messages otherwise.

If no LSProxy is existent in the local LAN, the request is processed directly by the corresponding LSServer as described.

Following reply states are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the reply state of the LSServer received by the proxy had been an IO_ERROR.

The PROXY_ERROR_FLAG of the reply is set, if the reply state of the LSProxy received by the client had been an IO_ERROR.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

In the case that an update request could not be processed succesfully, because the corresponding entry has not been found, it's tried to reinitialize the entry with an init request.

Specified by:
register in interface LSClientService
Parameters:
implicitName - The implicit name.
contactAddress - The contact address.
newCookie - The new cookie.
currentCookie - The current cookie
Returns:
The reply to the given request.

lookup

public LSPReply lookup(LSPLookup lookup)
Processes the given lookup request on the local SeMoA system, on an existing LSProxy and/or the corresponding LSServer in following manner (see LSPLookup).

  +--localLookup
  |
  +--proxyLookup
  |  |
  |  +--globalLookup
  |
  +--globalLookup
 
The lookup request is processed on the local SeMoA first.

If this request was not successful and a LSProxy is existent in the local LAN, it is used to process the lookup request. The proxy itself forwards the request to the corresponding LSServer in the case, that the searched entry is not found on the proxy.

If no LSProxy is existent in the local LAN, the request is processed directly by the corresponding LSServer as described.

Following reply states and bodies are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the reply state of the LSServer received by the proxy had been an IO_ERROR.

The PROXY_ERROR_FLAG of the reply is set, if the reply state of the LSProxy received by the client had been an IO_ERROR.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Specified by:
lookup in interface LSClientService
Parameters:
lookup - The register lookup.
Returns:
The reply to the given request.

lookup

public LSPReply lookup(byte[] implicitName)
Lookups the given implicitName on the local SeMoA system, on an existing LSProxy and/or the corresponding LSServer in following manner (see LSPLookup).

  +--localLookup
  |
  +--proxyLookup
  |  |
  |  +--globalLookup
  |
  +--globalLookup
 
The lookup request is processed on the local SeMoA first.

If this request was not successful and a LSProxy is existent in the local LAN, it is used to process the lookup request. The proxy itself forwards the request to the corresponding LSServer in the case, that the searched entry is not found on the proxy.

If no LSProxy is existent in the local LAN, the request is processed directly by the corresponding LSServer as described.

Following reply states and bodies are possible (see LSPReply):

The SERVER_ERROR_FLAG of the reply is set, if the reply state of the LSServer received by the proxy had been an IO_ERROR.

The PROXY_ERROR_FLAG of the reply is set, if the reply state of the LSProxy received by the client had been an IO_ERROR.

If the proxy can be found locally, it is accessed directly through the LSProxyService interface, otherwise the request is send within the local LAN.

If the corresponding server can be found locally, it is accessed directly through the LSServerService interface, otherwise the request is send over the internet.

Specified by:
lookup in interface LSClientService
Parameters:
implicitName - The implicit name.
Returns:
The reply to the given request.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.