org.aselect.system.sam.agent.polling
Class SAMICMPPollingMethod

java.lang.Object
  extended by org.aselect.system.sam.agent.polling.SAMICMPPollingMethod
All Implemented Interfaces:
ISAMPollingMethod

public class SAMICMPPollingMethod
extends java.lang.Object
implements ISAMPollingMethod

Polls a resource by using ICMP PING commands.

Description:
Will check the availability of a resource by sending a ping (ICMP echo request).
Concurrency issues:
-

Author:
Alfa & Ariss

Constructor Summary
SAMICMPPollingMethod()
           
 
Method Summary
 void init(java.lang.Object oResourceConfigSection, java.lang.Object oPollingMethodConfigSection, ConfigManager oConfigManager, SystemLogger oSystemLogger)
          Reads the config parameters 'url' and 'pingcommand' from the supplied polling method config and sets the given system logger as logger for this class.
 boolean poll()
          Polls the resource by executing the ping command located in _sbPingCommand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMICMPPollingMethod

public SAMICMPPollingMethod()
Method Detail

init

public void init(java.lang.Object oResourceConfigSection,
                 java.lang.Object oPollingMethodConfigSection,
                 ConfigManager oConfigManager,
                 SystemLogger oSystemLogger)
          throws ASelectSAMException
Reads the config parameters 'url' and 'pingcommand' from the supplied polling method config and sets the given system logger as logger for this class.

Specified by:
init in interface ISAMPollingMethod
Parameters:
oResourceConfigSection - the config section of the resource which has to be polled
oPollingMethodConfigSection - The config section of the polling method config section
oConfigManager - The config manager used to resolve the configuration
oSystemLogger - the logger used for system logging
Throws:
ASelectSAMException - if the poller could not be initialized
See Also:
ISAMPollingMethod.init(java.lang.Object, java.lang.Object, org.aselect.system.configmanager.ConfigManager, org.aselect.system.logging.SystemLogger)

poll

public boolean poll()
Polls the resource by executing the ping command located in _sbPingCommand.

Specified by:
poll in interface ISAMPollingMethod
Returns:
TRUE if the resource is available, FALSE if the resource is unavailable.
See Also:
ISAMPollingMethod.poll()


Copyright © 2008 SURFnet BV. All Rights Reserved.