org.gcube.data.tml.clients
Class WriterClient

java.lang.Object
  extended by org.gcube.data.tml.clients.WriterClient
All Implemented Interfaces:
TWriterClient

public class WriterClient
extends Object
implements TWriterClient

A TWriterClient implementation.

Author:
Fabio Simeoni

Constructor Summary
WriterClient(org.gcube.common.clients.Client<org.gcube.data.tm.stubs.TWriterPortType> client)
           
WriterClient(org.apache.axis.message.addressing.EndpointReferenceType endpoint)
          Creates an instance to write through a service at a given endpoint.
WriterClient(org.gcube.common.clients.gcore.StatefulQuery query)
          Creates an instance for writing in a data source discovered with a given query.
WriterClient(String sourceId)
          Creates an instance for writing in a given data source.
 
Method Summary
 org.gcube.data.trees.data.Tree add(Element doc)
          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 doc)
          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 doc)
          Updates a tree in the bound source.
 org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.UpdateFailure> update(URI locator)
          Updates zero or more Trees in the bound source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriterClient

public WriterClient(org.gcube.common.clients.Client<org.gcube.data.tm.stubs.TWriterPortType> client)

WriterClient

public WriterClient(org.gcube.common.clients.gcore.StatefulQuery query)
Creates an instance for writing in a data source discovered with a given query.

Parameters:
query - the query.

WriterClient

public WriterClient(String sourceId)
Creates an instance for writing in a given data source.

Parameters:
sourceId - the source identifier

WriterClient

public WriterClient(org.apache.axis.message.addressing.EndpointReferenceType endpoint)
Creates an instance to write through a service at a given endpoint.

Parameters:
endpoint - the service endpoint
Method Detail

add

public org.gcube.data.trees.data.Tree add(org.gcube.data.trees.data.Tree doc)
                                   throws org.gcube.common.clients.DiscoveryException,
                                          InvalidTreeException,
                                          Exception
Description copied from interface: TWriterClient
Adds a Tree to the bound source.

Specified by:
add in interface TWriterClient
Parameters:
doc - 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
InvalidTreeException - if the tree cannot be added because it is invalid
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

public org.gcube.data.trees.data.Tree add(Element doc)
                                   throws org.gcube.common.clients.DiscoveryException,
                                          InvalidTreeException,
                                          Exception
Description copied from interface: TWriterClient
Adds a Tree to the bound source.

Specified by:
add in interface TWriterClient
Parameters:
doc - 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
InvalidTreeException - if the tree is invalid
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

public 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,
                                                                         Exception
Description copied from interface: TWriterClient
Adds zero or more Trees to the bound source.

Specified by:
add in interface TWriterClient
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

public org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> add(URI treeRs)
                                                                  throws org.gcube.common.clients.DiscoveryException,
                                                                         Exception
Description copied from interface: TWriterClient
Adds zero or more Trees to the bound source.

Specified by:
add in interface TWriterClient
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

public void update(org.gcube.data.trees.data.Tree doc)
            throws Exception,
                   org.gcube.common.clients.DiscoveryException,
                   InvalidTreeException,
                   UnknownTreeException
Description copied from interface: TWriterClient
Updates a tree in the bound source.

Specified by:
update in interface TWriterClient
Parameters:
doc - 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

public 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 Exception,
                                                                                   org.gcube.common.clients.DiscoveryException
Description copied from interface: TWriterClient
Updates zero or more Trees in the bound source.

Specified by:
update in interface TWriterClient
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

public org.gcube.data.streams.Stream<org.gcube.data.tm.stubs.UpdateFailure> update(URI locator)
                                                                            throws Exception,
                                                                                   org.gcube.common.clients.DiscoveryException
Description copied from interface: TWriterClient
Updates zero or more Trees in the bound source.

Specified by:
update in interface TWriterClient
Parameters:
locator - 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.