com.ibm.portal.resolver.operations
Interface OperationFactory

All Known Subinterfaces:
SafeOperationFactory, UnsafeOperationFactory

public interface OperationFactory

A generic factory for operations.

Operation factories can be registered using the extension point OperationFactory.EXTENSION_POINT_ID. Operation factory implementations must provide a 0-arg constructor.

Only use this plug point if your operation factory implementation needs to decide dynamically (based on the given request context) if a SafeOperation or UnsafeOperation object is to be created. If you know the type of your operation a priori, it is strongly recommended to use one of the specific plug points that are defined in SafeOperationFactory or UnsafeOperationFactory respectively.

Since:
8.0

Field Summary
static java.lang.String EXTENSION_POINT_ID
          Extension point to plug in a custom factory for operations.
 
Method Summary
 Operation newOperation(java.net.URI resourceURI, java.util.Map<java.lang.String,java.lang.String[]> operationParams, java.util.Map<java.lang.String,java.lang.String[]> requestParams, Context context)
          Creates a new operation for the given context.
 OperationURI newOperationURI()
          Creates a OperationURI object which addresses the operation this OperationFactory is responsible for.
 OperationURI newOperationURI(java.util.Map<java.lang.String,java.lang.String[]> arguments)
          Creates a OperationURI object which addresses the operation this OperationFactory is responsible for.
 OperationURI newOperationURI(java.net.URI resourceURI, java.util.Map<java.lang.String,java.lang.String[]> arguments)
          Creates a OperationURI object which addresses the operation this OperationFactory is responsible for.
 

Field Detail

EXTENSION_POINT_ID

static final java.lang.String EXTENSION_POINT_ID
Extension point to plug in a custom factory for operations.

Method Detail

newOperationURI

OperationURI newOperationURI(java.net.URI resourceURI,
                             java.util.Map<java.lang.String,java.lang.String[]> arguments)
                             throws java.net.URISyntaxException,
                                    java.io.IOException
Creates a OperationURI object which addresses the operation this OperationFactory is responsible for.

Parameters:
resourceURI - The URI of the resource the operation should be applied to. Must not be null.
arguments - Map keeping the operation arguments that should be passed to the operation at execution time. Must not be null .
Returns:
A OperationURI object which addresses the operation.
Throws:
java.net.URISyntaxException
java.io.IOException

newOperationURI

OperationURI newOperationURI(java.util.Map<java.lang.String,java.lang.String[]> arguments)
                             throws java.net.URISyntaxException,
                                    java.io.IOException
Creates a OperationURI object which addresses the operation this OperationFactory is responsible for.

Parameters:
arguments - Map keeping the operation arguments that should be passed to the operation at execution time. Must not be null .
Returns:
A OperationURI object which addresses the operation.
Throws:
java.net.URISyntaxException
java.io.IOException

newOperationURI

OperationURI newOperationURI()
                             throws java.net.URISyntaxException,
                                    java.io.IOException
Creates a OperationURI object which addresses the operation this OperationFactory is responsible for.

Returns:
A OperationURI object which addresses the operation.
Throws:
java.net.URISyntaxException
java.io.IOException

newOperation

Operation newOperation(java.net.URI resourceURI,
                       java.util.Map<java.lang.String,java.lang.String[]> operationParams,
                       java.util.Map<java.lang.String,java.lang.String[]> requestParams,
                       Context context)
                       throws CannotCreateOperationException
Creates a new operation for the given context.

Parameters:
resourceURI - The URI of the resource the operation should be applied to. May be null.
operationParams - The parameters of the operation that were part of the operation URI. Must not be null.
requestParams - The request parameters. Must not be null.
context - The current runtime context. Must not be null.
Returns:
A SafeOperation object. Never null.
Throws:
CannotCreateOperationException