org.enhydra.shark.api.internal.repositorypersistence
Interface RepositoryPersistenceManager


public interface RepositoryPersistenceManager

Interface for implementing Repository persistence interface.

Version:
1.0
Author:
Sasa Bojanic

Method Summary
 void addXPDLReference(WMSessionHandle shandle, java.lang.String referredXPDLId, java.lang.String referringXPDLId, java.lang.String referringXPDLVersion, int referredXPDLNumber)
          Adds a information on referenced XPDL.
 void clearRepository(WMSessionHandle shandle)
          Clears the repository.
 void configure(CallbackUtilities cus)
          Method configure is called at Shark start up, to configure implementation of RepositoryPersistenceManager.
 void deleteFromHistory(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Deletes specified file from history.
 void deleteXPDL(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Deletes xpdl specified by given parameters from the repository.
 boolean doesXPDLExist(WMSessionHandle shandle, java.lang.String xpdlId)
          Checks if xpdl with given id exists.
 boolean doesXPDLExist(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Checks if xpdl with given id and version exists.
 java.lang.String getCurrentVersion(WMSessionHandle shandle, java.lang.String xpdlId)
          Gets the current version of package with specified Id.
 java.util.List getExistingXPDLIds(WMSessionHandle shandle)
          Used to retrieve the list of xpdl Ids currently hold in repository.
 java.lang.String getNextVersion(WMSessionHandle shandle, java.lang.String xpdlId)
          Gets the next version of specified Id.
 java.util.List getReferredXPDLIds(WMSessionHandle shandle, java.lang.String referringXPDLId, java.lang.String referringXPDLVersion)
          Gets a list of Ids of referred XPDLs Ids.
 java.util.List getReferringXPDLIds(WMSessionHandle shandle, java.lang.String referredXPDLId)
          Gets a list of Ids of XPDLs that referr to the given one.
 java.util.List getReferringXPDLVersions(WMSessionHandle shandle, java.lang.String referredXPDLId, java.lang.String referringXPDLId)
          Gets a list of versions of XPDLs with given Id that referr to the given one.
 byte[] getSerializedXPDLObject(WMSessionHandle shandle, java.lang.String xpdlId)
          Gets the byte array for the last version of specified XPDL.
 byte[] getSerializedXPDLObject(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Gets the byte array representing specified XPDL.
 long getSerializedXPDLObjectVersion(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Gets the version of serialized object that represents given XPDL.
 byte[] getXPDL(WMSessionHandle shandle, java.lang.String xpdlId)
          Gets the byte array for the last version of specified XPDL.
 byte[] getXPDL(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Gets the byte array representing specified XPDL.
 long getXPDLUploadTime(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Gets the time when XPDL was uploaded into the engine.
 java.util.List getXPDLVersions(WMSessionHandle shandle, java.lang.String xpdlId)
          Gets a list of all versions for specified XPDL.
 void moveToHistory(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion)
          Moves the specified XPDL into history.
 void updateXPDL(WMSessionHandle shandle, java.lang.String xpdlId, java.lang.String xpdlVersion, byte[] xpdl, byte[] serializedPkg, long xpdlClassVer)
          Updates XPDL file in the repository.
 void uploadXPDL(WMSessionHandle shandle, java.lang.String xpdlId, byte[] xpdl, byte[] serializedPkg, long xpdlClassVer)
          Uploads XPDL represented by byte array into repository, and gives it specified Id.
 

Method Detail

configure

void configure(CallbackUtilities cus)
               throws java.lang.Exception
Method configure is called at Shark start up, to configure implementation of RepositoryPersistenceManager.

Parameters:
cus - an instance of CallbackUtilities used to get properties for configuring Repository Manager in Shark.
Throws:
java.lang.Exception - Thrown if configuring doesn't succeed.

uploadXPDL

void uploadXPDL(WMSessionHandle shandle,
                java.lang.String xpdlId,
                byte[] xpdl,
                byte[] serializedPkg,
                long xpdlClassVer)
                throws RepositoryException
Uploads XPDL represented by byte array into repository, and gives it specified Id. The version of XPDL is automatically set.

Parameters:
xpdlId - a String representing Id of xpdl
xpdl - a byte[] representing XPDL
Throws:
RepositoryException - if something goes wrong

updateXPDL

void updateXPDL(WMSessionHandle shandle,
                java.lang.String xpdlId,
                java.lang.String xpdlVersion,
                byte[] xpdl,
                byte[] serializedPkg,
                long xpdlClassVer)
                throws RepositoryException
Updates XPDL file in the repository.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
xpdl - a byte[] representing XPDL
Throws:
RepositoryException - if something goes wrong

deleteXPDL

void deleteXPDL(WMSessionHandle shandle,
                java.lang.String xpdlId,
                java.lang.String xpdlVersion)
                throws RepositoryException
Deletes xpdl specified by given parameters from the repository.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Throws:
RepositoryException - if something goes wrong

moveToHistory

void moveToHistory(WMSessionHandle shandle,
                   java.lang.String xpdlId,
                   java.lang.String xpdlVersion)
                   throws RepositoryException
Moves the specified XPDL into history. All referrences to external xpdls are removed also.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Throws:
RepositoryException - if something goes wrong

deleteFromHistory

void deleteFromHistory(WMSessionHandle shandle,
                       java.lang.String xpdlId,
                       java.lang.String xpdlVersion)
                       throws RepositoryException
Deletes specified file from history.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Throws:
RepositoryException - if something goes wrong

clearRepository

void clearRepository(WMSessionHandle shandle)
                     throws RepositoryException
Clears the repository.

Throws:
RepositoryException - if something goes wrong

getCurrentVersion

java.lang.String getCurrentVersion(WMSessionHandle shandle,
                                   java.lang.String xpdlId)
                                   throws RepositoryException
Gets the current version of package with specified Id.

Parameters:
xpdlId - a String representing Id of xpdl
Returns:
a String representing the current version of XPDL specified by given Id.
Throws:
RepositoryException - if something goes wrong

getNextVersion

java.lang.String getNextVersion(WMSessionHandle shandle,
                                java.lang.String xpdlId)
                                throws RepositoryException
Gets the next version of specified Id.

Parameters:
xpdlId - a String representing Id of xpdl
Returns:
a String representing the next version of XPDL specified by given Id.
Throws:
RepositoryException - if something goes wrong

getSerializedXPDLObjectVersion

long getSerializedXPDLObjectVersion(WMSessionHandle shandle,
                                    java.lang.String xpdlId,
                                    java.lang.String xpdlVersion)
                                    throws RepositoryException
Gets the version of serialized object that represents given XPDL.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Returns:
a String representing the version of serialized XPDL object
Throws:
RepositoryException - if something goes wrong

getXPDLUploadTime

long getXPDLUploadTime(WMSessionHandle shandle,
                       java.lang.String xpdlId,
                       java.lang.String xpdlVersion)
                       throws RepositoryException
Gets the time when XPDL was uploaded into the engine.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Returns:
a long representing the time when XPDL was uploaded
Throws:
RepositoryException - if something goes wrong

getXPDL

byte[] getXPDL(WMSessionHandle shandle,
               java.lang.String xpdlId)
               throws RepositoryException
Gets the byte array for the last version of specified XPDL.

Parameters:
xpdlId - a String representing Id of xpdl
Returns:
a byte[] representing last version of XPDL specified by given Id.
Throws:
RepositoryException - if repository does not contain the xpdl with given Id, or something else goes wrong.

getSerializedXPDLObject

byte[] getSerializedXPDLObject(WMSessionHandle shandle,
                               java.lang.String xpdlId)
                               throws RepositoryException
Gets the byte array for the last version of specified XPDL. This is actually serialized Java object representing the main object of XPDL object model.

Parameters:
xpdlId - a String representing Id of xpdl
Returns:
a byte[] representing last version of XPDL specified by given Id.
Throws:
RepositoryException - if repository does not contain the xpdl with given Id, or something else goes wrong.

getXPDL

byte[] getXPDL(WMSessionHandle shandle,
               java.lang.String xpdlId,
               java.lang.String xpdlVersion)
               throws RepositoryException
Gets the byte array representing specified XPDL.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Returns:
a byte[] representing XPDL specified by given Id and version.
Throws:
RepositoryException - if repository does not contain the xpdl with given Id and version, or something else goes wrong.

getSerializedXPDLObject

byte[] getSerializedXPDLObject(WMSessionHandle shandle,
                               java.lang.String xpdlId,
                               java.lang.String xpdlVersion)
                               throws RepositoryException
Gets the byte array representing specified XPDL. This is actually serialized Java object representing the main object of XPDL object model.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Returns:
a byte[] representing XPDL specified by given Id and version.
Throws:
RepositoryException - if repository does not contain the xpdl with given Id and version, or something else goes wrong.

getXPDLVersions

java.util.List getXPDLVersions(WMSessionHandle shandle,
                               java.lang.String xpdlId)
                               throws RepositoryException
Gets a list of all versions for specified XPDL.

Parameters:
xpdlId - a String representing Id of xpdl
Returns:
a List of Strings representing versions of xpdl specified by given Id.
Throws:
RepositoryException - if repository does not contain the xpdl with given Id, or something else goes wrong.

doesXPDLExist

boolean doesXPDLExist(WMSessionHandle shandle,
                      java.lang.String xpdlId)
                      throws RepositoryException
Checks if xpdl with given id exists.

Parameters:
xpdlId - a String representing Id of xpdl
Returns:
true if xpdl with given Id exists in repository.
Throws:
RepositoryException - if something goes wrong

doesXPDLExist

boolean doesXPDLExist(WMSessionHandle shandle,
                      java.lang.String xpdlId,
                      java.lang.String xpdlVersion)
                      throws RepositoryException
Checks if xpdl with given id and version exists.

Parameters:
xpdlId - a String representing Id of xpdl
xpdlVersion - a String representing xpdl version
Returns:
true if xpdl with given Id and version exists in repository.
Throws:
RepositoryException - if something goes wrong

getExistingXPDLIds

java.util.List getExistingXPDLIds(WMSessionHandle shandle)
                                  throws RepositoryException
Used to retrieve the list of xpdl Ids currently hold in repository.

Returns:
A list of strings representing the Ids of xpdls that currently exist in repository.
Throws:
RepositoryException - if something goes wrong

addXPDLReference

void addXPDLReference(WMSessionHandle shandle,
                      java.lang.String referredXPDLId,
                      java.lang.String referringXPDLId,
                      java.lang.String referringXPDLVersion,
                      int referredXPDLNumber)
                      throws RepositoryException
Adds a information on referenced XPDL.

Parameters:
referredXPDLId - Id of XPDL that is referred by some other XPDL
referringXPDLId - Id of XPDL that referrs some other XPDL
referringXPDLVersion - Version of XPDL that referrs some other XPDL
referredXPDLNumber - The ordinal numbe of referred XPDL
Throws:
RepositoryException

getReferringXPDLIds

java.util.List getReferringXPDLIds(WMSessionHandle shandle,
                                   java.lang.String referredXPDLId)
                                   throws RepositoryException
Gets a list of Ids of XPDLs that referr to the given one.

Parameters:
referredXPDLId - Id of XPDL that is referred by some other XPDLs.
Returns:
a List
Throws:
RepositoryException

getReferringXPDLVersions

java.util.List getReferringXPDLVersions(WMSessionHandle shandle,
                                        java.lang.String referredXPDLId,
                                        java.lang.String referringXPDLId)
                                        throws RepositoryException
Gets a list of versions of XPDLs with given Id that referr to the given one.

Parameters:
referredXPDLId - Id of XPDL that is referred by some other XPDLs.
referringXPDLId - Id of XPDL that referrs some other XPDL
Returns:
a List
Throws:
RepositoryException

getReferredXPDLIds

java.util.List getReferredXPDLIds(WMSessionHandle shandle,
                                  java.lang.String referringXPDLId,
                                  java.lang.String referringXPDLVersion)
                                  throws RepositoryException
Gets a list of Ids of referred XPDLs Ids.

Parameters:
referringXPDLId - Id of XPDL that referrs some other XPDLs
referringXPDLVersion - Version of XPDL that referrs some other XPDLs
Returns:
a List
Throws:
RepositoryException