org.gridrm.client.utilities.sorma.monitoring
Interface Monitoring

All Known Implementing Classes:
MonitoringImpl

public interface Monitoring


Method Summary
 boolean cancelEventRegistration(EventType eventType, String gatewayName, Credential userCredential)
          Use this method to cancel an event registration that you previously made using the registerForEvents(...) method.
 Resource[] getCoreAttributeValues(String[] resourceNames, boolean namedOnly, String gatewayName, CacheTTL ttl, Credential userCredential)
          Retrieve the core attribute values for the named resources
 Resource[] getCoreAttributeValues(String gatewayName, CacheTTL ttl, Credential userCredential)
          Retrieve the core attribute values for all resources registered with the named gateway.
 Resource getCoreAttributeValues(String resourceName, String gatewayName, CacheTTL ttl, Credential userCredential)
          Retrieve the core attribute values for the named resource only.
 Job getJobWatchData(String jobId, String resourceName, String gatewayName, Credential userCredential)
          Return data from the gateway's internal database that resulted from a particular jobWatch.
 ResultSet getResourceWatchData(String resourceName, String gatewayName, Credential userCredential)
          Returns historical data that was captured using the startResourceWatch() method.
 boolean haltResourceWatch(String resourceName, String gatewayName, Credential userCredential)
          Halt a previously started resource watch.
 Driver[] listRegisteredDrivers(String gatewayName, Credential userCredential)
          Returns a list of the drivers that have been registered at the default gateway
 ResourceRegistrationDescription[] listRegisteredResources(String gatewayName, Credential userCredential)
          Returns a list of the resources currently registered with the specified gateway
 ResultSet query(SqlQuery sqlQuery, String gatewayName, Credential userCredential)
          Submit an SQL query to the gateway.
 long registerForEvents(EventType eventType, String gatewayName, EventHandler handler, Credential userCredential)
          Use this method to register interest in events.
 void registerResource(String name, DriverType driver, int nonStandardPort, Credential resourceCredential, String gatewayName, Credential userCredential)
          Register a new resource for monitoring by the specified gateway
 void reportProblem(ProblemReport report, String gatewayName, Credential userCredential)
          Send a problem report to the gateway.
 void shutdown()
          Unregister the client from the Tycho registry
 void startJobWatch(String jobId, int interval, String resourceName, String gatewayName, Credential userCredential)
          Instructs the gateway to monitor the execution of a particular job.
 void startResourceWatch(String resourceName, int frequency, long duration, String gatewayName, Credential userCredential, EventHandler handler)
          Instructs the gateway to capture the specified resource's core attribute values at the stated frequency and store them in the gateway's internal database.
 void stopJobWatch(String jobId, String resourceName, String gatewayName, Credential userCredential)
          Instructs the gateway to stop watching the specified job.
 void unregisterResource(String resourceName, String gatewayName, Credential userCredential)
          Remove a resource from the gateway registered resources list.
 

Method Detail

registerForEvents

long registerForEvents(EventType eventType,
                       String gatewayName,
                       EventHandler handler,
                       Credential userCredential)
                       throws Exception
Use this method to register interest in events.

Parameters:
eventType: - The type of event you wish to register to receive
gatewayName: - The name of the gateway to send this command to.
Throws:
Exception

cancelEventRegistration

boolean cancelEventRegistration(EventType eventType,
                                String gatewayName,
                                Credential userCredential)
                                throws Exception
Use this method to cancel an event registration that you previously made using the registerForEvents(...) method.

Parameters:
eventType: - The type of event you wish to register to receive
gatewayName: - The name of the gateway to send this command to.
userCredential -
Returns:
true if an event registration was cancelled. False if there was no existing event registration of this type at the gateway.
Throws:
Exception: - If any error occurred that prevented the request from being processed by the gateway (e.g. authorisation failure).
Exception

listRegisteredResources

ResourceRegistrationDescription[] listRegisteredResources(String gatewayName,
                                                          Credential userCredential)
                                                          throws Exception
