org.gcube.vremanagement.executor.stubs
Class TaskCall

java.lang.Object
  extended by org.gcube.common.core.utils.calls.GCUBECall<org.gcube.common.core.informationsystem.client.queries.WSResourceQuery>
      extended by org.gcube.common.core.utils.calls.WSCall
          extended by org.gcube.vremanagement.executor.stubs.BaseCall
              extended by org.gcube.vremanagement.executor.stubs.TaskCall

public class TaskCall
extends BaseCall

A high-level call for interacting with a running task. The call can return local proxies to the remote task, subscribe monitors to its key changes, and stop its execution.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.common.core.utils.calls.WSCall
org.gcube.common.core.utils.calls.WSCall.WSCallHandler
 
Nested classes/interfaces inherited from class org.gcube.common.core.utils.calls.GCUBECall
org.gcube.common.core.utils.calls.GCUBECall.ResultHolder<RESULT>
 
Field Summary
 
Fields inherited from class org.gcube.vremanagement.executor.stubs.BaseCall
mappings, properties, taskName
 
Fields inherited from class org.gcube.common.core.utils.calls.GCUBECall
clients
 
Constructor Summary
TaskCall(org.apache.axis.message.addressing.EndpointReferenceType epr, org.gcube.common.core.scope.GCUBEScope scope, org.gcube.common.core.security.GCUBESecurityManager... securityManager)
          Creates an instance for a task at a given endpoint and in a given scope, optionally using a security manager.
TaskCall(String taskName, org.gcube.common.core.scope.GCUBEScope scope, org.gcube.common.core.security.GCUBESecurityManager... securityManager)
          Creates an instance for a task with a given name and in a given scope, optionally using a security manager.
 
Method Summary
protected  String getPortTypeName()
          
 TaskProxy getProxy()
          Returns a proxy for the remote task.
 void setEndpointReference(org.apache.axis.message.addressing.EndpointReferenceType epr)
           
 void stop()
          Stops the task.
 void subscribe(TaskMonitor monitor)
          Subscribes a monitor for changes to the task.
 
Methods inherited from class org.gcube.vremanagement.executor.stubs.BaseCall
getQuery, getServiceClass, getServiceName, setQuery, setTaskProperty
 
Methods inherited from class org.gcube.common.core.utils.calls.WSCall
getInitQuery
 
Methods inherited from class org.gcube.common.core.utils.calls.GCUBECall
findPortType, getEndpointReference, getLogger, getRIQuery, getScopeManager, getSecurityManager, setLogger, setScopeManager, setSecurityManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskCall

public TaskCall(String taskName,
                org.gcube.common.core.scope.GCUBEScope scope,
                org.gcube.common.core.security.GCUBESecurityManager... securityManager)
         throws Exception
Creates an instance for a task with a given name and in a given scope, optionally using a security manager.

Parameters:
taskName - the name of the task.
scope - the scope.
securityManager - (optional) the security manager.
Throws:
Exception - if the instance could not be created.

TaskCall

public TaskCall(org.apache.axis.message.addressing.EndpointReferenceType epr,
                org.gcube.common.core.scope.GCUBEScope scope,
                org.gcube.common.core.security.GCUBESecurityManager... securityManager)
         throws Exception
Creates an instance for a task at a given endpoint and in a given scope, optionally using a security manager.

Parameters:
epr - the endpoint.
scope - the scope.
securityManager - (optional) the security manager.
Throws:
Exception - if the instance could not be created.
Method Detail

getPortTypeName

protected String getPortTypeName()

Specified by:
getPortTypeName in class org.gcube.common.core.utils.calls.GCUBECall<org.gcube.common.core.informationsystem.client.queries.WSResourceQuery>

stop

public void stop()
          throws Exception,
                 org.gcube.common.core.faults.GCUBEUnrecoverableException,
                 org.gcube.common.core.faults.GCUBERetrySameException
Stops the task.

Throws:
Exception - if the call failed due to a local error.
org.gcube.common.core.faults.GCUBEUnrecoverableException - if the task does not support this call. * @throws GCUBERetrySameException if the task could not be stopped.
org.gcube.common.core.faults.GCUBERetrySameException

setEndpointReference

public void setEndpointReference(org.apache.axis.message.addressing.EndpointReferenceType epr)
Overrides:
setEndpointReference in class org.gcube.common.core.utils.calls.GCUBECall<org.gcube.common.core.informationsystem.client.queries.WSResourceQuery>

getProxy

public TaskProxy getProxy()
                   throws Exception
Returns a proxy for the remote task.

Returns:
the proxy.
Throws:
Exception - if the proxy could not be returned.

subscribe

public void subscribe(TaskMonitor monitor)
               throws Exception
Subscribes a monitor for changes to the task. The call is then synchronised to compensate for state changes that may have occurred prior or during subscription.

Parameters:
monitor - the monitor.
Throws:
Exception - if the monitor could not be subscribed.


Copyright © 2013. All Rights Reserved.