org.ow2.petals.microkernel.api.system.repository
Interface RepositoryService


public interface RepositoryService

Platform Component Repository.

This repository stores all the JBI artifacts in exploded format.

Since:
Petals 1.0
Author:
Olivier Fabre - EBM WebSourcing

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

Field Detail

COMPONENT_LOGGER_NAME

static final String COMPONENT_LOGGER_NAME
See Also:
Constant Field Values

DEFAULT_REPOSITORY_PATH

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

See Also:
Constant Field Values
Method Detail

addComponent

File addComponent(String componentId,
                  File explodedArchiveRootDirectory)
                  throws 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:
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

File addServiceAssembly(String serviceAssemblyId,
                        File tempFile)
                        throws 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:
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

File addSharedLibrary(String sharedLibraryId,
                      String version,
                      File tempFile)
                      throws 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:
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

File explodeSUIntoSAInstallDirectory(String serviceUnitId,
                                     URL suZipLocation,
                                     String serviceAssemblyId)
                                     throws 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:
IOException - if SU install root can't be created or SU archive can't be unzipped

getComponentDirectory

File getComponentDirectory(String componentId)
                           throws 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:
IOException - if an error occurred during component root retrieval

getComponentInstallDirectory

File getComponentInstallDirectory(String componentId)
                                  throws 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:
IOException - if an error occurred during component root retrieval

getComponentsDirectory

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

File getComponentWorkDirectory(String componentId)
                               throws 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:
IOException - if an error occurred during component root retrieval

getLostPlusFoundDirectory

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

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

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

Returns:
the ServiceAssemblies directory

getServiceAssemblyDirectory

File getServiceAssemblyDirectory(String serviceAsemblyId)
                                 throws 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:
IOException - if an error occured during service assembly root retrieval

getServiceAssemblyInstallDirectory

File getServiceAssemblyInstallDirectory(String serviceAssemblyId)
                                        throws 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:
IOException - if an error occured during service assembly root retrieval

getServiceAssemblyWorkDirectory

File getServiceAssemblyWorkDirectory(String serviceAsemblyId)
                                     throws 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:
IOException - if an error occured during service assembly root retrieval

getSharedLibrariesDirectory

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

File getSharedLibraryDirectory(String sharedLibraryId)
                               throws 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:
IOException - if an error occured during shared lib root retrieval

getSharedLibraryInstallDirectory

File getSharedLibraryInstallDirectory(String sharedLibraryId)
                                      throws 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:
IOException - if an error occured during shared lib root retrieval

getSharedLibraryWorkDirectory

File getSharedLibraryWorkDirectory(String sharedLibraryId)
                                   throws 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:
IOException - if an error occured during shared lib root retrieval

removeComponent

void removeComponent(String componentId)
                     throws FileNotFoundException,
                            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:
FileNotFoundException - the component does not exist in the repository.
IOException - if an error occurred during the delete of related files

removeServiceAssembly

void removeServiceAssembly(String serviceAssemblyId)
                           throws FileNotFoundException,
                                  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:
FileNotFoundException - the service assembly does not exist in the repository.
IOException - if an error occurred during the delete of related files

removeSharedLibrary

void removeSharedLibrary(String sharedLibraryId,
                         String version)
                         throws FileNotFoundException,
                                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:
FileNotFoundException - the shared library does not exist in the repository.
IOException - if an error occurred during the delete of related files


Copyright © 2005-2015 Linagora. All Rights Reserved.