Package nl.gx.webmanager.wcb
Interface ComponentBundle
-
- All Known Implementing Classes:
ComponentBundleImpl
public interface ComponentBundle
- Author:
- bramk
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteExcludedBundleResources(String srcFileNamePrefix, String destFileNamePrefix, String baseDirectory)
Deletes all files not in the given jar source (srcFileNamePrefix) from the given destFileNamePrefix.void
deleteFileFromDisk(File file)
Deletes file from disk.String
formatFileName(String fileName)
Ensures that the given fileName is a system path; System specifiek direcory indicators.String
getBaseDirectory()
Returns the base directory where all backend files are located.org.osgi.framework.BundleContext
getBundleContext()
ComponentBundleDefinition
getBundleDefinition()
List<String>
getRegisteredComponentIds()
Returns all component ids registered by the ComponentBundle.org.osgi.framework.Version
getVersion()
The technical version of a ComponentBundle is read from the Manifest.String
getWebrootDirectory()
Returns the base directory where all static files are located.String
getWorkDirectory()
Returns the full path of a working directory which can be used by this component bundle to store temporary or non-temporary files.boolean
isLicensed(ComponentDefinition componentDefinition)
Returns if a valid license is installed for the given component definitionvoid
start()
Checks if the component bundle's components are registered, if not, it registers the components.void
stop()
Deactivates all component bundle's components.String
substringAfter(String str, String separator)
Returns the substring of str after the seperator.void
writeComponentBundleResourcesToFile(String srcFileNamePrefix, String destFileNamePrefix, String baseDirectory)
Deploys all files from the given jar source (srcFileNamePrefix)to the given destFileNamePrefix.
-
-
-
Method Detail
-
getBundleDefinition
ComponentBundleDefinition getBundleDefinition()
- Returns:
-
start
void start() throws Exception
Checks if the component bundle's components are registered, if not, it registers the components. Then checks if the components are installed, if not, it installs the components. Finally activates all components.- Throws:
Exception
- when starting of ComponentBundle was not successful.
-
getVersion
org.osgi.framework.Version getVersion()
The technical version of a ComponentBundle is read from the Manifest.- Returns:
- the technical version, or null if not defined properly in the Manifest
-
stop
void stop()
Deactivates all component bundle's components.
-
writeComponentBundleResourcesToFile
void writeComponentBundleResourcesToFile(String srcFileNamePrefix, String destFileNamePrefix, String baseDirectory)
Deploys all files from the given jar source (srcFileNamePrefix)to the given destFileNamePrefix.- Parameters:
srcFileNamePrefix
- prefix for the srcFileNames location in the jar f.e. editpresentation/destFileNamePrefix
- destination path can hold bundle specific names f.e./WEB-INF/wm/jsp/edit/wcb/{bundle_id}/
baseDirectory
- base directory for the destination path
-
deleteExcludedBundleResources
void deleteExcludedBundleResources(String srcFileNamePrefix, String destFileNamePrefix, String baseDirectory)
Deletes all files not in the given jar source (srcFileNamePrefix) from the given destFileNamePrefix.- Parameters:
srcFileNamePrefix
- prefix for the srcFileNames location in the jar f.e. editpresentation/destFileNamePrefix
- destination path can hold bundle specific names f.e./WEB-INF/wm/jsp/edit/wcb/{bundle_id}/
baseDirectory
- base directory for the destination path
-
substringAfter
String substringAfter(String str, String separator)
Returns the substring of str after the seperator.- Parameters:
str
- input Stringseparator
- seperator string- Returns:
- substring after seperator, "" if seperator not exists
-
formatFileName
String formatFileName(String fileName)
Ensures that the given fileName is a system path; System specifiek direcory indicators.- Parameters:
fileName
- Original file name- Returns:
- fileName File name formatted using the correct directory separators
-
deleteFileFromDisk
void deleteFileFromDisk(File file)
Deletes file from disk.- Parameters:
file
- File to delete
-
getBaseDirectory
String getBaseDirectory()
Returns the base directory where all backend files are located.- Returns:
- the base directory where all backend files are located
-
getWebrootDirectory
String getWebrootDirectory()
Returns the base directory where all static files are located.- Returns:
- the base directory where all static files are located
-
getWorkDirectory
String getWorkDirectory()
Returns the full path of a working directory which can be used by this component bundle to store temporary or non-temporary files. This work directory is intended to be used only by master, never by slaves. For this reason this method will return null when retrieved from a slave.- Returns:
- Full path to a local working directory when this method is invoked from the master, null if this method is invoked from a slave.
-
isLicensed
boolean isLicensed(ComponentDefinition componentDefinition)
Returns if a valid license is installed for the given component definition- Parameters:
componentDefinition
- Component definition to check the license for- Returns:
true
if a valid license is installed for the component definition or the component definition is not licensed,false
otherwise
-
getRegisteredComponentIds
List<String> getRegisteredComponentIds()
Returns all component ids registered by the ComponentBundle.- Returns:
- all component ids registered by the ComponentBundle
-
getBundleContext
org.osgi.framework.BundleContext getBundleContext()
-
-