Interface ResourceImportHandler
- All Known Implementing Classes:
DefaultResourceImportHandler
public interface ResourceImportHandler
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncreateResource(String ns, String itemName, int version, Outcome outcome, boolean reset, TransactionKey transactionKey) Create resource Item from its Module definition.getCollections(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.
-
Method Details
-
getPath
Returns the DomainPath for a specific resource- Parameters:
name- - resource namens- - module namespace- Returns:
- DomainPath initialised
-
getResourceOutcome
Outcome getResourceOutcome(String name, String ns, String location, Integer version) throws InvalidDataException, ObjectNotFoundException Generate the outcome that the resource should contain.- 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
-
getWorkflowName
String getWorkflowName()Gives the CompActDef name to instantiate to provide the workflow for this type of resource. Should be found in the CA typeroot (/desc/ActivityDesc/)- Returns:
- String workflow name
-
getPropDesc
PropertyDescriptionList getPropDesc()Should 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.- Returns:
- a PropertyDescriptionList - an arraylist of PropertyDescriptions
-
getTypeRoot
DomainPath getTypeRoot()The directory context to search for existing resources. The name of the resource must be unique below this point.- Returns:
- Root DomainPath
-
getCollections
CollectionArrayList getCollections(String name, String ns, String location, Integer version, TransactionKey transactionKey) throws Exception Returns any collections that this Resource Item should contain.- 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
CollectionArrayList getCollections(String name, Integer version, Outcome outcome, TransactionKey transactionKey) throws Exception Returns any collections that this Resource Item stored in the outcome should contain.- 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
-
getName
String getName()The name of the imported resource managed by the handler- Returns:
- The name of the imported resource managed by the handler
-
createResource
DomainPath createResource(String ns, String itemName, int version, Outcome outcome, boolean reset, TransactionKey transactionKey) throws Exception Create resource Item from its Module definition. The item should not exist.- 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
DomainPath importResource(String ns, String itemName, int version, ItemPath itemPath, String dataLocation, boolean reset, TransactionKey transactionKey) throws Exception Creates or updates resource Item against a Module version, using a ResourceImportHandler configured finding the outcome at the given dataLocation.- 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
DomainPath importResource(String ns, String itemName, int version, ItemPath itemPath, Outcome outcome, boolean reset, TransactionKey transactionKey) throws Exception Verify a resource Item against a Module version, but supplies the resource outcomes directly instead of through a location lookup.- 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 resourcethe- Outcome to be used to import the- Returns:
- the DomainPath of the resource Item
- Throws:
Exception- errors that are raised during the process
-
getResourceChangeDetails
String getResourceChangeDetails()Reads the XML string that was created during the createResource() and importResource() methods- Returns:
- xml string
-
getResourceChangeStatus
ResourceImportHandler.Status getResourceChangeStatus()
-