org.gcube.data.tml.clients
Interface TWriterClient

All Known Implementing Classes:
WriterClient

public interface TWriterClient

A high-level interface to T-Writer services.

T-Writer services give write-only access to given data sources under a tree-based data model.

Clients may target T-Writer services at known endpoints (direct mode ). Alternative, they may discover T-Writer services bound to given sources ( discovery mode).

In discovery mode, clients attempt to interact with discovered services, until they succeed with one. They then cache the the endpoint of this service and use it first for subsequent interactions.

Author:
Fabio Simeoni
See Also:
TBinderClient

Method Summary
 org.gcube.data.trees.data.Tree add(Element tree)
          Adds a Tree to the bound source.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> add(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> trees)
          Adds zero or more Trees to the bound source.
 org.gcube.data.trees.data.Tree add(org.gcube.data.trees.data.Tree tree)
          Adds a Tree to the bound source.
 org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> add(URI treeRs)
          Adds zero or more Trees to the bound source.
 org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.UpdateFailure> update(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> deltas)
          Updates zero or more Trees in the bound source.
 void update(org.gcube.data.trees.data.Tree delta)
          Updates a tree in the bound source.
 org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.UpdateFailure> update(URI deltaRs)
          Updates zero or more Trees in the bound source.
 

Method Detail

add

org.gcube.data.trees.data.Tree add(org.gcube.data.trees.data.Tree tree)
                                   throws org.gcube.common.clients.DiscoveryException,
                                          UnsupportedOperationException,
                                          UnsupportedRequestException,
                                          InvalidTreeException,
                                          Exception
Adds a Tree to the bound source.

Parameters:
tree - the tree
Returns:
the tree after insertion.
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
InvalidTreeException - if the tree cannot be added because it is invalid
Exception - if the operation fails for an unexpected error

add

org.gcube.data.trees.data.Tree add(Element tree)
                                   throws org.gcube.common.clients.DiscoveryException,
                                          UnsupportedOperationException,
                                          UnsupportedRequestException,
                                          InvalidTreeException,
                                          Exception
Adds a Tree to the bound source.

Parameters:
tree - the Element representation of the tree
Returns:
the tree after insertion.
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
InvalidTreeException - if the tree is invalid
Exception - if the operation fails for an unexpected error

add

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> add(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> trees)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Adds zero or more Trees to the bound source.

Parameters:
trees - a Stream of Trees
Returns:
a Stream of added Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

add

org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> add(URI treeRs)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         UnsupportedOperationException,
                                                                         UnsupportedRequestException,
                                                                         Exception
Adds zero or more Trees to the bound source.

Parameters:
treeRs - a locator to a Result Set of Trees
Returns:
a Stream of added Trees
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

update

void update(org.gcube.data.trees.data.Tree delta)
            throws org.gcube.common.clients.DiscoveryException,
                   UnsupportedOperationException,
                   UnsupportedRequestException,
                   InvalidTreeException,
                   UnknownTreeException,
                   Exception
Updates a tree in the bound source.

Parameters:
delta - the delta tree that captures the update
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
InvalidTreeException - if the delta tree is invalid
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
UnknownTreeException - if the tree is unknown in the bound source (cannot be identified from the delta tree)
Exception - if the operation fails for an unexpected error

update

org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.UpdateFailure> update(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> deltas)
                                                                            throws org.gcube.common.clients.DiscoveryException,
                                                                                   UnsupportedOperationException,
                                                                                   UnsupportedRequestException,
                                                                                   Exception
Updates zero or more Trees in the bound source.

Parameters:
deltas - a Stream of Trees to add
Returns:
a Stream of UpdateFailures
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error

update

org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.UpdateFailure> update(URI deltaRs)
                                                                            throws org.gcube.common.clients.DiscoveryException,
                                                                                   UnsupportedOperationException,
                                                                                   UnsupportedRequestException,
                                                                                   Exception
Updates zero or more Trees in the bound source.

Parameters:
deltaRs - a locator to a Result Set of delta tree that capture the updates
Returns:
a Stream of UpdateFailures
Throws:
org.gcube.common.clients.DiscoveryException - if, in discovery mode, there is no service for the bound source
UnsupportedOperationException - if the bound source does not support the operation
UnsupportedRequestException - if the bound source does not support this particular request
Exception - if the operation fails for an unexpected error


Copyright © 2012. All Rights Reserved.