org.ogf.saga.rpc
Class RPCFactory

java.lang.Object
  extended by org.ogf.saga.rpc.RPCFactory

public abstract class RPCFactory
extends Object

Factory for objects from the RPC package.


Constructor Summary
RPCFactory()
           
 
Method Summary
static Parameter createParameter()
          Creates an IN Parameter object.
static Parameter createParameter(IOMode mode)
          Creates a Parameter object.
static Parameter createParameter(Object data)
          Creates an IN Parameter object.
static Parameter createParameter(Object data, IOMode mode)
          Creates a Parameter object.
static Parameter createParameter(String sagaFactoryClassname)
          Creates an IN Parameter object.
static Parameter createParameter(String sagaFactoryClassname, IOMode mode)
          Creates a Parameter object.
static Parameter createParameter(String sagaFactoryClassname, Object data)
          Creates an IN Parameter object.
static Parameter createParameter(String sagaFactoryClassname, Object data, IOMode mode)
          Creates a Parameter object.
static RPC createRPC(Session session, URL funcname)
          Creates a RPC handle instance.
static RPC createRPC(String sagaFactoryClassname, Session session, URL funcname)
          Creates a RPC handle instance.
static Task<RPCFactory,RPC> createRPC(String sagaFactoryClassname, TaskMode mode, Session session, URL funcname)
          Creates a task that creates a RPC handle instance.
static Task<RPCFactory,RPC> createRPC(String sagaFactoryClassname, TaskMode mode, URL funcname)
          Creates a task that creates a RPC handle instance using the default session.
static RPC createRPC(String sagaFactoryClassname, URL funcname)
          Creates a RPC handle instance using the default session.
static Task<RPCFactory,RPC> createRPC(TaskMode mode, Session session, URL funcname)
          Creates a task that creates a RPC handle instance.
static Task<RPCFactory,RPC> createRPC(TaskMode mode, URL funcname)
          Creates a task that creates a RPC handle instance using the default session.
static RPC createRPC(URL funcname)
          Creates a RPC handle instance using the default session.
protected abstract  Parameter doCreateParameter(Object data, IOMode mode)
          Creates a Parameter object.
protected abstract  RPC doCreateRPC(Session session, URL funcname)
          Creates a RPC handle instance.
protected abstract  Task<RPCFactory,RPC> doCreateRPC(TaskMode mode, Session session, URL funcname)
          Creates a task that creates a RPC handle instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RPCFactory

public RPCFactory()
Method Detail

doCreateParameter

protected abstract Parameter doCreateParameter(Object data,
                                               IOMode mode)
                                        throws BadParameterException,
                                               NoSuccessException,
                                               NotImplementedException
Creates a Parameter object. To be provided by the implementation.

Parameters:
data - data to be used.
mode - IN, OUT, INOUT.
Returns:
the parameter.
Throws:
BadParameterException
NoSuccessException
NotImplementedException

doCreateRPC

protected abstract RPC doCreateRPC(Session session,
                                   URL funcname)
                            throws NotImplementedException,
                                   IncorrectURLException,
                                   AuthenticationFailedException,
                                   AuthorizationFailedException,
                                   PermissionDeniedException,
                                   BadParameterException,
                                   DoesNotExistException,
                                   TimeoutException,
                                   NoSuccessException
Creates a RPC handle instance. To be provided by the implementation.

Parameters:
session - the session handle.
funcname - specification of the remote procedure.
Returns:
the RPC handle instance.
Throws:
NotImplementedException
IncorrectURLException
AuthenticationFailedException
AuthorizationFailedException
PermissionDeniedException
BadParameterException
DoesNotExistException
TimeoutException
NoSuccessException

doCreateRPC

protected abstract Task<RPCFactory,RPC> doCreateRPC(TaskMode mode,
                                                    Session session,
                                                    URL funcname)
                                             throws NotImplementedException
Creates a task that creates a RPC handle instance. To be provided by the implementation.

Parameters:
mode - the task mode.
session - the session handle.
funcname - specification of the remote procedure.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.

createParameter

public static Parameter createParameter(Object data,
                                        IOMode mode)
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates a Parameter object. If the mode indicates an Out parameter, data may be null.

Parameters:
data - data to be used.
mode - IN, OUT, INOUT.
Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is thrown when the implementation cannot handle the given data object.
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createParameter

public static Parameter createParameter(String sagaFactoryClassname,
                                        Object data,
                                        IOMode mode)
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates a Parameter object. If the mode indicates an Out parameter, data may be null.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
data - data to be used.
mode - IN, OUT, INOUT.
Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is thrown when the implementation cannot handle the given data object.
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createParameter

public static Parameter createParameter(IOMode mode)
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates a Parameter object. To be provided by the implementation.

Parameters:
mode - IN, OUT, INOUT.
Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is not thrown, but this method may call a method that does throw it (although not in this case).
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createParameter

public static Parameter createParameter(String sagaFactoryClassname,
                                        IOMode mode)
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates a Parameter object. To be provided by the implementation.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
mode - IN, OUT, INOUT.
Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is not thrown, but this method may call a method that does throw it (although not in this case).
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createParameter

public static Parameter createParameter(Object data)
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates an IN Parameter object.

Parameters:
data - data to be used.
Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is thrown when the implementation cannot handle the given data object.
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createParameter

public static Parameter createParameter(String sagaFactoryClassname,
                                        Object data)
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates an IN Parameter object.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
data - data to be used.
Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is thrown when the implementation cannot handle the given data object.
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createParameter

public static Parameter createParameter()
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates an IN Parameter object.

Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is not thrown, but this method may call a method that does throw it (although not in this case).
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createParameter

public static Parameter createParameter(String sagaFactoryClassname)
                                 throws BadParameterException,
                                        NoSuccessException,
                                        NotImplementedException
