|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gridrm.client.utilities.sorma.monitoring.MonitoringImpl
public class MonitoringImpl
| Field Summary | |
|---|---|
protected String |
endNonMetaRequest
|
protected String |
xmlAllResources
|
| Constructor Summary | |
|---|---|
MonitoringImpl(String clientName,
String mediatorGroupName)
|
|
| 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. |
void |
finalize()
|
Resource[] |
getCoreAttributeValues(String[] resourceNames,
boolean registeredOnly,
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 |
void |
processMessage(Message t)
Called by the BlockingTycho API and used internally by this class. |
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 |
tychoClientRegistered()
Invoked by Tycho when the client is registered. |
void |
unregisterResource(String resourceName,
String gatewayName,
Credential userCredential)
Remove a resource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String xmlAllResources
protected String endNonMetaRequest
| Constructor Detail |
|---|
public MonitoringImpl(String clientName,
String mediatorGroupName)
throws Exception
clientName: - The name of this client. Does not have to be unique, but if it is
then other components can resolve an address to this client easily
if they perform a registry lookup.gridrmGatewayName: - The name of the GridRM Gateway that you initially want to connect
tomediatorGroupName: - The name of the Tycho mediator group that you will join
Exception: - If any problems occur that mean this client cannot be registered
with Tycho.
Exception| Method Detail |
|---|
public void processMessage(Message t)
public long registerForEvents(EventType eventType,
String gatewayName,
EventHandler handler,
Credential userCredential)
throws Exception
registerForEvents in interface MonitoringeventType: - The type of event you wish to register to receivegatewayName: - The name of the gateway to send command to.
Exception
public boolean cancelEventRegistration(EventType eventType,
String gatewayName,
Credential userCredential)
throws Exception
cancelEventRegistration in interface MonitoringeventType: - The type of event you wish to register to receivegatewayName: - The name of the gateway to send this command to.userCredential -
Exception: - If any error occurred that prevented the request from
being processed by the gateway (e.g. authorisation failure).
Exception
public Resource getCoreAttributeValues(String resourceName,
String gatewayName,
CacheTTL ttl,
Credential userCredential)
throws Exception
getCoreAttributeValues in interface MonitoringgatewayName: - The name of the gateway to send this command to.resourceName - attributes -
Exception
public Resource[] getCoreAttributeValues(String gatewayName,
CacheTTL ttl,
Credential userCredential)
throws Exception
getCoreAttributeValues in interface MonitoringgatewayName: - The name of the gateway to send this command to.ttl: - The gateway cache policy to useuserCredential: - The user credentials
Exception
public Resource[] getCoreAttributeValues(String[] resourceNames,
boolean registeredOnly,
String gatewayName,
CacheTTL ttl,
Credential userCredential)
throws Exception
getCoreAttributeValues in interface MonitoringresourceNames: - The name of each resourcenamedOnly: - 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 useuserCredential: - The user credentials
Exception
public ResultSet query(SqlQuery sqlQuery,
String gatewayName,
Credential userCredential)
throws SQLException,
Exception
query in interface MonitoringSqlQuery: - The SQL query to executegatewayName: - The name of the gateway to send this command to.ttl: - The gateway cache policy to use (as appropriate)userCredential: - The user credentials
SQLException
Exception
public Driver[] listRegisteredDrivers(String gatewayName,
Credential userCredential)
throws Exception
Monitoring
listRegisteredDrivers in interface MonitoringException
public ResourceRegistrationDescription[] listRegisteredResources(String gatewayName,
Credential userCredential)
throws Exception
listRegisteredResources in interface MonitoringString - gatewayName: The gateway's Tycho nameCredential: - The user's credential
Exceptionpublic void tychoClientRegistered()
public void finalize()
finalize in class Object
public void reportProblem(ProblemReport report,
String gatewayName,
Credential userCredential)
throws Exception
Monitoring
reportProblem in interface MonitoringProblemReport - report: The issue we wish to report to the gateway admin
Exception: - If any problems occur that mean the report cannot be sent
Exception
public void registerResource(String name,
DriverType driver,
int nonStandardPort,
Credential resourceCredential,
String gatewayName,
Credential userCredential)
throws ResourceAlreadyRegisteredException,
IOException
registerResource in interface Monitoringname: - The name of the resourcedriver: - The default driver to use for this resourcenonStandardPort: - 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
ResourceAlreadyRegisteredException: - If the named resource is already registered at the gateway
IOException: - If the name resolution or network interaction fail
ResourceAlreadyRegisteredException
IOException
public void unregisterResource(String resourceName,
String gatewayName,
Credential userCredential)
throws IOException
unregisterResource in interface Monitoringname - resource nameip - resource IP addressuserDN - uses distinguished namegatewayName - the gateway to submit the command to
IOException
public void shutdown()
throws IOException
shutdown in interface MonitoringIOException
public void startResourceWatch(String resourceName,
int frequency,
long duration,
String gatewayName,
Credential userCredential,
EventHandler handler)
throws IOException
startResourceWatch in interface MonitoringresourceName: - The resource to watch.frequency: - The frequency in seconds between resource pollsduration: - The duration in seconds that the watch should lastgatewayName: - the gateway to submit the command touserCredential: - The user credentialshandler: - The eventHandler to receive
java.io.IOException: - If the named resource is not a registered
resource.
IOException
public boolean haltResourceWatch(String resourceName,
String gatewayName,
Credential userCredential)
throws IOException
haltResourceWatch in interface MonitoringresourceName - gatewayName - userCredential -
java.io.IOException: - If any other problems occurred that caused this
call to fail.
IOException
public ResultSet getResourceWatchData(String resourceName,
String gatewayName,
Credential userCredential)
throws IOException
getResourceWatchData in interface MonitoringresourceName - gatewayName - userCredential -
IOException
public void startJobWatch(String jobId,
int interval,
String resourceName,
String gatewayName,
Credential userCredential)
throws IOException
startJobWatch in interface MonitoringjobId: - 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 millisecondsresourceName: - The resource executing the job.gatewayName: - The gateway to submit the command touserCredential: - The user credentials
IOException
public void stopJobWatch(String jobId,
String resourceName,
String gatewayName,
Credential userCredential)
throws IOException
stopJobWatch in interface MonitoringjobId: - job identifierresourceName: - The resource executing the job.gatewayName: - The gateway to submit the command touserCredential: - The user credentials
IOException
public Job getJobWatchData(String jobId,
String resourceName,
String gatewayName,
Credential userCredential)
throws IOException
getJobWatchData in interface MonitoringjobId - resourceName - gatewayName - userCredential -
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||