org.gcube.data.tm.state
Class TWriterResource

java.lang.Object
  extended by org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl
      extended by org.gcube.common.core.state.GCUBEStatefulResource<org.gcube.common.core.state.GCUBEWSResourceKey>
          extended by org.gcube.common.core.state.GCUBEWSResource
              extended by org.gcube.common.core.state.GCUBEWSLiteResource<SourceResource>
                  extended by org.gcube.data.tm.state.AccessorResource
                      extended by org.gcube.data.tm.state.TWriterResource
All Implemented Interfaces:
org.gcube.common.core.utils.handlers.GCUBEServiceClient, org.gcube.data.tmf.api.SourceConsumer, org.globus.wsrf.PersistenceCallback, org.globus.wsrf.Resource, org.globus.wsrf.ResourceLifetime, org.globus.wsrf.ResourceProperties, org.globus.wsrf.TopicListAccessor

public final class TWriterResource
extends AccessorResource

A AccessorResource for write-only operations over a SourceResource.

Author:
Fabio Simeoni

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.common.core.state.GCUBEStatefulResource
org.gcube.common.core.state.GCUBEStatefulResource.LOCK, org.gcube.common.core.state.GCUBEStatefulResource.TaskContext
 
Field Summary
 
Fields inherited from class org.gcube.data.tm.state.AccessorResource
PART_SIZE
 
Fields inherited from class org.gcube.common.core.state.GCUBEStatefulResource
logger, uuidGen
 
Constructor Summary
TWriterResource()
           
 
Method Summary
 org.gcube.data.streams.Stream<org.gcube.data.tml.outcomes.AddTreeOutcome> add(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> treeStream)
          Adds many Trees to the source and returns the corresponding AddTreeOutcomes.
 org.gcube.data.trees.data.Tree add(org.gcube.data.trees.data.Tree tree)
          Adds a Tree to the source.
 org.gcube.data.streams.Stream<org.gcube.data.tml.outcomes.UpdateTreeFailure> update(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> deltaStream)
          Updates many Trees in the source from the delta trees that capture their changes.
 void update(org.gcube.data.trees.data.Tree delta)
          Updates a tree in the source from the delta tree that captures the changes.
 
Methods inherited from class org.gcube.data.tm.state.AccessorResource
getCardinality, getLastUpdate, getName, getPlugin, getProperty, getPropertyNames, getSourceId, getType, initialise, initialiseContainers, onEvent, subscribeForChange
 
Methods inherited from class org.gcube.common.core.state.GCUBEWSLiteResource
getLocalID, getLocalResource, getProperty, initialise, onRemove, setLocalID, transformParams
 
Methods inherited from class org.gcube.common.core.state.GCUBEWSResource
getCurrentTime, getEPR, getPorttypeContext, getPublisher, getResourcePropertySet, getServiceContext, getTerminationTime, getTopicList, getTopicNames, inScope, load, publish, setPortTypeContext, setTerminationTime, unpublish
 
Methods inherited from class org.gcube.common.core.state.GCUBEStatefulResource
getID, getLock, getScheduledTasks, getScope, launchTask, setID, setPersistenceDelegate, stopTask, store
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl
getPortTypeMap, setPortTypeMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.wsrf.PersistenceCallback
store
 

Constructor Detail

TWriterResource

public TWriterResource()
Method Detail

add

public org.gcube.data.trees.data.Tree add(org.gcube.data.trees.data.Tree tree)
                                   throws org.gcube.data.tml.exceptions.UnsupportedOperationException,
                                          org.gcube.data.tml.exceptions.UnsupportedRequestException,
                                          org.gcube.data.tml.exceptions.InvalidTreeException,
                                          Exception
Adds a Tree to the source.

Parameters:
tree - the tree
Returns:
the input tree, possibly annotated with metadata added at the time of addition.
Throws:
org.gcube.data.tml.exceptions.UnsupportedOperationException - if the target plugin does not support this operation
org.gcube.data.tml.exceptions.UnsupportedRequestException - if the target plugin does not support this particular request
org.gcube.data.tml.exceptions.InvalidTreeException - if the tree is invalid for addition
Exception - if the operation fails for any other problem

add

public org.gcube.data.streams.Stream<org.gcube.data.tml.outcomes.AddTreeOutcome> add(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> treeStream)
                                                                              throws org.gcube.data.tml.exceptions.UnsupportedOperationException,
                                                                                     org.gcube.data.tml.exceptions.UnsupportedRequestException,
                                                                                     Exception
Adds many Trees to the source and returns the corresponding AddTreeOutcomes.

Parameters:
treeStream - the trees
Returns:
the outcomes
Throws:
org.gcube.data.tml.exceptions.UnsupportedOperationException - if the target plugin does not support this operation
org.gcube.data.tml.exceptions.UnsupportedRequestException - if the target plugin does not support this particular request
org.gcube.common.core.faults.GCUBEException - if the outcomes could not be returned
Exception

update

public void update(org.gcube.data.trees.data.Tree delta)
            throws org.gcube.data.tml.exceptions.UnsupportedOperationException,
                   org.gcube.data.tml.exceptions.UnsupportedRequestException,
                   org.gcube.data.tml.exceptions.UnknownTreeException,
                   org.gcube.data.tml.exceptions.InvalidTreeException,
                   Exception
Updates a tree in the source from the delta tree that captures the changes.

Parameters:
delta - the tree delta.
Throws:
org.gcube.data.tml.exceptions.UnsupportedOperationException - if the target plugin does not support this operation
org.gcube.data.tml.exceptions.UnsupportedRequestException - if the target plugin does not support this particular request
org.gcube.data.tml.exceptions.UnknownTreeException - if the delta tree does not identify a tree in the source
org.gcube.data.tml.exceptions.InvalidTreeException - if the delta tree does now qualify for update
Exception - if the operation fails for any other problem

update

public org.gcube.data.streams.Stream<org.gcube.data.tml.outcomes.UpdateTreeFailure> update(org.gcube.data.streams.Stream<org.gcube.data.trees.data.Tree> deltaStream)
                                                                                    throws org.gcube.data.tml.exceptions.UnsupportedOperationException,
                                                                                           org.gcube.data.tml.exceptions.UnsupportedRequestException,
                                                                                           Exception
Updates many Trees in the source from the delta trees that capture their changes. It returns the failures that may occur in the process.

Parameters:
deltaStream - the delta trees
Returns:
the failures
Throws:
org.gcube.data.tml.exceptions.UnsupportedOperationException - if the target plugin does not support this operation
org.gcube.data.tml.exceptions.UnsupportedRequestException - if the target plugin does not support this particular request
org.gcube.common.core.faults.GCUBEException - if the locator of a result set of update failures cannot be returned.
Exception


Copyright © 2012. All Rights Reserved.