de.fhg.igd.atlas.core
Class ProxyInfo

java.lang.Object
  extended byde.fhg.igd.atlas.core.ProxyInfo

public class ProxyInfo
extends Object

Encapsulates the functionality needed to discover a Location Service Proxy (LSProxy) in local LAN. The location service defines the LSProxy as optional component which can be installed within the local LAN. Several potential proxys may be installed, but only one of them may be active in the same moment. This is achieved by using the Vicinity service based on a multicast protocol, which elects one LSProxy out of several potential ones.

Version:
"$Id: ProxyInfo.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters
See Also:
Vicinity, LSProxy, LSClientService, LSPRequest

Field Summary
protected  Principal localDN_
          The distinguished name of a local proxy.
private static Logger log_
          The Logger instance for this class
protected  Vicinity vicinity_
          The reference to the Vicinity service.
static String VICINITY_TOPIC
          The topic for the Vicinity service, used to elect a LSProxy in the local LAN.
 
Constructor Summary
ProxyInfo()
          Creates an instance of this class.
 
Method Summary
 LSProxyService getLocalProxy()
          Tries to locate a local LSProxyService interface
 Principal getProxyDN()
          Returns the proxy DN of the elected LSProxy.
 URL getProxyURL()
          Returns the proxy URL of the elected LSProxy.
 boolean isExistent()
          Checks if a LSProxy could have been elected successfully.
 boolean isLocal()
          Checks if the elected LSProxy is local.
protected  void registerVicinityTopic(boolean active)
          Registers the proxy specific topic VICINITY_TOPIC with Vicinity.
 String toString()
          Returns the string representation of this instance.
 void updateLocalProxyState()
          Checks if a local LSProxy has successfully bound to a port and is running.
 
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


VICINITY_TOPIC

public static final String VICINITY_TOPIC
The topic for the Vicinity service, used to elect a LSProxy in the local LAN.

See Also:
Constant Field Values

vicinity_

protected Vicinity vicinity_
The reference to the Vicinity service.


localDN_

protected Principal localDN_
The distinguished name of a local proxy.

Constructor Detail

ProxyInfo

public ProxyInfo()
Creates an instance of this class. If active is true, local server is registered as potential LSProxy.

Method Detail

registerVicinityTopic

protected void registerVicinityTopic(boolean active)
Registers the proxy specific topic VICINITY_TOPIC with Vicinity.

Parameters:
active - The flag to determine if the local server is a potential LSProxy.

updateLocalProxyState

public void updateLocalProxyState()
Checks if a local LSProxy has successfully bound to a port and is running. In this case it is registered with Vicinity, otherwise the local server as potential LSProxy is deleted from Vicinity election. In any case the Vicinity election is triggered with the according topic.


getProxyDN

public Principal getProxyDN()
Returns the proxy DN of the elected LSProxy.

Returns:
The proxy DN or null if the DN cannot be determined.

getProxyURL

public URL getProxyURL()
Returns the proxy URL of the elected LSProxy.

Returns:
The proxy DN or null if the DN cannot be determined.

isExistent

public boolean isExistent()
Checks if a LSProxy could have been elected successfully.

Returns:
true if a LSProxy has been elected; false otherwise.

isLocal

public boolean isLocal()
Checks if the elected LSProxy is local.

Returns:
true if the LSProxy is local; false otherwise.

getLocalProxy

public LSProxyService getLocalProxy()
Tries to locate a local LSProxyService interface

Returns:
The LSProxyService interface if found; null otherwise.

toString

public String toString()
Returns the string representation of this instance.

Returns:
The string representation.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.