nl.gx.webmanager.wcb
Interface ComponentManager


public interface ComponentManager

Interface for the componentmanager.

Author:
bramk

Method Summary
 void addUnlicensedComponent(java.lang.String componentID, java.lang.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(java.lang.String typeId, java.lang.String id)
          Get a registered component by typeId and id.
 int getComponentCount(java.lang.String typeId)
          Gets the number of registered components for a componentType.
 Component[] getComponents(java.lang.String typeId)
          Get all registered components for a componentType.
 ComponentType getComponentType(java.lang.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.
 java.util.Map<java.lang.String,java.lang.String> getUnlicensedComponents()
          Returns all unlicensed components installed on the system.
 boolean installBundle(org.osgi.framework.Bundle bundle)
          Deprecated. Use startComponent(Component) or startComponentBundle(ComponentBundle) instead.
 boolean isLicensed(ComponentDefinition componentDefinition)
          Returns if a valid license is installed for the given component definition.
 boolean isLicensed(java.lang.String componentID, java.lang.String nameSpace)
          Determine whether a license exists for the given componentID and namespace.
 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.
 void removeComponentNode(java.lang.String componentId)
          Removes the nodes of a given component identified by its id from the JCR.
 void removeUnlicensedComponent(java.lang.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. Use startComponent(Component) or startComponentBundle(ComponentBundle) instead.
 

Method Detail

getFrameworkConfig

FrameworkConfig getFrameworkConfig()
Gets the frameworkConfig.

Returns:
the frameworkConfig

getComponentType

ComponentType getComponentType(java.lang.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(java.lang.String typeId,
                       java.lang.String id)
Get a registered component by typeId and id.

Parameters:
typeId - if of the the componentType
id - of the component
Returns:
a component or null

getComponents

Component[] getComponents(java.lang.String typeId)
Get all registered components for a componentType.

Parameters:
typeId - id of the componentType
Returns:
array of registered components

getComponentCount

int getComponentCount(java.lang.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(java.lang.String componentID,
                            java.lang.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 component
componentTypeID - identifies the component type

removeUnlicensedComponent

void removeUnlicensedComponent(java.lang.String componentID)
Removes the component from the collection of unlicensed components.

Parameters:
componentID - identifies the component

getUnlicensedComponents

java.util.Map<java.lang.String,java.lang.String> getUnlicensedComponents()
Returns all unlicensed components installed on the system.

Returns:
Map of componentID's and associated componentTypeId's.

removeComponentNode

void removeComponentNode(java.lang.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. Use startComponent(Component) or startComponentBundle(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. Use startComponent(Component) or startComponentBundle(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.

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(java.lang.String componentID,
                   java.lang.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.
See Also:
ComponentBundle#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.


Copyright © 2007-2010 GX creative online development BV. All Rights Reserved.