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

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

public class SAMAPIPollingMethod
extends java.lang.Object
implements ISAMPollingMethod

The interface for polling methods.

Description:
Will check the availability of a resource by making an API call by using the SAM protocol.
Concurrency issues:
-

Author:
Alfa & Ariss

Constructor Summary
SAMAPIPollingMethod()
           
 
Method Summary
 void init(java.lang.Object oResourceConfigSection, java.lang.Object oPollingMethodConfigSection, ConfigManager oConfigManager, SystemLogger oSystemLogger)
          Will read the url from the SAMService servlet that must be polled and sets the given ConfigManager and SystemLogger as class variables.
 boolean poll()
          The method that used to poll the SAMService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAMAPIPollingMethod

public SAMAPIPollingMethod()
Method Detail

init

public void init(java.lang.Object oResourceConfigSection,
                 java.lang.Object oPollingMethodConfigSection,
                 ConfigManager oConfigManager,
                 SystemLogger oSystemLogger)
          throws ASelectSAMException
Will read the url from the SAMService servlet that must be polled and sets the given ConfigManager and SystemLogger as class variables.

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()
The method that used to poll the SAMService. It checks only if the OID: 1.3.6.1.4.1.15396.10.10.2.1.3 is 1 (only the operational check)

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.