org.ogf.saga.attributes
Interface Attributes

All Known Subinterfaces:
AsyncAttributes<T>, Context, EntityData, Job, JobDescription, JobSelf, LogicalDirectory, LogicalFile, Metric, ServiceData, ServiceDescription, Stream

public interface Attributes

Provides a uniform paradigm to set and query parameters and properties of SAGA objects. Attributes map a key to a value, and have a type. All keys are represented as a String, values are either represented as a String or a list of Strings, depending on whether the attribute is scalar or a vector. Also, attribute values have a type, which determines how the values are interpreted.


Field Summary
static String BOOL
          Values of Bool type attributes are expressed as 'True' or 'False', as defined below.
static String ENUM
          Values of Enum type attributes are expressed as strings, and have the literal value of the respective enums as defined in the attribute type at hand.
static String FALSE
          'False' value of a 'Bool' attribute.
static String FLOAT
          Values of Float (i.e. floating point) type attributes are expressed as they would in result of a printf of the format %Lf as defined by POSIX.
static String INT
          Values of Int (i.e.
static String STRING
          Values of String type attributes are expressed as-is.
static String TIME
          Values of Time type attributes are expressed as they would in result of a call to ctime(), as defined by POSIX, which is almost the same as the result SimpleDateFormat, when the SimpleDateFormat object is instantiated with "EEE MMM dd HH:mm:ss yyyy".
static String TRIGGER
          Trigger type attributes don't have a value at all.
static String TRUE
          'True' value of a 'Bool' attribute.
 
Method Summary
 boolean existsAttribute(String key)
          Checks the existence of an attribute.
 String[] findAttributes(String... patterns)
          Finds matching attributes.
 String getAttribute(String key)
          Gets the value of an attribute.
 String[] getVectorAttribute(String key)
          Gets the array of values associated with an attribute.
 boolean isReadOnlyAttribute(String key)
          Checks the attribute for being read-only.
 boolean isRemovableAttribute(String key)
          Checks the attribute for being removable.
 boolean isVectorAttribute(String key)
          Checks the attribute for being a vector.
 boolean isWritableAttribute(String key)
          Checks the attribute for being writable.
 String[] listAttributes()
          Gets the list of attribute keys.
 void removeAttribute(String key)
          Removes an attribute.
 void setAttribute(String key, String value)
          Sets an attribute to a value.
 void setVectorAttribute(String key, String[] values)
          Sets an attribute to an array of values.
 

Field Detail

STRING

static final String STRING
Values of String type attributes are expressed as-is.

See Also:
Constant Field Values

INT

static final String INT
Values of Int (i.e. Integer) type attributes are expressed as they would in result of a printf of the format %lld as defined by POSIX.

See Also:
Constant Field Values

ENUM

static final String ENUM
Values of Enum type attributes are expressed as strings, and have the literal value of the respective enums as defined in the attribute type at hand.

See Also:
Constant Field Values

FLOAT

static final String FLOAT
Values of Float (i.e. floating point) type attributes are expressed as they would in result of a printf of the format %Lf as defined by POSIX.

See Also:
Constant Field Values

BOOL

static final String BOOL
Values of Bool type attributes are expressed as 'True' or 'False', as defined below.

See Also:
Constant Field Values

TIME

static final String TIME
Values of Time type attributes are expressed as they would in result of a call to ctime(), as defined by POSIX, which is almost the same as the result SimpleDateFormat, when the SimpleDateFormat object is instantiated with "EEE MMM dd HH:mm:ss yyyy". The only difference is that the date field should be space-padded, not zero-padded. Applications can also specify these attribute values as seconds since epoch (this formats the string as an Int type), but all time attributes set by implementations must be in the format described above.

See Also:
Constant Field Values

TRIGGER

static final String TRIGGER
Trigger type attributes don't have a value at all. They are used in monitoring.

See Also:
Constant Field Values

TRUE

static final String TRUE
'True' value of a 'Bool' attribute.

See Also:
Constant Field Values

FALSE

static final String FALSE
'False' value of a 'Bool' attribute.

See Also:
Constant Field Values
Method Detail

setAttribute

void setAttribute(String key,
                  String value)
                  throws NotImplementedException,
                         AuthenticationFailedException,
                         AuthorizationFailedException,
                         PermissionDeniedException,
                         IncorrectStateException,
                         BadParameterException,
                         DoesNotExistException,
                         TimeoutException,
                         NoSuccessException
Sets an attribute to a value.

Parameters:
key - the attribute key.
value - value to set the attribute to.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is thrown when the specified value does not conform to the attribute type.
DoesNotExistException - is thrown when the attribute does not exist.
IncorrectStateException - is thrown when the attribute is a vector attribute.
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.

getAttribute

String getAttribute(String key)
                    throws NotImplementedException,
                           AuthenticationFailedException,
                           AuthorizationFailedException,
                           PermissionDeniedException,
                           IncorrectStateException,
                           DoesNotExistException,
                           TimeoutException,
                           NoSuccessException
Gets the value of an attribute.

Parameters:
key - the attribute key.
Returns:
the value of this attribute.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
DoesNotExistException - is thrown when the attribute does not exist.
IncorrectStateException - is thrown when the attribute is a vector attribute.
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.

setVectorAttribute

void setVectorAttribute(String key,
                        String[] values)
                        throws NotImplementedException,
                               AuthenticationFailedException,
                               AuthorizationFailedException,
                               PermissionDeniedException,
                               IncorrectStateException,
                               BadParameterException,
                               DoesNotExistException,
                               TimeoutException,
                               NoSuccessException
Sets an attribute to an array of values.

Parameters:
key - the attribute key.
values - values to set the attribute to.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is thrown when the specified value does not conform to the attribute type. In particular, this exception is thrown when the specified value is null. An array with no elements is allowed, though.
DoesNotExistException - is thrown when the attribute does not exist.
IncorrectStateException - is thrown when the attribute is not a vector attribute.
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.

getVectorAttribute

String[] getVectorAttribute(String key)
                            throws NotImplementedException,
                                   AuthenticationFailedException,
                                   AuthorizationFailedException,
                                   PermissionDeniedException,
                                   IncorrectStateException,
                                   DoesNotExistException,
                                   TimeoutException,
                                   NoSuccessException
Gets the array of values associated with an attribute.

Parameters:
key - the attribute key.
Returns:
the values of this attribute, which may be an array with no elements, but not null.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
DoesNotExistException - is thrown when the attribute does not exist.
IncorrectStateException - is thrown when the attribute is not a vector attribute.
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.

removeAttribute

void removeAttribute(String key)
                     throws NotImplementedException,
                            AuthenticationFailedException,
                            AuthorizationFailedException,
                            PermissionDeniedException,
                            DoesNotExistException,
                            TimeoutException,
                            NoSuccessException
Removes an attribute.

Parameters:
key - the attribute key.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
DoesNotExistException - is thrown when the attribute does not exist.
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.

listAttributes

String[] listAttributes()
                        throws NotImplementedException,
                               AuthenticationFailedException,
                               AuthorizationFailedException,
                               PermissionDeniedException,
                               TimeoutException,
                               NoSuccessException
Gets the list of attribute keys.

Returns:
the list of attribute keys.
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.

findAttributes

String[] findAttributes(String... patterns)
                        throws NotImplementedException,
                               BadParameterException,
                               AuthenticationFailedException,
                               AuthorizationFailedException,
                               PermissionDeniedException,
                               TimeoutException,
                               NoSuccessException
Finds matching attributes. This method accepts a list of patterns, and returns a list of keys for those attributes that match any one of the specified patterns. The allowed patterns describe both attribute keys and values, and are formatted as key-pattern=value-pattern. Both the key-pattern value-pattern can contain wildcards. The value-pattern can be empty, and the method will then return all attribute keys which match the key-pattern. The equal sign = can then be omitted from the pattern.

Parameters:
patterns - the search patterns.
Returns:
the list of matching attribute keys.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is thrown when one ore more of the specified patterns are not correctly formatted.
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.

existsAttribute

boolean existsAttribute(String key)
                        throws NotImplementedException,
                               AuthenticationFailedException,
                               AuthorizationFailedException,
                               PermissionDeniedException,
                               TimeoutException,
                               NoSuccessException
Checks the existence of an attribute.

Parameters:
key - the attribute key.
Returns:
true if the attribute exists.
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.

isReadOnlyAttribute

boolean isReadOnlyAttribute(String key)
                            throws NotImplementedException,
                                   AuthenticationFailedException,
                                   AuthorizationFailedException,
                                   PermissionDeniedException,
                                   DoesNotExistException,
                                   TimeoutException,
                                   NoSuccessException
Checks the attribute for being read-only.

Parameters:
key - the attribute key.
Returns:
true if the attribute exists and is read-only.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
DoesNotExistException - is thrown when the attribute does not exist.
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.

isWritableAttribute

boolean isWritableAttribute(String key)
                            throws NotImplementedException,
                                   AuthenticationFailedException,
                                   AuthorizationFailedException,
                                   PermissionDeniedException,
                                   DoesNotExistException,
                                   TimeoutException,
                                   NoSuccessException
Checks the attribute for being writable.

Parameters:
key - the attribute key.
Returns:
true if the attribute exists and is writable.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
DoesNotExistException - is thrown when the attribute does not exist.
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.

isRemovableAttribute

boolean isRemovableAttribute(String key)
                             throws NotImplementedException,
                                    AuthenticationFailedException,
                                    AuthorizationFailedException,
                                    PermissionDeniedException,
                                    DoesNotExistException,
                                    TimeoutException,
                                    NoSuccessException
Checks the attribute for being removable.

Parameters:
key - the attribute key.
Returns:
true if the attribute exists and is removable.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
DoesNotExistException - is thrown when the attribute does not exist.
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.

isVectorAttribute

boolean isVectorAttribute(String key)
                          throws NotImplementedException,
                                 AuthenticationFailedException,
                                 AuthorizationFailedException,
                                 PermissionDeniedException,
                                 DoesNotExistException,
                                 TimeoutException,
                                 NoSuccessException
Checks the attribute for being a vector.

Parameters:
key - the attribute key.
Returns:
true if the attribute is a vector attribute.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
DoesNotExistException - is thrown when the attribute does not exist.
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.


Copyright © 2014 Open Grid Forum. All rights reserved.