org.ow2.petals.system.repository
Interface RepositoryService

All Known Implementing Classes:
RepositoryServiceImpl

public interface RepositoryService

Platform Component Repository. This repository stores all the JBI artifacts in exploded format.

Since:
Petals 1.0
Version:
$Rev: 27860 $ $Date: 2009-08-03 10:08:35 +0200 (lun., 03 août 2009) $
Author:
ofabre - eBM Websourcing

Field Summary
static java.lang.String DEFAULT_REPOSITORY_PATH
          Path to repository location within Petals installation directory.
 
Method Summary
 java.io.File addComponent(java.lang.String componentId, java.io.File explodedArchiveRootDirectory)
          Install a component package into the local Petals repository.
 java.io.File addServiceAssembly(java.lang.String serviceAssemblyId, java.io.File tempFile)
          Copy a service assembly package into petals repository
 java.io.File addSharedLibrary(java.lang.String sharedLibraryId, java.lang.String version, java.io.File tempFile)
          Copy a shared library package into petals repository
 java.io.File explodeSUIntoSAInstallDirectory(java.lang.String serviceUnitId, java.net.URL suZipLocation, java.lang.String serviceAssemblyId)
          Explode a given service unit archive into a SU install root created into the SA install root
 java.io.File getComponentDirectory(java.lang.String componentId)
          Returns the root directory of this component
 java.io.File getComponentInstallDirectory(java.lang.String componentId)
          Returns the install directory of the component
 java.io.File getComponentsDirectory()
          Retrieve the components directory absolute path from the Petals repository.
 java.io.File getComponentWorkDirectory(java.lang.String componentId)
          Returns the work directory of the component
 java.io.File getLostPlusFoundDirectory()
          Retrieve the "lost+found" directory absolute path from the Petals repository.
 java.io.File getRepositoryDirectory()
          Return petals repository folder.
 java.io.File getServiceAssembliesDirectory()
          Retrieve the ServiceAssemblies directory absolute path from the Petals repository.
 java.io.File getServiceAssemblyDirectory(java.lang.String serviceAsemblyId)
          Returns the root directory of the service assembly
 java.io.File getServiceAssemblyInstallDirectory(java.lang.String serviceAssemblyId)
          Returns the install directory of the service assembly
 java.io.File getServiceAssemblyWorkDirectory(java.lang.String serviceAsemblyId)
          Returns the work directory of the service assembly
 java.io.File getSharedLibrariesDirectory()
          Retrieve the SharedLibraries directory absolute path from the Petals repository.
 java.io.File getSharedLibraryDirectory(java.lang.String sharedLibraryId)
          Returns the root directory of the shared library
 java.io.File getSharedLibraryInstallDirectory(java.lang.String sharedLibraryId)
          Returns the install directory of the shared library
 java.io.File getSharedLibraryWorkDirectory(java.lang.String sharedLibraryId)
          Returns the work directory of the shared library
 void removeComponent(java.lang.String componentId)
          Delete and clean all directories and related data from the Petals repository, for the given component identifier.
 void removeServiceAssembly(java.lang.String serviceAssemblyId)
          Delete and clean all directories and related data from the Petals repository, for the given sa identifier.
 void removeSharedLibrary(java.lang.String sharedLibraryId, java.lang.String version)
          Delete and clean all directories and related data from the Petals repository, for the given sl identifier.
 

Field Detail

DEFAULT_REPOSITORY_PATH

static final java.lang.String DEFAULT_REPOSITORY_PATH
Path to repository location within Petals installation directory.

See Also:
Constant Field Values
Method Detail

addComponent

java.io.File addComponent(java.lang.String componentId,
                          java.io.File explodedArchiveRootDirectory)
                          throws java.io.IOException,
                                 ComponentAlreadyExistsException
Install a component package into the local Petals repository.