Returns a list of the resources currently registered with the specified gateway

Parameters:
String - gatewayName: The gateway's Tycho name
Credential: - The user's credential
Throws:
Exception

getCoreAttributeValues

Resource getCoreAttributeValues(String resourceName,
                                String gatewayName,
                                CacheTTL ttl,
                                Credential userCredential)
                                throws Exception
Retrieve the core attribute values for the named resource only. If the named resource is e.g. a beowulf cluster, only metrics for the head node is returned. If you want to see compute nodes as well then use the other getCoreAttributeValues() method and set the namedOnly parameter to false.

Parameters:
gatewayName: - The name of the gateway to send this command to.
resourceName -
attributes -
Returns:
Throws:
Exception

getCoreAttributeValues

Resource[] getCoreAttributeValues(String[] resourceNames,
                                  boolean namedOnly,
                                  String gatewayName,
                                  CacheTTL ttl,
                                  Credential userCredential)
                                  throws Exception
Retrieve the core attribute values for the named resources

Parameters:
resourceNames: - The name of each resource
namedOnly: - Some agents (e.g. Ganglia) allow a single resource to include data for multiple peer resources (e.g. nodes in a cluster). Such behaviour is not always desirable, for example when offering a single workstation to the SORMA market, that just happens to be monitored by a Ganglia gmond that is configured to receive peer metrics over multicast (the default gmond behaviour). Set to true to ensure the metrics for the named resource only are returned. Set to false if you also want to see any additional resources that are related to the named resource (e.g. a named resource is the headnode to a beowulf cluster and the related nodes would be the cluster's compute nodes.
gatewayName: - The name of the gateway to send this command to.
ttl: - The gateway cache policy to use
userCredential: - The user credentials
Returns:
Resource[] an array of Resource values.
Throws:
Exception

getCoreAttributeValues

Resource[] getCoreAttributeValues(String gatewayName,
                                  CacheTTL ttl,
                                  Credential userCredential)
                                  throws Exception
Retrieve the core attribute values for all resources registered with the named gateway. This method returns all registered resources and any additional resources that are provided by the registered resource's monitoring agent. Data is provided directly from the resource agents in near real-time and/or from the gatway cache in accordance with the cacheTTL value supplied.

Parameters:
gatewayName: - The name of the gateway to send this command to.
ttl: - The gateway cache policy to use
userCredential: - The user credentials
Returns:
Throws:
Exception

query

ResultSet query(SqlQuery sqlQuery,
                String gatewayName,
                Credential userCredential)
                throws SQLException,
                       Exception
Submit an SQL query to the gateway.

Parameters:
SqlQuery: - The SQL query to execute
gatewayName: - The name of the gateway to send this command to.
ttl: - The gateway cache policy to use (as appropriate)
userCredential: - The user credentials
Returns:
Throws:
SQLException
Exception

listRegisteredDrivers

Driver[] listRegisteredDrivers(String gatewayName,
                               Credential userCredential)
                               throws Exception
Returns a list of the drivers that have been registered at the default gateway

Parameters:
gatewayName: - The name of the gateway to send this command to.
Returns:
Throws:
Exception

reportProblem

void reportProblem(ProblemReport report,
                   String gatewayName,
                   Credential userCredential)
                   throws Exception
Send a problem report to the gateway.

Parameters:
ProblemReport: - the report
gatewayName: - The name of the gateway to send this command to.
Throws:
Exception

registerResource

void registerResource(String name,
                      DriverType driver,
                      int nonStandardPort,
                      Credential resourceCredential,
                      String gatewayName,
                      Credential userCredential)
                      throws ResourceAlreadyRegisteredException,
                             IOException
Register a new resource for monitoring by the specified gateway

Parameters:
name: - The name of the resource
driver: - The default driver to use for this resource
nonStandardPort: - If 0 use default port for resource agent, if >1 then use the specified port instead of the default port.
resourceCredential: - A credential required to authenticate with the underlying resource agent. A null value indicates that either a credential is not required, or it is not known at this time (in case of the latter, subsequent queries to the resource can be expected to fail. The admin can update resource credential at the gateway).
gatewayName: - The name of the gateway to submit the command to.
userDN: - The user's distinguished name
Throws:
ResourceAlreadyRegisteredException: - If the named resource is already registered at the gateway
IOException: - If the name resolution or network interaction fail
ResourceAlreadyRegisteredException
IOException

unregisterResource

void unregisterResource(String resourceName,
                        String gatewayName,
                        Credential userCredential)
                        throws IOException
Remove a resource from the gateway registered resources list.

Parameters:
name - resource name
userDN - uses distinguished name
gatewayName - the gateway to submit the command to
Throws:
IOException

startResourceWatch

void startResourceWatch(String resourceName,
                        int frequency,
                        long duration,
                        String gatewayName,
                        Credential userCredential,
                        EventHandler handler)
                        throws IOException
Instructs the gateway to capture the specified resource's core attribute values at the stated frequency and store them in the gateway's internal database. Subsequent watch requests for the same resource override earlier requests. If the resource is unregistered from the gateway during the watch, then the watch is cancelled and a RESOURCE_UNREGISTERED event is sent to the specified EventHandler. If data capture failures occur for any other reason then the client is notified by RESOURCE_FAILED_TO_RESPOND events.

Parameters:
resourceName: - The resource to watch.
frequency: - The frequency in seconds between resource polls
duration: - The duration in seconds that the watch should last
gatewayName: - the gateway to submit the command to
userCredential: - The user credentials
handler: - The eventHandler to receive
Throws:
java.io.IOException: - If the named resource is not a registered resource.
IOException

haltResourceWatch

boolean haltResourceWatch(String resourceName,
                          String gatewayName,
                          Credential userCredential)
                          throws IOException
Halt a previously started resource watch. If no watch is in place then this call has no effect.

Parameters:
resourceName -
gatewayName -
userCredential -
Throws:
java.io.IOException: - If any other problems occurred that caused this call to fail.
IOException

getResourceWatchData

ResultSet getResourceWatchData(String resourceName,
                               String gatewayName,
                               Credential userCredential)
                               throws IOException
Returns historical data that was captured using the startResourceWatch() method. Currently this method returns all data that was ever recorded for the resource. Later versions will allow data to be retrieved from specific datetime ranges.

Parameters:
resourceName -
gatewayName -
userCredential -
Returns:
Throws:
IOException

startJobWatch

void startJobWatch(String jobId,
                   int interval,
                   String resourceName,
                   String gatewayName,
                   Credential userCredential)
                   throws IOException
Instructs the gateway to monitor the execution of a particular job. The gateway samples process utilisation at the specified period and saves the resulting data to the gateway's internal database. *

Parameters:
jobId: - An identifier that the resource's agent can use to determine the process to be monitored. E.g. process ID (pid) in the case of fork().
interval: - the process utilisation sampling period in milliseconds
resourceName: - The resource executing the job.
gatewayName: - The gateway to submit the command to
userCredential: - The user credentials
Throws:
IOException

stopJobWatch

void stopJobWatch(String jobId,
                  String resourceName,
                  String gatewayName,
                  Credential userCredential)
                  throws IOException
Instructs the gateway to stop watching the specified job.

Parameters:
jobId: - job identifier
resourceName: - The resource executing the job.
gatewayName: - The gateway to submit the command to
userCredential: - The user credentials
Throws:
IOException

getJobWatchData

Job getJobWatchData(String jobId,
                    String resourceName,
                    String gatewayName,
                    Credential userCredential)
                    throws IOException
Return data from the gateway's internal database that resulted from a particular jobWatch.

Parameters:
jobId -
resourceName -
gatewayName -
userCredential -
Returns:
Throws:
IOException

shutdown

void shutdown()
              throws IOException
Unregister the client from the Tycho registry

Throws:
IOException


Copyright © 2007 Garry Smith. All Rights Reserved.