org.gcube.common.core.utils.calls
Class GCUBECall<QUERY extends ISQuery<?>>

java.lang.Object
  extended by org.gcube.common.core.utils.calls.GCUBECall<QUERY>
Direct Known Subclasses:
RICall, WSCall

public abstract class GCUBECall<QUERY extends ISQuery<?>>
extends Object

Partial implementation for calls to port-types of gCube services.

The call subsumes the best-effort interaction strategy of a GCUBEServiceHandler. Equally, it may target a port-type at a known endpoint. Call scope must be specified at creation time, with a GCUBEScope or via a GCUBEScopeManager. Security may be specified at creation via a GCUBESecurityManager.

Author:
Fabio Simeoni (University of Strathclyde)

Nested Class Summary
static class GCUBECall.ResultHolder<RESULT>
          Convenience holder for exporting invocation results from within anonymous specialisation of
 
Field Summary
protected static Map<Class<?>,GCUBEServiceClientImpl> clients
           
protected  GCUBELog logger
          Object logger.
 
Constructor Summary
GCUBECall(GCUBEScope scope, GCUBESecurityManager... securityManager)
          Creates an instance with a scope and a security manager.
GCUBECall(GCUBEScopeManager scopeManager, GCUBESecurityManager... securityManager)
          Creates an instance with a scope manager and a security manager.
GCUBECall(GCUBEServiceContext ctxt)
          Creates an instance with a service context.
 
Method Summary
protected  List<org.apache.axis.message.addressing.EndpointReferenceType> findPortType(GCUBERIQuery query, String portType)
          Helper method that executes a given query to return a list of references to endpoints of a given port-type.
 org.apache.axis.message.addressing.EndpointReferenceType getEndpointReference()
          Returns the target endpoint.
protected abstract  QUERY getInitQuery()
          Returns the initial query for the best-effort strategy.
 GCUBELog getLogger()
          Returns the call's logger.
protected abstract  String getPortTypeName()
          Returns the name of the target port-type.
 QUERY getQuery()
          Returns the query for the best-effort strategy.
protected  GCUBERIQuery getRIQuery()
          Helper method that returns a query for Running Instances of the service of the target port-type.
 GCUBEScopeManager getScopeManager()
          Returns the scope manager used for the call.
 GCUBESecurityManager getSecurityManager()
          Returns the security manager used for the call.
protected abstract  String getServiceClass()
          Returns the class of the service of the target port-type.
protected abstract  String getServiceName()
          Returns the name of the service of the target port-type.
 void setEndpointReference(org.apache.axis.message.addressing.EndpointReferenceType epr)
          Sets the target endpoint.
 void setLogger(GCUBELog logger)
          Sets the call's logger.
 void setQuery(QUERY query)
          Set the query for the best-effort strategy.
 void setScopeManager(GCUBEScopeManager scopeManager)
          Sets the scope manager used for the call.
 void setSecurityManager(GCUBESecurityManager securityManager)
          Sets the security manager used for the call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clients

protected static Map<Class<?>,GCUBEServiceClientImpl> clients

logger

protected GCUBELog logger
Object logger.

Constructor Detail

GCUBECall

public GCUBECall(GCUBEScopeManager scopeManager,
                 GCUBESecurityManager... securityManager)
          throws Exception
Creates an instance with a scope manager and a security manager.

Parameters:
scopeManager - the scope manager.
securityManager - the security manager.
Throws:
Exception - if the instance could not be created.

GCUBECall

public GCUBECall(GCUBEScope scope,
                 GCUBESecurityManager... securityManager)
          throws Exception
Creates an instance with a scope and a security manager.

Parameters:
scope - the scope.
securityManager - the security manager.
Throws:
Exception - if the instance could not be created.

GCUBECall

public GCUBECall(GCUBEServiceContext ctxt)
          throws Exception
Creates an instance with a service context.

Parameters:
ctxt - the context.
Throws:
Exception - if the instance could not be created.
Method Detail

setLogger

public void setLogger(GCUBELog logger)
Sets the call's logger.

Parameters:
logger - the logger.

getLogger

public GCUBELog getLogger()
Returns the call's logger.

Returns:
the logger.

getPortTypeName

protected abstract String getPortTypeName()
Returns the name of the target port-type.

Returns:
the name.

getServiceName

protected abstract String getServiceName()
Returns the name of the service of the target port-type.

Returns:
the name.

getServiceClass

protected abstract String getServiceClass()
Returns the class of the service of the target port-type.

Returns:
the name.

getSecurityManager

public GCUBESecurityManager getSecurityManager()
Returns the security manager used for the call.

Returns:
the security manager.

setSecurityManager

public void setSecurityManager(GCUBESecurityManager securityManager)
Sets the security manager used for the call.

Parameters:
securityManager - the security manager.

getScopeManager

public GCUBEScopeManager getScopeManager()
Returns the scope manager used for the call.

Returns:
the scope manager.

setScopeManager

public void setScopeManager(GCUBEScopeManager scopeManager)
Sets the scope manager used for the call.

Parameters:
scopeManager - the scope manager.

setQuery

public void setQuery(QUERY query)
Set the query for the best-effort strategy.

Parameters:
query - the query.

getQuery

public QUERY getQuery()
Returns the query for the best-effort strategy.

Returns:
the query.

getInitQuery

protected abstract QUERY getInitQuery()
                                                  throws Exception
Returns the initial query for the best-effort strategy.

Returns:
the query.
Throws:
Exception - if the query could not be returned (typically because it could not be built).

setEndpointReference

public void setEndpointReference(org.apache.axis.message.addressing.EndpointReferenceType epr)
Sets the target endpoint.

Parameters:
epr - a reference to the endpoint.

getEndpointReference

public org.apache.axis.message.addressing.EndpointReferenceType getEndpointReference()
Returns the target endpoint.

Returns:
a reference to the endpoint.

getRIQuery

protected GCUBERIQuery getRIQuery()
                           throws Exception
Helper method that returns a query for Running Instances of the service of the target port-type.

Returns:
the query.
Throws:
Exception - if the query could not returned.

findPortType

protected List<org.apache.axis.message.addressing.EndpointReferenceType> findPortType(GCUBERIQuery query,
                                                                                      String portType)
                                                                               throws Exception
Helper method that executes a given query to return a list of references to endpoints of a given port-type.

Parameters:
query - the query.
portType - the port-type name.
Returns:
the references.
Throws:
Exception - if the query could not returned.


Copyright © 2013. All Rights Reserved.