Parameters:
componentId - The component name (as JBI identifier, unique into the local repository. Must be non null and non empty.
explodedArchiveRootDirectory - The root directory of teh exploded component archive. Must be non null.
Returns:
the component installation root File
Throws:
java.io.IOException - if it fails to create install and work dirs for the component or if it fails to copy package into install dir
ComponentAlreadyExistsException - The component already exists in the repository.

addServiceAssembly

java.io.File addServiceAssembly(java.lang.String serviceAssemblyId,
                                java.io.File tempFile)
                                throws java.io.IOException,
                                       ServiceAssemblyAlreadyExistsException
Copy a service assembly package into petals repository

Parameters:
serviceAssemblyId - String unique sa id that identifies an unique sa directory into the petals repository. Must be non null and non empty
tempFile - File the service assembly package file to add into the repository. Must be non null
Returns:
the sa installation root File
Throws:
java.io.IOException - if it fails to create install and work dirs for the sa or if it fails to copy package into install dir
ServiceAssemblyAlreadyExistsException - The serviced assembly already exists in the repository.

addSharedLibrary

java.io.File addSharedLibrary(java.lang.String sharedLibraryId,
                              java.lang.String version,
                              java.io.File tempFile)
                              throws java.io.IOException,
                                     SharedLibraryAlreadyExistsException
Copy a shared library package into petals repository

Parameters:
sharedLibraryId - String unique sl id that identifies an unique sl directory into the petals repository. Must be non null and non empty
version - Version of the shared library as defined by JBI.
tempFile - File the shared lib package file to add into the repository. Must be non null
Returns:
the sl installation root File
Throws:
java.io.IOException - if it fails to create install and work dirs for the sl or if it fails to copy package into install dir
SharedLibraryAlreadyExistsException - The sl already exists in the repository.

explodeSUIntoSAInstallDirectory

java.io.File explodeSUIntoSAInstallDirectory(java.lang.String serviceUnitId,
                                             java.net.URL suZipLocation,
                                             java.lang.String serviceAssemblyId)
                                             throws java.io.IOException
Explode a given service unit archive into a SU install root created into the SA install root

Parameters:
suId - String unique SU identifier within the repository.
suZipLocation - URL the SU Zip archive file to add flatten into the repository.
saId - String unique SA identifier within the repository where SU add to be flatten
Returns:
File installation root of su in the repository. Must be a valid directory.
Throws:
java.io.IOException - if SU install root can't be created or SU archive can't be unzipped

getComponentDirectory

java.io.File getComponentDirectory(java.lang.String componentId)
                                   throws java.io.IOException
Returns the root directory of this component

Parameters:
componentId - String unique component id that identifies an unique component directory into the petals repository.
Returns:
the root directory of this component, null if it doesn't exist
Throws:
java.io.IOException - if an error occurred during component root retrieval

getComponentInstallDirectory

java.io.File getComponentInstallDirectory(java.lang.String componentId)
                                          throws java.io.IOException
Returns the install directory of the component

Parameters:
componentId - String unique component id that identifies an unique component directory into the petals repository.
Returns:
the install directory of the component
Throws:
java.io.IOException - if an error occurred during component root retrieval

getComponentsDirectory

java.io.File getComponentsDirectory()
Retrieve the components directory absolute path from the Petals repository. This directory contains all installed components.

Returns:
the components directory URL from the Petals repository

getComponentWorkDirectory

java.io.File getComponentWorkDirectory(java.lang.String componentId)
                                       throws java.io.IOException
Returns the work directory of the component

Parameters:
componentId - String unique component id that identifies an unique component directory into the petals repository.
Returns:
the work directory of the component
Throws:
java.io.IOException - if an error occurred during component root retrieval

getLostPlusFoundDirectory

java.io.File getLostPlusFoundDirectory()
Retrieve the "lost+found" directory absolute path from the Petals repository. This directory contains all unknown SharedLibraries, Components and ServiceAssemblies.

Returns:
the lost+found directory

getRepositoryDirectory

java.io.File getRepositoryDirectory()
Return petals repository folder. The repository folder contains extracted component, service assembly and shared library packages. It will be created when this method is called for the first time

Returns:
PEtALS repository directory

getServiceAssembliesDirectory

java.io.File getServiceAssembliesDirectory()
Retrieve the ServiceAssemblies directory absolute path from the Petals repository. This directory contains all deployed ServiceAssemblies.

Returns:
the ServiceAssemblies directory

getServiceAssemblyDirectory

java.io.File getServiceAssemblyDirectory(java.lang.String serviceAsemblyId)
                                         throws java.io.IOException
Returns the root directory of the service assembly

Parameters:
saId - String unique sa id that identifies an unique sa directory into the petals repository.
Returns:
the root directory of this sa, null if it doesn't exist
Throws:
java.io.IOException - if an error occured during service assembly root retrieval

getServiceAssemblyInstallDirectory

java.io.File getServiceAssemblyInstallDirectory(java.lang.String serviceAssemblyId)
                                                throws java.io.IOException
Returns the install directory of the service assembly

Parameters:
serviceAssemblyId - String unique sa id that identifies an unique sa directory into the petals repository.
Returns:
the install directory of the sa
Throws:
java.io.IOException - if an error occured during service assembly root retrieval

getServiceAssemblyWorkDirectory

java.io.File getServiceAssemblyWorkDirectory(java.lang.String serviceAsemblyId)
                                             throws java.io.IOException
Returns the work directory of the service assembly

Parameters:
saId - String unique sa id that identifies an unique sa directory into the petals repository.
Returns:
the work directory of the sa
Throws:
java.io.IOException - if an error occured during service assembly root retrieval

getSharedLibrariesDirectory

java.io.File getSharedLibrariesDirectory()
Retrieve the SharedLibraries directory absolute path from the Petals repository. This directory contains all installed SharedLibraries.

Returns:
the SharedLibs directory URL from the Petals repository

getSharedLibraryDirectory

java.io.File getSharedLibraryDirectory(java.lang.String sharedLibraryId)
                                       throws java.io.IOException
Returns the root directory of the shared library

Parameters:
sharedLibraryId - String unique sl id that identifies an unique sl directory into the petals repository.
Returns:
the root directory of this sl, null if it doesn't exist
Throws:
java.io.IOException - if an error occured during shared lib root retrieval

getSharedLibraryInstallDirectory

java.io.File getSharedLibraryInstallDirectory(java.lang.String sharedLibraryId)
                                              throws java.io.IOException
Returns the install directory of the shared library

Parameters:
slId - String unique sl id that identifies an unique sl directory into the petals repository.
Returns:
the install directory of the sl
Throws:
java.io.IOException - if an error occured during shared lib root retrieval

getSharedLibraryWorkDirectory

java.io.File getSharedLibraryWorkDirectory(java.lang.String sharedLibraryId)
                                           throws java.io.IOException
Returns the work directory of the shared library

Parameters:
slId - String unique sl id that identifies an unique sl directory into the petals repository.
Returns:
the work directory of the sl
Throws:
java.io.IOException - if an error occured during shared lib root retrieval

removeComponent

void removeComponent(java.lang.String componentId)
                     throws java.io.FileNotFoundException,
                            java.io.IOException
Delete and clean all directories and related data from the Petals repository, for the given component identifier.

Parameters:
componentId - String unique component id that identifies an unique component directory into the petals repository.
Throws:
java.io.FileNotFoundException - the component does not exist in the repository.
java.io.IOException - if an error occurred during the delete of related files

removeServiceAssembly

void removeServiceAssembly(java.lang.String serviceAssemblyId)
                           throws java.io.FileNotFoundException,
                                  java.io.IOException
Delete and clean all directories and related data from the Petals repository, for the given sa identifier.

Parameters:
serviceAssemblyId - String unique sa id that identifies an unique sa directory into the petals repository.
Throws:
java.io.FileNotFoundException - the service assembly does not exist in the repository.
java.io.IOException - if an error occurred during the delete of related files

removeSharedLibrary

void removeSharedLibrary(java.lang.String sharedLibraryId,
                         java.lang.String version)
                         throws java.io.FileNotFoundException,
                                java.io.IOException
Delete and clean all directories and related data from the Petals repository, for the given sl identifier.

Parameters:
sharedLibraryId - unique sl id that identifies an unique sl directory into the petals repository.
version - Version of the shared library as defined by JBI.
Throws:
java.io.FileNotFoundException - the shared library does not exist in the repository.
java.io.IOException - if an error occurred during the delete of related files


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.