org.enhydra.shark.api.admin
Interface RepositoryMgr


public interface RepositoryMgr

Interface used to manage shark's external repository.

Author:
Sasa Bojanic, Vladimir Puskas

Method Summary
 void deletePackage(java.lang.String relativePath)
          Removes a package file, given by the path relative to the shark's external repository, from the shark's external repository.
 java.lang.String[] getArisxmlPaths()
          Returns an array of strings representing relative path to ARISXML files in shark's external repository.
 java.lang.String getPackageId(java.lang.String relativePath)
          Returns the id of the package defined in XPDL file in external repository.
 java.lang.String[] getPackagePaths()
          Returns an array of strings representing relative path to XPDL files in shark's external repository.
 java.util.Map getPackagePathToIdMapping()
          Returns a Map which keys are paths of XPDL files in external repository, and relative to this repository, and values are the Ids of package defined within this XPDL files.
 java.lang.String getPathToXPDLRepositoryFolder()
           
 void setPathToXPDLRepositoryFolder(java.lang.String xpdlRepFolder)
           
 void uploadPackage(byte[] pkgContent, java.lang.String relativePath)
          Uploads a package given as a byte array into shark external repository.
 

Method Detail

setPathToXPDLRepositoryFolder

void setPathToXPDLRepositoryFolder(java.lang.String xpdlRepFolder)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getPathToXPDLRepositoryFolder

java.lang.String getPathToXPDLRepositoryFolder()
                                               throws java.lang.Exception
Throws:
java.lang.Exception

getPackagePaths

java.lang.String[] getPackagePaths()
                                   throws java.lang.Exception
Returns an array of strings representing relative path to XPDL files in shark's external repository. The file paths are relative to the external repository folder.

Returns:
an array of relative paths for XPDLs in external repository.
Throws:
java.lang.Exception - If something unexpected happens. (wasn't called or authentication failed).

getArisxmlPaths

java.lang.String[] getArisxmlPaths()
                                   throws java.lang.Exception
Returns an array of strings representing relative path to ARISXML files in shark's external repository. The file paths are relative to the external repository folder.

Throws:
java.lang.Exception - If something unexpected happens. (wasn't called or authentication failed).

getPackagePathToIdMapping

java.util.Map getPackagePathToIdMapping()
                                        throws java.lang.Exception
Returns a Map which keys are paths of XPDL files in external repository, and relative to this repository, and values are the Ids of package defined within this XPDL files.

Returns:
Map whose keys are paths of XPDL files in external repository and values are the Ids of package defined within this XPDL files.
Throws:
java.lang.Exception - If something unexpected happens. (wasn't called or authentication failed).

getPackageId

java.lang.String getPackageId(java.lang.String relativePath)
                              throws java.lang.Exception
Returns the id of the package defined in XPDL file in external repository.

Parameters:
relativePath - path of package file, relative to the shark's external repository location.
Returns:
id of the package defined in XPDL file in external repository as String.
Throws:
java.lang.Exception - If something unexpected happens. (wasn't called or authentication failed).

uploadPackage

void uploadPackage(byte[] pkgContent,
                   java.lang.String relativePath)
                   throws java.lang.Exception
Uploads a package given as a byte array into shark external repository. It saves it in this repository as a file which path is given by a second parameter, and is relative to the location of external repository.

Parameters:
pkgContent - array of bytes representing XPDL package.
relativePath - path of newly uploaded package file, relative to the shark's external repository location.
Throws:
java.lang.Exception - If something unexpected happens. thus can't be uploaded.

deletePackage

void deletePackage(java.lang.String relativePath)
                   throws java.lang.Exception
Removes a package file, given by the path relative to the shark's external repository, from the shark's external repository.

Parameters:
relativePath - relative path of package file that need to be removed.
Throws:
java.lang.Exception - If something unexpected happens. become invalid (i.e. this package is referenced by some others).