de.fhg.igd.semoa.net.farsight
Class ExplorerStrategy

java.lang.Object
  extended byde.fhg.igd.semoa.net.farsight.DiscoveryStrategy
      extended byde.fhg.igd.semoa.net.farsight.ExplorerStrategy
All Implemented Interfaces:
ArrivalListener

public class ExplorerStrategy
extends DiscoveryStrategy
implements ArrivalListener

This discovery strategy uses mobile agents to detect SeMoA hosts. The used agent type is ExplorerAgent.

On creation of this class the AgentArrivalFilter is installed in the filter pipeline of SeMoA. Every incoming agent is tested for certain properties. If the agent is accepted, an ExplorerAgent will be created that will examine the SeMoA host the incoming agent did come from. The following must not be true for the incoming agent:

Version:
"$id: $"
Author:
Jan Haevecker
See Also:
ExplorerAgent

Field Summary
private static Logger log_
          The Logger instance for this class
private static String VALID_PREFIX_CHARS
          Sorted list of valid filter prefix characters (see installAgentArrivalFilter().
 
Fields inherited from class de.fhg.igd.semoa.net.farsight.DiscoveryStrategy
 
Constructor Summary
ExplorerStrategy(String config)
          Sole constructor.
 
Method Summary
 void agentArrived(AgentContext context)
          Called by the AgentArrivalFilter when a new agent arrives at this SeMoA server.
private  void explore(Map contacts)
          Sends an ExplorerAgent to every value from the contacts map.
private static URL getRawURL(URL shipURL)
          Replaces the protocol of shipURL with "raw".
private  void installAgentArrivalFilter()
          Installs the AgentArrivalFilter into this SeMoA server's filter pipeline.
protected  boolean isExplorer(AgentContext context)
          Returns whether a given agent context is a ExplorerAgent.
protected  boolean isKnownHost(URL url)
          Checks whether FarSight does already know the host at url.
private  void loadDefaultGateways()
          Reads the default gateways from the properties file and sends an ExplorerAgent.
static void sendExplorer(URL target)
          Sends an ExplorerAgent to a given target.
 
Methods inherited from class de.fhg.igd.semoa.net.farsight.DiscoveryStrategy
getConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID_PREFIX_CHARS

private static final String VALID_PREFIX_CHARS
Sorted list of valid filter prefix characters (see installAgentArrivalFilter().

See Also:
Constant Field Values

log_

private static Logger log_
The Logger instance for this class

Constructor Detail

ExplorerStrategy

public ExplorerStrategy(String config)
                 throws ObjectExistsException
Sole constructor.

Method Detail

agentArrived

public void agentArrived(AgentContext context)
Called by the AgentArrivalFilter when a new agent arrives at this SeMoA server.

Specified by:
agentArrived in interface ArrivalListener
Parameters:
context - The agent context of the arriving agent.

explore

private void explore(Map contacts)
Sends an ExplorerAgent to every value from the contacts map.


sendExplorer

public static void sendExplorer(URL target)
Sends an ExplorerAgent to a given target. The protocol of the target URL will be set to "raw".


getRawURL

private static URL getRawURL(URL shipURL)
                      throws ShipException,
                             MalformedURLException
Replaces the protocol of shipURL with "raw".

Throws:
ShipException
MalformedURLException

isExplorer

protected boolean isExplorer(AgentContext context)
Returns whether a given agent context is a ExplorerAgent.


isKnownHost

protected boolean isKnownHost(URL url)
Checks whether FarSight does already know the host at url.


installAgentArrivalFilter

private void installAgentArrivalFilter()
                                throws ObjectExistsException
Installs the AgentArrivalFilter into this SeMoA server's filter pipeline.

Throws:
ObjectExistsException

loadDefaultGateways

private void loadDefaultGateways()
Reads the default gateways from the properties file and sends an ExplorerAgent.



Copyright © Fraunhofer Gesellschaft. All Rights Reserved.