Package net.anotheria.anodoc.service
Interface IModuleService
-
- All Known Implementing Classes:
ModuleServiceImpl
public interface IModuleServiceThis interface describes the locally available service for Module management.
It provides functions for configuration of itself and for data access/storage.- Version:
- $Id: $Id
- Author:
- another
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddModuleListener(java.lang.String moduleId, java.lang.String ownerId, IModuleListener aModuleListeners)Adds listener for module.voidattachModuleFactory(java.lang.String moduleId, IModuleFactory factory)Attaches a factory for a given moduleId.voidattachModuleStorage(java.lang.String moduleId, IModuleStorage storage)Attaches a storage for a given moduleId.voiddeleteModule(java.lang.String ownerId, java.lang.String moduleId)Deletes the module identified by the tuple (ownerId | moduleId) from the appropriate storage.voiddeleteModule(java.lang.String ownerId, java.lang.String moduleId, java.lang.String copyId)Deletes the module identified by the tuple (ownerId | moduleId | copyId) from the appropriate storage.voiddeleteModule(Module module)Deletes the given module from the appropriate storage.ModulegetModule(java.lang.String ownerId, java.lang.String moduleId)getModule.ModulegetModule(java.lang.String ownerId, java.lang.String moduleId, boolean create)getModule.ModulegetModule(java.lang.String ownerId, java.lang.String moduleId, java.lang.String copyId)Same as return getModule(ownerId, moduleId, copyId, false); in current implementation.ModulegetModule(java.lang.String ownerId, java.lang.String moduleId, java.lang.String copyId, boolean create)This function retrieves the appropriate Module from the storage and returns it.voidremoveModuleListener(java.lang.String moduleId, java.lang.String ownerId)Removes listener for module.voidstoreModule(Module module)Stores the given module in the appropriate storage.
-
-
-
Method Detail
-
getModule
Module getModule(java.lang.String ownerId, java.lang.String moduleId, java.lang.String copyId, boolean create) throws NoStorageForModuleException, NoFactoryForModuleException, NoStoredModuleEntityException, StorageFailureException
This function retrieves the appropriate Module from the storage and returns it. If the create flag is set, and no module instance is available (NoStoredModuleEntityException) a new Module instance will be created by the previously attached Factory and returned.- Parameters:
ownerId- the id of the owner of this module.moduleId- the id of the modulecopyId- the copy id.create- if true and the module doesn't exists yet, it will be created.- Returns:
- retrieved Module
- Throws:
NoStorageForModuleException- if any.NoFactoryForModuleException- if any.NoStoredModuleEntityException- if any.StorageFailureException- if any.
-
getModule
Module getModule(java.lang.String ownerId, java.lang.String moduleId, boolean create) throws NoStorageForModuleException, NoFactoryForModuleException, NoStoredModuleEntityException, StorageFailureException
getModule.
- Parameters:
ownerId- aStringobject.moduleId- aStringobject.create- a boolean.- Returns:
- a
Moduleobject. - Throws:
NoStorageForModuleException- if any.NoFactoryForModuleException- if any.NoStoredModuleEntityException- if any.StorageFailureException- if any.
-
getModule
Module getModule(java.lang.String ownerId, java.lang.String moduleId) throws NoStorageForModuleException, NoFactoryForModuleException, NoStoredModuleEntityException, StorageFailureException
getModule.
- Parameters:
ownerId- aStringobject.moduleId- aStringobject.- Returns:
- a
Moduleobject. - Throws:
NoStorageForModuleException- if any.NoFactoryForModuleException- if any.NoStoredModuleEntityException- if any.StorageFailureException- if any.
-
getModule
Module getModule(java.lang.String ownerId, java.lang.String moduleId, java.lang.String copyId) throws NoStorageForModuleException, NoFactoryForModuleException, NoStoredModuleEntityException, StorageFailureException
Same as return getModule(ownerId, moduleId, copyId, false); in current implementation.- Parameters:
ownerId- aStringobject.moduleId- aStringobject.copyId- aStringobject.- Returns:
- a
Moduleobject. - Throws:
NoStorageForModuleException- if any.NoFactoryForModuleException- if any.NoStoredModuleEntityException- if any.StorageFailureException- if any.
-
storeModule
void storeModule(Module module) throws NoStorageForModuleException, StorageFailureException
Stores the given module in the appropriate storage.- Parameters:
module- the module to store.- Throws:
NoStorageForModuleException- thrown if no storage for this moduleId is attached.StorageFailureException- thrown if the storage failed.
-
attachModuleFactory
void attachModuleFactory(java.lang.String moduleId, IModuleFactory factory)Attaches a factory for a given moduleId.- Parameters:
moduleId- aStringobject.factory- aIModuleFactoryobject.
-
attachModuleStorage
void attachModuleStorage(java.lang.String moduleId, IModuleStorage storage)Attaches a storage for a given moduleId.- Parameters:
moduleId- aStringobject.storage- aIModuleStorageobject.
-
deleteModule
void deleteModule(Module module) throws NoStorageForModuleException, StorageFailureException
Deletes the given module from the appropriate storage.- Parameters:
module- aModuleobject.- Throws:
NoStorageForModuleException- if any.StorageFailureException- if any.
-
deleteModule
void deleteModule(java.lang.String ownerId, java.lang.String moduleId, java.lang.String copyId) throws NoStorageForModuleException, StorageFailureExceptionDeletes the module identified by the tuple (ownerId | moduleId | copyId) from the appropriate storage.- Parameters:
ownerId- aStringobject.moduleId- aStringobject.copyId- aStringobject.- Throws:
NoStorageForModuleException- if any.StorageFailureException- if any.
-
deleteModule
void deleteModule(java.lang.String ownerId, java.lang.String moduleId) throws NoStorageForModuleException, StorageFailureExceptionDeletes the module identified by the tuple (ownerId | moduleId) from the appropriate storage. The copy id is assumed to be the standart copyId.- Parameters:
ownerId- aStringobject.moduleId- aStringobject.- Throws:
NoStorageForModuleException- if any.StorageFailureException- if any.
-
addModuleListener
void addModuleListener(java.lang.String moduleId, java.lang.String ownerId, IModuleListener aModuleListeners)Adds listener for module.- Parameters:
moduleId- module id of module.ownerId- owner id of module.aModuleListeners- listener to add.
-
removeModuleListener
void removeModuleListener(java.lang.String moduleId, java.lang.String ownerId)Removes listener for module.- Parameters:
moduleId- id of module.ownerId- owner id for module.
-
-