Creates an IN Parameter object.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
Returns:
the parameter.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
BadParameterException - is not thrown, but this method may call a method that does throw it (although not in this case).
NoSuccessException - is thrown if the implementation cannot create valid default values based on the available information.

createRPC

public static RPC createRPC(Session session,
                            URL funcname)
                     throws NotImplementedException,
                            IncorrectURLException,
                            AuthenticationFailedException,
                            AuthorizationFailedException,
                            PermissionDeniedException,
                            BadParameterException,
                            DoesNotExistException,
                            TimeoutException,
                            NoSuccessException
Creates a RPC handle instance.

Parameters:
session - the session handle.
funcname - specification of the remote procedure.
Returns:
the RPC handle instance.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the specified URL cannot be found.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible. Note that this exception can also be thrown when actually invoking a RPC.call(Parameter...), which may be more convenient for implementations.
DoesNotExistException - is thrown if the specified function does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

createRPC

public static RPC createRPC(String sagaFactoryClassname,
                            Session session,
                            URL funcname)
                     throws NotImplementedException,
                            IncorrectURLException,
                            AuthenticationFailedException,
                            AuthorizationFailedException,
                            PermissionDeniedException,
                            BadParameterException,
                            DoesNotExistException,
                            TimeoutException,
                            NoSuccessException
Creates a RPC handle instance.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
session - the session handle.
funcname - specification of the remote procedure.
Returns:
the RPC handle instance.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the specified URL cannot be found.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible. Note that this exception can also be thrown when actually invoking a RPC.call(Parameter...), which may be more convenient for implementations.
DoesNotExistException - is thrown if the specified function does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

createRPC

public static RPC createRPC(URL funcname)
                     throws NotImplementedException,
                            IncorrectURLException,
                            AuthenticationFailedException,
                            AuthorizationFailedException,
                            PermissionDeniedException,
                            BadParameterException,
                            DoesNotExistException,
                            TimeoutException,
                            NoSuccessException
Creates a RPC handle instance using the default session.

Parameters:
funcname - specification of the remote procedure.
Returns:
the RPC handle instance.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the specified URL cannot be found.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible. Note that this exception can also be thrown when actually invoking a RPC.call(Parameter...), which may be more convenient for implementations.
DoesNotExistException - is thrown if the specified function does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

createRPC

public static RPC createRPC(String sagaFactoryClassname,
                            URL funcname)
                     throws NotImplementedException,
                            IncorrectURLException,
                            AuthenticationFailedException,
                            AuthorizationFailedException,
                            PermissionDeniedException,
                            BadParameterException,
                            DoesNotExistException,
                            TimeoutException,
                            NoSuccessException
Creates a RPC handle instance using the default session.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
funcname - specification of the remote procedure.
Returns:
the RPC handle instance.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.
PermissionDeniedException - is thrown when the method failed because the identity used did not have sufficient permissions to perform the operation successfully.
AuthorizationFailedException - is thrown when none of the available contexts of the used session could be used for successful authorization. This error indicates that the resource could not be accessed at all, and not that an operation was not available due to restricted permissions.
AuthenticationFailedException - is thrown when operation failed because none of the available session contexts could successfully be used for authentication.
TimeoutException - is thrown when a remote operation did not complete successfully because the network communication or the remote service timed out.
BadParameterException - is thrown when the specified URL cannot be found.
IncorrectURLException - is thrown if an implementation cannot handle the specified protocol, or that access to the specified entity via the given protocol is impossible. Note that this exception can also be thrown when actually invoking a RPC.call(Parameter...), which may be more convenient for implementations.
DoesNotExistException - is thrown if the specified function does not exist.
NoSuccessException - is thrown when the operation was not successfully performed, and none of the other exceptions apply.

createRPC

public static Task<RPCFactory,RPC> createRPC(TaskMode mode,
                                             Session session,
                                             URL funcname)
                                      throws NotImplementedException,
                                             NoSuccessException
Creates a task that creates a RPC handle instance.

Parameters:
mode - the task mode.
session - the session handle.
funcname - specification of the remote procedure.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.
NoSuccessException - is thrown when the Saga factory could not be created or when the default session could not be created.

createRPC

public static Task<RPCFactory,RPC> createRPC(String sagaFactoryClassname,
                                             TaskMode mode,
                                             Session session,
                                             URL funcname)
                                      throws NotImplementedException,
                                             NoSuccessException
Creates a task that creates a RPC handle instance.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
mode - the task mode.
session - the session handle.
funcname - specification of the remote procedure.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.
NoSuccessException - is thrown when the Saga factory could not be created or when the default session could not be created.

createRPC

public static Task<RPCFactory,RPC> createRPC(TaskMode mode,
                                             URL funcname)
                                      throws NotImplementedException,
                                             NoSuccessException
Creates a task that creates a RPC handle instance using the default session.

Parameters:
mode - the task mode.
funcname - specification of the remote procedure.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.
NoSuccessException - is thrown when the Saga factory could not be created or when the default session could not be created.

createRPC

public static Task<RPCFactory,RPC> createRPC(String sagaFactoryClassname,
                                             TaskMode mode,
                                             URL funcname)
                                      throws NotImplementedException,
                                             NoSuccessException
Creates a task that creates a RPC handle instance using the default session.

Parameters:
sagaFactoryClassname - the class name of the Saga factory to be used.
mode - the task mode.
funcname - specification of the remote procedure.
Returns:
the task.
Throws:
NotImplementedException - is thrown when the task version of this method is not implemented.
NoSuccessException - is thrown when the Saga factory could not be created or when the default session could not be created.


Copyright © 2014 Open Grid Forum. All rights reserved.