public class BackofficeModulesManager
extends java.lang.Object
| Constructor and Description |
|---|
BackofficeModulesManager(LibraryFetcher libraryFetcher,
ModulesEnumeration modules) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assureCorrectExistingModulesStructure()
Deprecated.
since 1808, introduce only to ease upgrade process - remove all occurrences when removed
|
protected void |
fetchModules(java.io.File libdir,
java.util.Properties libsURLs) |
java.io.File |
getDataRootDir()
Gets a root directory for data files
|
protected java.util.function.Function<java.lang.String,java.lang.String>[] |
getDirProcessors() |
protected LibraryFetcher |
getLibraryFetcher() |
protected java.net.URI |
getManuallyRegisteredModuleUrl(java.lang.String moduleName) |
java.util.Optional<ModuleInfo> |
getModuleInfo(java.io.File moduleLibFile)
Gets information about a specified module that is stored in specified library
|
java.util.Optional<ModuleInfo> |
getModuleInfo(java.lang.String moduleName)
Gets information about a specified module.
|
java.io.File |
getModuleJarsRootDir()
Gets a root directory, where module's libraries are kept.
|
java.util.Optional<java.io.File> |
getModuleLib(java.lang.String moduleName)
Gets specified module's library.
|
protected java.lang.String |
getModuleLibFileName(java.lang.String moduleName) |
java.util.Optional<java.lang.String> |
getModuleName(java.io.File moduleLibFile)
Gets name of module that is stored in specified library
|
java.util.Optional<java.lang.String> |
getModuleName(java.net.URI moduleURI)
Provides a name of module that origines from provided URI
|
protected <R> java.util.Optional<R> |
getModulePath(java.io.File moduleLib,
java.util.Properties moduleLibsURLS,
java.util.function.Function<java.lang.String,R> pathConverter) |
protected <R> java.util.Optional<R> |
getModulePath(java.lang.String moduleName,
java.util.Properties moduleLibsURLS,
java.util.function.Function<java.lang.String,R> pathConverter) |
java.util.List<java.lang.String> |
getModules()
Provides a list of attached backoffice modules.
|
protected ModulesEnumeration |
getModulesEnumeration() |
java.util.Optional<java.net.URI> |
getModuleSource(java.io.File moduleLib)
Gets the origin URI of module that is stored in specified library
|
java.util.Optional<java.net.URI> |
getModuleSource(java.lang.String moduleName)
Gets the origin URI of specified module
|
protected java.io.File |
getRootDir(java.lang.String configuredRootDir,
java.util.function.Function<java.lang.String,java.lang.String>... processors) |
protected boolean |
isModuleFetched(java.io.File moduleLibFile) |
boolean |
isModuleRegistered(java.lang.String moduleName)
Checks if specified module is registered.
|
protected java.util.Properties |
loadModuleLibsURLS(java.io.File libRoot)
Loads information about libraries mapping: library -> module URL
|
protected java.lang.String |
processDir(java.lang.String dir,
java.util.function.Function<java.lang.String,java.lang.String>... processors) |
protected boolean |
qualifiesForRemoval(java.io.File moduleLibFile,
java.util.Properties moduleLibsURLs) |
protected boolean |
qualifiesForUnregistering(java.io.File moduleLibFile,
java.util.Properties moduleLibsURLs) |
void |
refreshAndFetch()
Reloads all informations about registered backoffice modules.
|
protected void |
registerExistingModules(java.util.Properties libsURLs) |
protected void |
registerNewModuleImmediately(ModuleInfo moduleInfo,
java.net.URI source) |
java.io.File |
registerNewModuleJar(java.lang.String moduleName)
Creates and attaches new module library
|
protected void |
registerNewModuleJarImmediately(java.lang.String moduleName,
java.io.File moduleLibFile,
java.net.URI source,
java.util.Properties moduleLibsURLs) |
protected void |
removeModuleJarImmediately(java.lang.String moduleName,
java.io.File moduleLibFile,
java.util.Properties moduleLibsURLs) |
protected void |
storeModuleLibsURLS(java.util.Properties props,
java.io.File libRoot) |
void |
unregisterModuleJar(java.lang.String moduleName)
Detaches previously attached module
|
protected void |
unregisterModuleJar(java.lang.String moduleName,
java.io.File moduleLibFile) |
public BackofficeModulesManager(LibraryFetcher libraryFetcher,
ModulesEnumeration modules)
public void refreshAndFetch()
throws CockpitApplicationException
All currently loaded modules are detached, newly initialized, modules libraries are being recreated and modules reattached.
CockpitApplicationException - throws if modules could not be reattached or libraries could not be recreatedpublic boolean isModuleRegistered(java.lang.String moduleName)
moduleName - name of moduletrue if module with specified name is already registeredpublic java.util.List<java.lang.String> getModules()
registerNewModuleJar(String)public java.util.Optional<java.lang.String> getModuleName(java.net.URI moduleURI)
moduleURI - module originpublic java.util.Optional<java.io.File> getModuleLib(java.lang.String moduleName)
moduleName - name of modulepublic java.util.Optional<java.net.URI> getModuleSource(java.lang.String moduleName)
moduleName - name of modulepublic java.util.Optional<java.net.URI> getModuleSource(java.io.File moduleLib)
moduleLib - module's librarypublic java.util.Optional<ModuleInfo> getModuleInfo(java.lang.String moduleName)
Please bear in mind that manager cannot provide module information about manually registerd modules. In this case
Optional.empty() is returned.
moduleName - name of moduleregisterNewModuleJar(String)public java.util.Optional<ModuleInfo> getModuleInfo(java.io.File moduleLibFile)
moduleLibFile - module's librarypublic java.util.Optional<java.lang.String> getModuleName(java.io.File moduleLibFile)
moduleLibFile - module's librarypublic java.io.File getDataRootDir()
public java.io.File getModuleJarsRootDir()
public java.io.File registerNewModuleJar(java.lang.String moduleName)
throws java.io.IOException,
CockpitApplicationException
moduleName - name of modulejava.io.IOException - thrown is a library could not be created (i.e. file already exists)CockpitApplicationException - thrown if a library for this module is already attachedprotected void registerNewModuleJarImmediately(java.lang.String moduleName,
java.io.File moduleLibFile,
java.net.URI source,
java.util.Properties moduleLibsURLs)
throws CockpitApplicationException
CockpitApplicationExceptionpublic void unregisterModuleJar(java.lang.String moduleName)
throws java.io.IOException,
CockpitApplicationException
moduleName - module namejava.io.IOException - thrown if library could not be deletedCockpitApplicationException - thrown if module cannot be detached (i.e. is a built in module)protected void unregisterModuleJar(java.lang.String moduleName,
java.io.File moduleLibFile)
throws java.io.IOException,
CockpitApplicationException
java.io.IOExceptionCockpitApplicationExceptionprotected void removeModuleJarImmediately(java.lang.String moduleName,
java.io.File moduleLibFile,
java.util.Properties moduleLibsURLs)
throws java.io.IOException
java.io.IOExceptionprotected boolean qualifiesForUnregistering(java.io.File moduleLibFile,
java.util.Properties moduleLibsURLs)
protected boolean qualifiesForRemoval(java.io.File moduleLibFile,
java.util.Properties moduleLibsURLs)
protected <R> java.util.Optional<R> getModulePath(java.lang.String moduleName,
java.util.Properties moduleLibsURLS,
java.util.function.Function<java.lang.String,R> pathConverter)
protected <R> java.util.Optional<R> getModulePath(java.io.File moduleLib,
java.util.Properties moduleLibsURLS,
java.util.function.Function<java.lang.String,R> pathConverter)
protected LibraryFetcher getLibraryFetcher()
protected ModulesEnumeration getModulesEnumeration()
protected java.util.function.Function<java.lang.String,java.lang.String>[] getDirProcessors()
protected java.io.File getRootDir(java.lang.String configuredRootDir,
java.util.function.Function<java.lang.String,java.lang.String>... processors)
protected java.lang.String processDir(java.lang.String dir,
java.util.function.Function<java.lang.String,java.lang.String>... processors)
protected java.util.Properties loadModuleLibsURLS(java.io.File libRoot)
libRoot - root directory for local modules librarieslibrary path ; module URL>protected void registerExistingModules(java.util.Properties libsURLs)
protected boolean isModuleFetched(java.io.File moduleLibFile)
@Deprecated protected void assureCorrectExistingModulesStructure()
protected void fetchModules(java.io.File libdir,
java.util.Properties libsURLs)
protected java.lang.String getModuleLibFileName(java.lang.String moduleName)
protected void storeModuleLibsURLS(java.util.Properties props,
java.io.File libRoot)
protected void registerNewModuleImmediately(ModuleInfo moduleInfo,
java.net.URI source)
protected java.net.URI getManuallyRegisteredModuleUrl(java.lang.String moduleName)
Copyright © 2018 SAP SE. All Rights Reserved.