|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The middleware level API for handling attributes of individual items/entries in the Metadata Catalog component. This is the interface that the service exposes to the other middleware components, which is not necessarily the final API seen by the user.
Method Summary | |
void |
clearAttributes(java.lang.String item,
java.lang.String[] attributeNames)
Clears the values for a group of attributes. |
Attribute[] |
getAttributes(java.lang.String item,
java.lang.String[] attributeNames)
Gets a group of attributes of a given item/entry. |
Attribute[] |
listAttributes(java.lang.String item)
List all attributes associated with an entry. |
java.lang.String[] |
query(java.lang.String query,
java.lang.String type,
int limit,
int offset)
Performs a generic query on the catalog, returning the corresponding item's identifiers. |
void |
setAttributes(java.lang.String item,
Attribute[] attributes)
Sets the values for a group of attributes of an item/entry. |
Methods inherited from interface org.glite.data.catalog.service.ServiceBase |
getInterfaceVersion, getSchemaVersion, getServiceMetadata, getVersion |
Method Detail |
public void setAttributes(java.lang.String item, Attribute[] attributes) throws AuthorizationException, NotExistsException, InvalidArgumentException, InternalException
The item is the string that uniquely identifies the entry in the catalog. It can be a GUID,
an LFN, or any other type of identifier.
The attributes parameter is a list (array) of Attribute
objects, each containing the necessary information to set the new values.
An implementation can choose to offer pure POSIX xattrs semantics, allowing
on the fly creation of attributes when they do not yet exist. The type field
in each Attribute
object should be filled in this case.
Or it may not support this feature, and the type field can be left null.
item
- The item/entry in the catalog where the values should be set.attributes
- A list of Attribute objects containing the name/type/value to be set.
Both the name and value fields in the Attribute object MUST be given.
AuthorizationException
- No access right to update values of attributes.
NotExistsException
- The entry/item or one of the attributes specified does not exist.
InvalidArgumentException
- One of the name/type pairs given for an attribute is invalid
- case of on-the-fly creation of attributes, where the type given is unsupported by the backend.
Or one of the attribute's values is invalid - while trying to update values.
InternalException
- Any other error on the server side (i.e. database down).
NotExistsException
.AuthorizationException
.InvalidArgumentException
.
NotExistsException
.InvalidArgumentException
.Attribute
,
org.glite.data.catalog.service.meta
public void clearAttributes(java.lang.String item, java.lang.String[] attributeNames) throws AuthorizationException, NotExistsException, InternalException
The item is the unique identifier of items/entries in the catalog. It can be a GUID, an LFN, or any other kind of string identifier. The attributeNames is a list of the names of the attributes inside the catalog.
item
- The item/entry where attributes should be cleared.attributeNames
- An array containing the names of the attributes to be cleared.
AuthorizationException
- No access right to update values of attributes.
NotExistsException
- The item/entry or one of the attributes specified does not exist.
InternalException
- Any other error on the server side (i.e. database down).
NotExistsException
.AuthorizationException
.NotExistsException
.org.glite.data.catalog.service.meta
public Attribute[] getAttributes(java.lang.String item, java.lang.String[] attributeNames) throws AuthorizationException, NotExistsException, InternalException
The item is the unique identifier of items/entries in the catalog. It can be a GUID, an LFN, or any other kind of string identifier. The attributeNames is a list of the names of the attributes inside the catalog.
item
- The item/entry in the catalog for which the given attributes should be returned.attributeNames
- The names of the attributes to return the values.
Attribute
objects containing the
requested values. Each Attribute
object MUST
contain the name and value filled in, and MAY contain the type filled in - but not necessarily.
Returns null if there is no attribute in the catalog with any of the given names.
AuthorizationException
- No access right to access attributes for this item.
NotExistsException
- The item/entry or one of the attributes specified does not exist.
InternalException
- Any other error on the server side (i.e. database down).
NotExistsException
.AuthorizationException
.NotExistsException
.Attribute
objects returned need not be the
same.
Attribute
,
org.glite.data.catalog.service.meta
public Attribute[] listAttributes(java.lang.String item) throws AuthorizationException, NotExistsException, InternalException
The item passed in the request is the unique identifier of the entry in the catalog.
Although the semantics of the method involve returning the names and types of the attributes
inside the catalog associated with a given entry, an implementation MAY decide to include the
values of the attributes inside each Attribute
object in the
returned list.
All attributes associated with the entry MUST be returned - including the ones with no value set.
item
- The item/entry to list the attributes.
Attribute
objects where the name and
the type MUST be filled. Optionally, the value MAY also be filled, allowing a behaviour similar
to a single-shot getAllAttributes operation - that does not exist in this interface.
Returns null if the item/entry has no attributes.
AuthorizationException
- No access right to access attributes for this entry/item.
NotExistsException
- The item/entry specified does not exist.
InternalException
- Any other error on the server side (i.e. database down).
NotExistsException
.AuthorizationException
.Attribute
,
org.glite.data.catalog.service.meta
public java.lang.String[] query(java.lang.String query, java.lang.String type, int limit, int offset) throws InternalException, AuthorizationException, InvalidArgumentException
The query is simply a string that has to be understood by the service. For example, if the catalog has a backend talking SQL, then this string should be a valid SQL query. The limit is the number of records to be returned in a single request. The offset is the number of records that should be ignored from the beginning of the whole resultset of the query.
The method returns the identifiers of all items corresponding to the given query. These identifiers
are strings, each being a GUID, an LFN, or any other unique string identifier. The number of these
items returned in each call to the service can be:
the limit provided in the query, if the number of items corresponding to the query
minus the offset is bigger than this limit.
the number of items left, when the total number of items corresponding to the query
minus the offset is smaller than the limit provided.
The service also enforces its own limits, so the maximum number of items returned in each single
call can be checked by calling ServiceBase.getServiceMetadata(java.lang.String)
and asking for the query limit
parameter.
Finally, if the service has the ability to handle schemas, the query string MUST contain the scope of the query. In example, for a SQL backend, where the schemas are mapped to tables in the database, the scope of the query is defined in the FROM part of the SQL query.
query
- The query itself, which is simply a string that the catalog understands (SQL query,
XPATH query, ...).type
- The type of query presented in the query string. This has to correspond to one of the query
types the catalog understands, and will typically be 'SQL', 'XPATH', . It
is up to the implementation to define which query types it supports.limit
- The maximum number of items to be returned. Should always be above or equal to 0 and
below the service limit. A value of 0 means no limit, which in practice means
only the system limit should be enforced.offset
- The offset for the items returned, used to iterate between results when doing
repetitive calls with the same query.
AuthorizationException
- No access right to list the entries.
InvalidArgumentException
- The query string given is invalid, or the query type is invalid,
or the limit given is invalid (below 0 or above the system limit),
or the offset is invalid (below 0).
InternalException
- Any other error on the server side (i.e. database down).
AuthorizationException
.InvalidArgumentException
.InvalidArgumentException
.InvalidArgumentException
.InvalidArgumentException
.org.glite.data.catalog.service.meta
,
ServiceBase.getServiceMetadata(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |