Package nl.gx.webmanager.wcb
Interface ComponentManager
-
public interface ComponentManager
Interface for the componentManager.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addUnlicensedComponent(String componentID, String componentTypeID)
If a component requires a license and no valid license is available, the component is registerd as an unlicensed component.boolean
checkComponentDefinition(ComponentDefinition componentDefinition)
Validate that a componentDefinition defines a valid component.boolean
checkComponentTypeDefinition(ComponentDefinition componentDefinition)
Validate that a componentDefinition defines a valid componentType.boolean
createPersistenceStructure(Component component)
Given the classes in the bundle create node type definitions and feed them to the underlying JCR persistence store.Component
getComponent(String typeId, String id)
Get a registered component by typeId and id.int
getComponentCount(String typeId)
Gets the number of registered components for a componentType.Component[]
getComponents(String typeId)
Get all registered components for a componentType.ComponentType
getComponentType(String typeId)
Get a registered componentType by typeId.ComponentType[]
getComponentTypes()
Get all registered componentTypes.FrameworkConfig
getFrameworkConfig()
Gets the frameworkConfig.ComponentBundle
getOfflineComponentBundle(org.osgi.framework.Bundle bundle)
Returns the offline component bundle for the given bundle.Map<String,String>
getUnlicensedComponents()
Returns all unlicensed components installed on the system.boolean
installBundle(org.osgi.framework.Bundle bundle)
Deprecated.UsestartComponent(Component)
orstartComponentBundle(ComponentBundle)
instead.boolean
isLicensed(String componentID, String nameSpace)
Determine whether a license exists for the given componentID and namespace.boolean
isLicensed(ComponentDefinition componentDefinition)
Returns if a valid license is installed for the given component definition.boolean
isPlatformBundle(org.osgi.framework.Bundle bundle)
Determine whether the given bundle is a platform bundle.boolean
purgeBundle(org.osgi.framework.Bundle bundle)
Purges the specified bundle.boolean
purgeComponent(Component component)
Purges the specified component.void
removeComponentNode(String componentId)
Removes the nodes of a given component identified by its id from the JCR.void
removeUnlicensedComponent(String componentID)
Removes the component from the collection of unlicensed components.void
startComponent(Component component)
Starts a component.void
startComponentBundle(ComponentBundle componentBundle)
Starts a component bundle.boolean
uninstallBundle(org.osgi.framework.Bundle bundle)
Uninstalls the specified bundle.boolean
updateBundle(org.osgi.framework.Bundle bundle)
Deprecated.UsestartComponent(Component)
orstartComponentBundle(ComponentBundle)
instead.
-
-
-
Method Detail
-
getFrameworkConfig
FrameworkConfig getFrameworkConfig()
Gets the frameworkConfig.- Returns:
- the frameworkConfig
-
getComponentType
ComponentType getComponentType(String typeId)
Get a registered componentType by typeId.- Parameters:
typeId
- identifies a component type- Returns:
- the componentType or null
-
getComponentTypes
ComponentType[] getComponentTypes()
Get all registered componentTypes.- Returns:
- an array of componentTypes
-
getComponent
Component getComponent(String typeId, String id)
Get a registered component by typeId and id.- Parameters:
typeId
- if of the the componentTypeid
- of the component- Returns:
- a component or null
-
getComponents
Component[] getComponents(String typeId)
Get all registered components for a componentType.- Parameters:
typeId
- id of the componentType- Returns:
- array of registered components
-
getComponentCount
int getComponentCount(String typeId)
Gets the number of registered components for a componentType.- Parameters:
typeId
- component type id- Returns:
- number of registered components
-
checkComponentTypeDefinition
boolean checkComponentTypeDefinition(ComponentDefinition componentDefinition)
Validate that a componentDefinition defines a valid componentType. This method will be called before a new componentType is allowed to register.- Parameters:
componentDefinition
- component definition to validate its component type for- Returns:
- a boolean indicating whether the definition is valid.
-
checkComponentDefinition
boolean checkComponentDefinition(ComponentDefinition componentDefinition)
Validate that a componentDefinition defines a valid component. This method will be called before a new component is allowed to register.- Parameters:
componentDefinition
- component definition to validate its component for- Returns:
- a boolean indicating whether the definition is valid.
-
createPersistenceStructure
boolean createPersistenceStructure(Component component)
Given the classes in the bundle create node type definitions and feed them to the underlying JCR persistence store. FIXME: should the be on the componentManager???- Parameters:
component
- Component containing all classes- Returns:
- true if the classes are successfully fed to the underlying JCR persistence store.
-
addUnlicensedComponent
void addUnlicensedComponent(String componentID, String componentTypeID)
If a component requires a license and no valid license is available, the component is registerd as an unlicensed component.- Parameters:
componentID
- identifies the componentcomponentTypeID
- identifies the component type
-
removeUnlicensedComponent
void removeUnlicensedComponent(String componentID)
Removes the component from the collection of unlicensed components.- Parameters:
componentID
- identifies the component
-
getUnlicensedComponents
Map<String,String> getUnlicensedComponents()
Returns all unlicensed components installed on the system.- Returns:
- Map of componentID's and associated componentTypeId's.
-
removeComponentNode
void removeComponentNode(String componentId)
Removes the nodes of a given component identified by its id from the JCR.- Parameters:
componentId
- Id of a component
-
installBundle
@Deprecated boolean installBundle(org.osgi.framework.Bundle bundle)
Deprecated.UsestartComponent(Component)
orstartComponentBundle(ComponentBundle)
instead.Installs the specified bundle.- Parameters:
bundle
- Bundle to install- Returns:
true
on success,false
otherwise.
-
updateBundle
@Deprecated boolean updateBundle(org.osgi.framework.Bundle bundle)
Deprecated.UsestartComponent(Component)
orstartComponentBundle(ComponentBundle)
instead.Updates the specified bundle.- Parameters:
bundle
- Bundle to update- Returns:
true
on success,false
otherwise.
-
purgeBundle
boolean purgeBundle(org.osgi.framework.Bundle bundle)
Purges the specified bundle.- Parameters:
bundle
- Bundle to purge- Returns:
true
on success,false
otherwise.
-
purgeComponent
boolean purgeComponent(Component component)
Purges the specified component. Purging removes all persistent information about the installed component, such that installation of a Plugin containing this component will be handled as it was a brand new component plugin rather then an update of an existing component. Some persistent information is only installed upon first installation, like node type registration.- Parameters:
component
- Component to purge- Returns:
true
on success,false
otherwise.
-
uninstallBundle
boolean uninstallBundle(org.osgi.framework.Bundle bundle)
Uninstalls the specified bundle.- Parameters:
bundle
- Bundle to uninstall- Returns:
true
on success,false
otherwise.
-
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
-
isLicensed
boolean isLicensed(String componentID, String nameSpace)
Determine whether a license exists for the given componentID and namespace. If any exception occurs this method will return false. It returns true if and only if the WCB with the given componentid and nameSpace was found in the configuration.xml file and the value of 'available' is true for that WCB.- Parameters:
componentID
- Identifier of the component.nameSpace
- NameSpace of the component.- Returns:
- If true the component has a valid license.
-
isPlatformBundle
boolean isPlatformBundle(org.osgi.framework.Bundle bundle)
Determine whether the given bundle is a platform bundle.- Parameters:
bundle
- the bundle for which to check whether it is a platform bundle- Returns:
- true if it is a platform bundle, false otherwise
-
getOfflineComponentBundle
ComponentBundle getOfflineComponentBundle(org.osgi.framework.Bundle bundle)
Returns the offline component bundle for the given bundle.- Parameters:
bundle
- the bundle- Returns:
- the component bundle
-
startComponentBundle
void startComponentBundle(ComponentBundle componentBundle)
Starts a component bundle. Manages the registration of the component bundle in the persist layer, to be used to distinguish between install or update life-cycle actions.Called when a component bundle service is started. Note that the components the component bundle manages aren't handled.
- Parameters:
componentBundle
- The component bundle to start.
-
startComponent
void startComponent(Component component)
Starts a component. Manages the registration of the component in the persist layer, to be used to distinguish between install or update life-cycle actions.Involves the installing or updating of the component, invoking install/update call-backs on the component, if applicable creates persistence structure for entity/wrapper classes, and starts the component. Called when a component service is started (in
ComponentBase.internalDoStart()
).- Parameters:
component
- The component to start.
-
-