org.ogf.saga.monitoring
Interface Monitorable

All Known Subinterfaces:
AsyncMonitorable<T>, Job, JobSelf, Stream, StreamServer, Task<T,E>, TaskContainer

public interface Monitorable

The Monitorable interface is implemented by SAGA objects that can be monitored (have one or more associated metrics).


Method Summary
 int addCallback(String name, Callback cb)
          Adds a callback to the specified metric.
 Metric getMetric(String name)
          Returns a metric instance, identified by name.
 String[] listMetrics()
          Lists all metrics associated with the object.
 void removeCallback(String name, int cookie)
          Removes the specified callback.
 

Method Detail

listMetrics

String[] listMetrics()
                     throws NotImplementedException,
                            AuthenticationFailedException,
                            AuthorizationFailedException,
                            PermissionDeniedException,
                            TimeoutException,
                            NoSuccessException
Lists all metrics associated with the object.

Returns:
the names identifying the metrics associated with the object.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

getMetric

Metric getMetric(String name)
                 throws NotImplementedException,
                        AuthenticationFailedException,
                        AuthorizationFailedException,
                        PermissionDeniedException,
                        DoesNotExistException,
                        TimeoutException,
                        NoSuccessException
Returns a metric instance, identified by name.

Parameters:
name - the name of the metric to be returned.
Returns:
the metric.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
DoesNotExistException - is thrown when a metric with the specified name does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

addCallback

int addCallback(String name,
                Callback cb)
                throws NotImplementedException,
                       AuthenticationFailedException,
                       AuthorizationFailedException,
                       PermissionDeniedException,
                       DoesNotExistException,
                       TimeoutException,
                       NoSuccessException,
                       IncorrectStateException
Adds a callback to the specified metric.

Parameters:
name - identifier the metric to which the callback is to be added.
cb - the callback to be added.
Returns:
a handle to be used for removal of the callback.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
DoesNotExistException - is thrown when a metric with the specified name does not exist.
IncorrectStateException - is thrown if the specified metric has mode "Final".
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

removeCallback

void removeCallback(String name,
                    int cookie)
                    throws NotImplementedException,
                           DoesNotExistException,
                           BadParameterException,
                           TimeoutException,
                           NoSuccessException,
                           AuthenticationFailedException,
                           AuthorizationFailedException,
                           PermissionDeniedException
Removes the specified callback.

Parameters:
name - identifier the metric from which the callback is to be removed.
cookie - identifies the callback to be removed.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
DoesNotExistException - is thrown when a metric with the specified name does not exist.
BadParameterException - is thrown when the specified cookie does not refer to a callback.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.


Copyright © 2014 Open Grid Forum. All rights reserved.