|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Writer
Defines facilities to change the contents of a remote collection of document descriptions, including adding new descriptions, updating existing descriptions, and deleting existing descriptions.
Method Summary | |
---|---|
java.lang.String |
add(GCubeDocument document)
Adds a document description to the target collection and returns an identifier for it. |
java.util.concurrent.Future<?> |
add(java.util.Iterator<GCubeDocument> documents)
Adds a stream of document descriptions to the target collection. |
java.util.List<AddOutcome> |
add(java.util.List<GCubeDocument> documents)
Adds a list of document descriptions to the target collection and returns a list of corresponding outcomes, where each outcome is either an identifier for the description or else a processing failure. |
GCubeDocument |
addAndSynchronize(GCubeDocument document)
Adds a document description to the target collection and returns a proxy for it which is synchronised with the changes applied to the description at the point of addition, including the assignment of identifiers to the description and its inner elements. |
java.lang.String |
collectionID()
Returns the identifier of the target collection. |
void |
delete(GCubeDocument document)
Deletes a document description from the target collection using a proxy for it. |
java.util.concurrent.Future<?> |
delete(java.util.Iterator<GCubeDocument> documents)
Deletes multiple document descriptions from the target collection using a stream of proxies for them. |
java.util.Map<java.lang.String,java.lang.Throwable> |
delete(java.util.List<GCubeDocument> documents)
Deletes multiple document descriptions from the target collection using a list of proxies for them. |
void |
update(GCubeDocument document)
Updates a document description in the target collection with the properties of a local proxy. |
java.util.concurrent.Future<?> |
update(java.util.Iterator<GCubeDocument> documents)
Updates multiple document descriptions with the properties of a stream of proxies. |
java.util.Map<java.lang.String,java.lang.Throwable> |
update(java.util.List<GCubeDocument> documents)
Updates multiple document descriptions in the target collections with the properties of a list of proxies. |
GCubeDocument |
updateAndSynchronize(GCubeDocument document)
Updates a document description in the target collection with the properties of a local proxy, and returns a a new proxy which is fully synchronised with the description. |
Method Detail |
---|
java.lang.String add(GCubeDocument document) throws java.lang.IllegalArgumentException, DiscoveryException, GCUBEException, java.lang.Exception
The description must satisfy certain basic criteria, including the lack of
identifiers for it and all its inner elements, the consistency between the collection bound
to it and the collection bound to this Writer
, and other constraints that are specific
to its inner elements. We say that the description must be valid for addition.
document
- a document description valid for addition.
java.lang.IllegalArgumentException
- if the document description is not valid for addition.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.GCubeDocument addAndSynchronize(GCubeDocument document) throws java.lang.IllegalArgumentException, DiscoveryException, GCUBEException, java.lang.Exception
The description must satisfy certain basic criteria, including the lack
of identifiers for it and all its inner elements, the consistency between the collection bound
to it and the collection bound to this Writer
, and other constraints that are specific
to its inner elements. We say that the description must be valid for addition.
document
- a document description valid for addition.
java.lang.IllegalArgumentException
- if the document description is not valid for addition.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.java.util.List<AddOutcome> add(java.util.List<GCubeDocument> documents) throws java.lang.IllegalArgumentException, DiscoveryException, GCUBEException, java.lang.Exception
Each description must satisfy certain basic criteria, including the lack
of identifiers for it and all its inner elements, the consistency between the collection bound
to it and the collection bound to this Writer
, and other constraints that are specific
to its inner elements. We say that the description must be valid for addition. If one of the
descriptions in input is not valid for addition, the operation
fails before any attempt is made to add any description to the target collection.
Note that this operation uses result set mechanisms to interact with the remote collection and thus can be invoked only inside a container.
documents
- a list of document descriptions valid for addition.
AddOutcome
s, in the same order as the descriptions in input.
java.lang.IllegalArgumentException
- if at least one of the document descriptions in input is not valid for addition.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.java.util.concurrent.Future<?> add(java.util.Iterator<GCubeDocument> documents) throws DiscoveryException, GCUBEException, java.lang.Exception
Each description must satisfy certain basic criteria, including the lack
of identifiers for it and all its inner elements, the consistency between the collection bound
to it and the collection bound to this Writer
, and other constraints that are specific
to its inner elements. We say that the description must be valid for addition. Descriptions in the stream
that are not valid for addition are discarded and no attempt is made to add them to the target collection
(the exclusion is logged).
Due to the possibility of pre-processing failures and its non-blocking nature, the operation
cannot guarantee the fidelity of outcome reports. For this reason, the operation returns only a Future
that clients can poll to know when all the descriptions in input have been submitted for addition.
Clients that work with large or remote streams, and are interested in processing outcomes, are responsible
for grouping the elements of the streams in 'chunks' of acceptable size and use add(List)
with each chunk. The facilities of the
DSL for streams
can be conveniently used for this purpose (cf. Streams.group(Iterator)
,Streams#group(RemoteIterator)
).
Note that this operation uses result set mechanisms to interact with remote services and thus can be invoked only inside a container.
documents
- an Iterator
over a stream of document descriptions valid for addition.
Future
for the completion of the operation.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.void update(GCubeDocument document) throws java.lang.IllegalArgumentException, DiscoveryException, GCUBEException, java.lang.Exception
The proxy must satisfy certain basic criteria, including the consistency between the collection bound
to it and the collection bound to this Writer
, the existence of tracked changes on it (cf. GCubeDocument#trackChanges()
),
and other constraints that are specific to its inner elements. We say that the proxy must be valid for update.
Note that, upon successful completion of the operation, the proxy in input may not be synchronised with the updated
document description.Use #updateAndSynchronize(GCubedocument)
to obtain a synchronised proxy of the updated document description.
document
- a proxy which is valid for update.
java.lang.IllegalArgumentException
- if the proxy is not valid for update.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.GCubeDocument updateAndSynchronize(GCubeDocument document) throws java.lang.IllegalArgumentException, DiscoveryException, GCUBEException, java.lang.Exception
The proxy must satisfy certain basic criteria, including the consistency between the collection bound
to it and the collection bound to this Writer
, the existence of tracked changes on it (cf. GCubeDocument#trackChanges()
),
and other constraints that are specific to its inner elements. We say that the proxy must be valid for update.
document
- a proxy which is valid for update.
java.lang.IllegalArgumentException
- if the proxy is not valid for update.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.java.util.Map<java.lang.String,java.lang.Throwable> update(java.util.List<GCubeDocument> documents) throws DiscoveryException, GCUBEException, java.lang.Exception
Each proxy must satisfy certain basic criteria, including the consistency between the collection bound
to it and the collection bound to this Writer
, the existence of tracked changes on it (cf. GCubeDocument#trackChanges()
),
and other constraints that are specific to its inner elements. We say that the proxy must be valid for update.
If one of the proxies in input is not valid for addition, the operation
fails before any attempt is made to update any description in the target collection.
Note that this operation uses result set mechanisms to interact with the remote collection and thus can be invoked only inside a container.
documents
- a list of proxies valid for update.
java.lang.IllegalArgumentException
- if at least one of the proxies in input is not valid for update.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.java.util.concurrent.Future<?> update(java.util.Iterator<GCubeDocument> documents) throws DiscoveryException, GCUBEException, java.lang.Exception
Each proxy must satisfy certain basic criteria, including the consistency between the collection bound
to it and the collection bound to this Writer
, the existence of tracked changes on it (cf. GCubeDocument#trackChanges()
),
and other constraints that are specific to its inner elements. We say that the proxy must be valid for update. Proxies in the stream
that are not valid for update are discarded and no attempt is made to update the corresponding descriptions.
(the exclusion is logged).
Due to the possibility of pre-processing failures and its non-blocking nature, the operation
cannot guarantee the fidelity of outcome reports. For this reason, the operation returns only a Future
that clients can poll to know when all the proxies in input have been submitted for update.
Clients that work with large or remote streams and are interested in processing outcomes, are responsible
for grouping the elements of the stream in 'chunks' of acceptable size and use update(List)
with each chunk. The facilities of the
DSL for streams
can be conveniently used for this purpose (cf. Streams.group(Iterator)
,Streams#group(RemoteIterator)
).
Note that this operation uses result set mechanisms to interact with remote services and thus can be invoked only inside a container.
documents
- an Iterator
over proxies that are valid for update.
Future
for the completion of the operation.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.void delete(GCubeDocument document) throws java.lang.IllegalArgumentException, DiscoveryException, GCUBEException, java.lang.Exception
document
- a proxy of the description to be deleted from the target collection.
java.lang.IllegalArgumentException
- if the input is not a proxy (i.e. has no identifier).
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.java.util.Map<java.lang.String,java.lang.Throwable> delete(java.util.List<GCubeDocument> documents) throws DiscoveryException, GCUBEException, java.lang.Exception
If the list contains a description which is not a proxy, the operation fails before any attempt is made to delete any document description in the target collection.
Note that this operation uses result set mechanisms to interact with remote services and thus can be invoked only inside a container.
documents
- a list of proxies of the descriptions to be deleted from the target collection.
java.lang.IllegalArgumentException
- if the input list contains at least one description which is not a proxy.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.java.util.concurrent.Future<?> delete(java.util.Iterator<GCubeDocument> documents) throws DiscoveryException, GCUBEException, java.lang.Exception
Descriptions in the stream that are not proxies are discarded (the exclusion is logged). Due to the possibility
of pre-processing failures and its non-blocking nature, the operation cannot guarantee the fidelity of outcome reports.
For this reason, the operation returns only a Future
that clients can poll to know when all the proxies in input have been submitted for deletion.
Clients that work with large or remote stream, and are interested in processing outcomes, are responsible
for grouping the elements of the stream in 'chunks' of acceptable size and use update(List)
with each chunk. The facilities of the
DSL for streams
can be conveniently used for this purpose (cf. Streams.group(Iterator)
,Streams#group(RemoteIterator)
).
Note that this operation uses result set mechanisms to interact with remote services and thus can be invoked only inside a container.
documents
- an Iterator
over the proxies of the descriptions to be deleted from the target collection.
Future
for the completion of the operation.
DiscoveryException
- if the operation cannot be completed due to collection discovery errors.
GCUBEException
- if the operation cannot be completed due to other remote errors.
java.lang.Exception
- if the operation cannot be completed due to local errors.java.lang.String collectionID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |