|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.ogsadai.activity.ActivityBase
uk.org.ogsadai.activity.MatchedIterativeActivity
uk.org.ogsadai.activity.management.CreateRelationalResourceActivity
public class CreateRelationalResourceActivity
An activity that creates a relational data resource based upon a resource template available on the server. This is not intended for production use but rather to demonstrate one way in which dynamic resource creation can be supported in OGSA-DAI.
Activity inputs:
resourceId.. Type: String. The
ID for the new resource. This is an optional input. If omitted then
the server will generate a new unique ID. If provided then the
value must be parsable into a valid
ResourceID and must not already be assigned
to a server-side resource.
templateId. Type: String. The ID
for the server-side resource template to use as a basis for the new
resource. This is an optional input. If omitted then the server
will use the default template ID specified as part of the activity
configuration. If provided then the value must be parsable into a
valid ResourceID.
Activity outputs:
result. Type: String. ID of the
new resource. This will be parsable into a
ResourceID.
Configuration parameters:
dai.template.id This must hold the ID of a resource
template deployed server-side. Furthermore this resource template
must specify the data resource implementation class
uk.org.ogsadai.resource.dataresource.jdbc.JDBCDataResource.
Activity input/output ordering: none.
Activity contracts: none.
Target data resource: none.
Behaviour:
JDBCDataResource. If there is a
creation problem or the check fails then a server-side error is
logged.
ManageableLoginProvider.
| Field Summary | |
|---|---|
static java.lang.String |
INPUT_ID
Activity input name ( resourceId)
- ID of the new resource to create (String). |
static java.lang.String |
INPUT_TEMPLATE_ID
Activity input name ( templateId)
- ID of the resource template (String). |
static java.lang.String |
RESULT
Activity output name ( result)
- ID of the newly created resource (String). |
static Key |
TEMPLATE_ID
Key into activities configuration file denoting the default template resource ID ( dai.template.id). |
| Fields inherited from class uk.org.ogsadai.activity.ActivityBase |
|---|
mContracts |
| Constructor Summary | |
|---|---|
CreateRelationalResourceActivity()
|
|
| Method Summary | |
|---|---|
void |
configureActivity(KeyValueProperties properties)
Configures the activity with a property set. |
protected JDBCDataResource |
createResource(ResourceID templateID)
Use the resource factory to create a new resource from the specified template. |
protected ActivityInput[] |
getIterationInputs()
Gets the iteration inputs. |
protected Login |
getLogin(ResourceID templateID,
LoginProvider loginProvider,
SecurityContext context)
Get login for the template resource. |
protected LoginProvider |
getLoginProvider(JDBCDataResourceState state)
Get the login provider for the new resource. |
protected void |
postprocess()
Performs any post-processing required after the iterative part of the activity processing has completed. |
protected void |
preprocess()
Performs any pre-processing required before the iterative part of the activity processing commences. |
protected void |
processIteration(java.lang.Object[] iterationData)
Performs an iteration of the activity processing. |
void |
setResourceFactory(ResourceFactory resourceFactory)
Sets the resource factory. |
void |
setResourceManager(ResourceManager resourceManager)
Sets the resource manager. |
void |
setSecurityContext(SecurityContext context)
Sets the security context of the user processing the activity. |
protected void |
updateLogin(ResourceID resourceID,
LoginProvider loginProvider,
Login login,
SecurityContext context)
Add the given login as a login for the new resource associated with the given security context. |
| Methods inherited from class uk.org.ogsadai.activity.MatchedIterativeActivity |
|---|
cleanUp, iterativeStageComplete, process |
| Methods inherited from class uk.org.ogsadai.activity.ActivityBase |
|---|
addInput, addOutput, close, closeDueToError, getActivityContracts, getActivityDescriptor, getInput, getInput, getInputs, getOutput, getOutput, getOutputs, hasInput, hasOutput, removeInput, setActivityDescriptor, toString, validateInput, validateInputs, validateOutput, validateOutputs |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface uk.org.ogsadai.activity.Activity |
|---|
addInput, addOutput, getActivityContracts, getActivityDescriptor, process, setActivityDescriptor |
| Field Detail |
|---|
public static final Key TEMPLATE_ID
dai.template.id).
public static final java.lang.String INPUT_ID
resourceId)
- ID of the new resource to create (String).
public static final java.lang.String INPUT_TEMPLATE_ID
templateId)
- ID of the resource template (String).
public static final java.lang.String RESULT
result)
- ID of the newly created resource (String).
| Constructor Detail |
|---|
public CreateRelationalResourceActivity()
| Method Detail |
|---|
public void setResourceManager(ResourceManager resourceManager)
setResourceManager in interface ResourceManagerActivityresourceManager - Resource managerpublic void setResourceFactory(ResourceFactory resourceFactory)
setResourceFactory in interface ResourceFactoryActivityresourceFactory - resource factoryprotected ActivityInput[] getIterationInputs()
getIterationInputs in class MatchedIterativeActivityActivityInput objects
protected void preprocess()
throws ActivityUserException,
ActivityProcessingException,
ActivityTerminatedException
preprocess in class MatchedIterativeActivityActivityUserException - if the settings specified by the user prevent processing from
completing
ActivityProcessingException - if an internal error prevents processing from completing
ActivityTerminatedException - if activity processing is terminated at an intermediate
stage
protected void processIteration(java.lang.Object[] iterationData)
throws ActivityProcessingException,
ActivityTerminatedException,
ActivityUserException
processIteration in class MatchedIterativeActivityiterationData - the data from this iteration
ActivityProcessingException - if an internal error prevents processing from completing
ActivityTerminatedException - if activity processing is terminated at an intermediate stage
ActivityUserException - if the settings specified by the user prevent processing from
completing
protected void postprocess()
throws ActivityUserException,
ActivityProcessingException,
ActivityTerminatedException
postprocess in class MatchedIterativeActivityActivityUserException - if the settings specified by the user prevent processing from
completing
ActivityProcessingException - if an internal error prevents processing from completing
ActivityTerminatedException - if activity processing is terminated at an intermediate stage
protected JDBCDataResource createResource(ResourceID templateID)
throws java.lang.Exception
templateID - Resource template ID.
java.lang.Exception - If:
ResourceUnknownException), orResourceCreationException), or ResourceTypeException),
orDAIClassMissingInterfaceException)
protected LoginProvider getLoginProvider(JDBCDataResourceState state)
throws java.lang.Exception
state - New resource state.
java.lang.Exception - If the server deployer didn't specify a login provider
for the template (and so for this) resource. This exception
will be one of ConfigurationValueMissingException
or ConfigurationValueIllegalException.
protected Login getLogin(ResourceID templateID,
LoginProvider loginProvider,
SecurityContext context)
throws java.lang.Exception
templateID - Template resource ID.loginProvider - Login provider for both template resource and new resource.context - Security context to use to get login.
java.lang.Exception - If:
ResourceUnknownException), orLoginDeniedException), orLoginProviderException) or, LoginProviderException).
protected void updateLogin(ResourceID resourceID,
LoginProvider loginProvider,
Login login,
SecurityContext context)
throws java.lang.Exception
getLogin this basically allows the login information
for the template resource (under the conditions of a specific
security context) to be used for the new resource.
resourceID - Resource ID.loginProvider - Login provider for both template resource and new resource.login - Login for the new resource - inherited from the template
resourcecontext - Security context associated with this login.
java.lang.Exception - If:
LoginProviderException) or, LoginProviderException), orManageableLoginProvider and so cannot be
updated (DAIClassMissingInterfaceException)public void configureActivity(KeyValueProperties properties)
dai.template.id and attempts
to parse into a uk.org.ogsadai.resource.ResourceID.
configureActivity in interface ConfigurableActivityproperties - Activity configuration properties.public void setSecurityContext(SecurityContext context)
setSecurityContext in interface SecureActivitycontext - security context
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||