Class DefaultResourceImportHandler
java.lang.Object
org.cristalise.kernel.process.resource.DefaultResourceImportHandler
- All Implemented Interfaces:
ResourceImportHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cristalise.kernel.process.resource.ResourceImportHandler
ResourceImportHandler.Status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateResource(String ns, String itemName, int version, Outcome outcome, boolean reset, TransactionKey transactionKey) Methods migrated from BootstrapgetCollections(String name, Integer version, Outcome outcome, TransactionKey transactionKey) Returns any collections that this Resource Item stored in the outcome should contain.getCollections(String name, String ns, String location, Integer version, TransactionKey transactionKey) Returns any collections that this Resource Item should contain.getName()The name of the imported resource managed by the handlerReturns the DomainPath for a specific resourceShould return all of the Properties the resource Item will have on creation.Reads the XML string that was created during the createResource() and importResource() methodsgetResourceOutcome(String name, String ns, String location, Integer version) Generate the outcome that the resource should contain.The directory context to search for existing resources.Gives the CompActDef name to instantiate to provide the workflow for this type of resource.importResource(String ns, String itemName, int version, ItemPath itemPath, String dataLocation, boolean reset, TransactionKey transactionKey) Creates or updates resource Item against a Module version, using a ResourceImportHandler configured finding the outcome at the given dataLocation.importResource(String ns, String itemName, int version, ItemPath itemPath, Outcome outcome, boolean reset, TransactionKey transactionKey) Verify a resource Item against a Module version, but supplies the resource outcomes directly instead of through a location lookup.
-
Constructor Details
-
Method Details
-
getCollections
public CollectionArrayList getCollections(String name, String ns, String location, Integer version, TransactionKey transactionKey) throws Exception Description copied from interface:ResourceImportHandlerReturns any collections that this Resource Item should contain.- Specified by:
getCollectionsin interfaceResourceImportHandler- Parameters:
name- the name of the Resource Itemns- the namaspace of the module declaring the Resource Itemlocation- the location of the XML file on the boot directoryversion- the version of the Resource Item- Returns:
- CollectionArrayList
- Throws:
Exception- something went wrong
-
getCollections
public CollectionArrayList getCollections(String name, Integer version, Outcome outcome, TransactionKey transactionKey) throws Exception Description copied from interface:ResourceImportHandlerReturns any collections that this Resource Item stored in the outcome should contain.- Specified by:
getCollectionsin interfaceResourceImportHandler- Parameters:
name- the name of the Resource Itemversion- the version of the Resource Itemoutcome- Outcome containing the XML representing the Resource Item- Returns:
- CollectionArrayList
- Throws:
Exception- something went wrong
-
getTypeRoot
Description copied from interface:ResourceImportHandlerThe directory context to search for existing resources. The name of the resource must be unique below this point.- Specified by:
getTypeRootin interfaceResourceImportHandler- Returns:
- Root DomainPath
-
getName
Description copied from interface:ResourceImportHandlerThe name of the imported resource managed by the handler- Specified by:
getNamein interfaceResourceImportHandler- Returns:
- The name of the imported resource managed by the handler
-
getPath
Description copied from interface:ResourceImportHandlerReturns the DomainPath for a specific resource- Specified by:
getPathin interfaceResourceImportHandler- Parameters:
name- - resource namens- - module namespace- Returns:
- DomainPath initialised
-
getResourceOutcome
public Outcome getResourceOutcome(String name, String ns, String location, Integer version) throws InvalidDataException, ObjectNotFoundException Description copied from interface:ResourceImportHandlerGenerate the outcome that the resource should contain.- Specified by:
getResourceOutcomein interfaceResourceImportHandler- Parameters:
name- the name of the resourcens- the namespace defined in the modulelocation- the location of the resource fileversion- the specified version- Returns:
- a set of outcomes to be synced with the resource item.
- Throws:
InvalidDataException- - if the supplied resources are not validObjectNotFoundException- - data was not found to handle request
-
getPropDesc
Description copied from interface:ResourceImportHandlerShould return all of the Properties the resource Item will have on creation. The Property 'Name' will be created and populated automatically, even if not declared.- Specified by:
getPropDescin interfaceResourceImportHandler- Returns:
- a PropertyDescriptionList - an arraylist of PropertyDescriptions
-
getWorkflowName
Description copied from interface:ResourceImportHandlerGives the CompActDef name to instantiate to provide the workflow for this type of resource. Should be found in the CA typeroot (/desc/ActivityDesc/)- Specified by:
getWorkflowNamein interfaceResourceImportHandler- Returns:
- String workflow name
-
createResource
public DomainPath createResource(String ns, String itemName, int version, Outcome outcome, boolean reset, TransactionKey transactionKey) throws Exception Methods migrated from Bootstrap- Specified by:
createResourcein interfaceResourceImportHandler- Parameters:
ns- the NameSpace of the ModuleitemName- name of the resource Itemversion- version of the resource Itemoutcome- the Outcome to be used to create the resourcereset- whether the resources shall be updated even if the current version was modified by someone other than the bootstrapper. Use system property 'Module.reset' or 'Module.${namespace}.reset' to control if bootstrap should overwrite the resource- Returns:
- the DomainPath of the resource Item
- Throws:
Exception- errors that are raised during the process
-
importResource
public DomainPath importResource(String ns, String itemName, int version, ItemPath itemPath, String dataLocation, boolean reset, TransactionKey transactionKey) throws Exception Description copied from interface:ResourceImportHandlerCreates or updates resource Item against a Module version, using a ResourceImportHandler configured finding the outcome at the given dataLocation.- Specified by:
importResourcein interfaceResourceImportHandler- Parameters:
ns- the NameSpace of the ModuleitemName- name of the resource Itemversion- version of the resource ItemitemPath- the fixed UUID of the ItemdataLocation- the location of the resource xml available from the classpath to be used as Outcomereset- whether the resources shall be updated even if the current version was modified by someone other than the bootstrapper. Use system property 'Module.reset' or 'Module.${namespace}.reset' to control if bootstrap should overwrite the resource- Returns:
- the DomainPath of the resource Item
- Throws:
Exception- errors that are raised during the process
-
importResource
public DomainPath importResource(String ns, String itemName, int version, ItemPath itemPath, Outcome outcome, boolean reset, TransactionKey transactionKey) throws Exception Description copied from interface:ResourceImportHandlerVerify a resource Item against a Module version, but supplies the resource outcomes directly instead of through a location lookup.- Specified by:
importResourcein interfaceResourceImportHandler- Parameters:
ns- the NameSpace of the ModuleitemName- name of the resource Itemversion- version of the resource ItemitemPath- the fixed UUID of the Itemreset- whether the resources shall be updated even if the current version was modified by someone other than the bootstrapper. Use system property 'Module.reset' or 'Module.${namespace}.reset' to control if bootstrap should overwrite the resource- Returns:
- the DomainPath of the resource Item
- Throws:
Exception- errors that are raised during the process
-
getResourceChangeDetails
Description copied from interface:ResourceImportHandlerReads the XML string that was created during the createResource() and importResource() methods- Specified by:
getResourceChangeDetailsin interfaceResourceImportHandler- Returns:
- xml string
-
getResourceChangeStatus
- Specified by:
getResourceChangeStatusin interfaceResourceImportHandler
-