PayloadsRepository

public abstract class PayloadsRepository extends SystemComponent

A Generic repository for collect a set of payloads that satisfies some criteria. SPA Component Guideline:

  1. Add a new parameter with the name is “location”.
  2. The value of newly parameter should be the absolute repository path.

Example If the location is C:corvusrepositorytest-repository,

<component id="test" name="Test Repository">
    <class>hk.hku.cecid.edi.sfrm.com.XXXXRepository</class>
    <parameter name="location" value="C:corvusrepositorytest-repository"/>
</component>
  • Creation Date: 5/10/2006
Author:Twinsen

Constructors

PayloadsRepository

public PayloadsRepository()

Constructor.

PayloadsRepository

public PayloadsRepository(String repoPath)

Methods

createPayloads

public abstract NamedPayloads createPayloads(Object[] params, int initialState)

Create a customizing payloads for the specified parameter.

Parameters:
  • params – An array object parameters set for creating the payload.
  • initialState – The initial state of the payloads, see PayloadsState for details
Throws:

createPayloadsProxy

protected abstract NamedPayloads createPayloadsProxy(File proxyObj)

Create a customizing payloads for this repository.

Parameters:
  • proxyObj – The file object for the payloads.
Returns:

a customizing payloads.

getPayload

public NamedPayloads getPayload(String name)

Get a particular payload in the payload repository.

Parameters:
  • name – The physical file name of the payload.
Returns:

the payload with the specified name or null if it does not exist.

getPayload

public abstract NamedPayloads getPayload(Object[] params, int state)

Get a particular payload in the payload repository by the specified parameters.

Parameters:
  • params – An array object parameters set for creating the payload.
  • state – The current state of that payload.
Returns:

the payload with the specified params or null if it does not exist.

getPayloads

public abstract Collection getPayloads()
Returns:Get the list of pending payloads in the payload repository.

getProcessingPayloads

public abstract Collection getProcessingPayloads()
Returns:Get the list of processing payloads in the payload repositoy;

getRepository

public File getRepository()

Get the repository.

Returns:Return the repository.

getRepositoryPath

public String getRepositoryPath()
Returns:get the repository absolute path.

getRepositorySystem

public FileSystem getRepositorySystem()

Get the repository system

Returns:Return the repository.

init

protected void init()

Component Initialization.

Throws:

initRepository

protected void initRepository(String repository)

Initialize the repository. Create the repository if it does not exist.

Parameters:
  • repository

initRepository

protected void initRepository(File repository)

Initialize the repository. Create the repository if it does not exist.

Parameters:
  • repository

toString

public String toString()

toString method.