Interface ResourceImportHandler

All Known Implementing Classes:
DefaultResourceImportHandler

public interface ResourceImportHandler
  • Method Details

    • getPath

      DomainPath getPath(String name, String ns)
      Returns the DomainPath for a specific resource
      Parameters:
      name - - resource name
      ns - - 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 resource
      ns - the namespace defined in the module
      location - the location of the resource file
      version - the specified version
      Returns:
      a set of outcomes to be synced with the resource item.
      Throws:
      InvalidDataException - - if the supplied resources are not valid
      ObjectNotFoundException - - 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

      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 Item
      ns - the namaspace of the module declaring the Resource Item
      location - the location of the XML file on the boot directory
      version - 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 Item
      version - the version of the Resource Item
      outcome - 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 Module
      itemName - name of the resource Item
      version - version of the resource Item
      outcome - the Outcome to be used to create the resource
      reset - 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 Module
      itemName - name of the resource Item
      version - version of the resource Item
      itemPath - the fixed UUID of the Item
      dataLocation - the location of the resource xml available from the classpath to be used as Outcome
      reset - 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 Module
      itemName - name of the resource Item
      version - version of the resource Item
      itemPath - the fixed UUID of the Item
      reset - 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
      the - 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()