Class DefinitionsServiceImpl
java.lang.Object
org.apache.unomi.services.impl.definitions.DefinitionsServiceImpl
- All Implemented Interfaces:
EventListener,DefinitionsService,org.osgi.framework.BundleListener,org.osgi.framework.SynchronousBundleListener
public class DefinitionsServiceImpl
extends Object
implements DefinitionsService, org.osgi.framework.SynchronousBundleListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbundleChanged(org.osgi.framework.BundleEvent event) extractConditionBySystemTag(Condition rootCondition, String systemTag) Retrieves a condition matching the specified system tag identifier from the specified root condition.extractConditionByTag(Condition rootCondition, String tag) Deprecated.extractConditionsByType(Condition rootCondition, String typeId) Retrieves all conditions of the specified type from the specified root condition.getActionType(String id) Retrieves the action type associated with the specified identifier.Retrieves the set of action types with the specified system tag.getActionTypeByTag(String tag) Retrieves the set of action types with the specified tag.Retrieves all known action types.Retrieves all condition types.Retrieves all known value types.Retrieves a new instance of a ConditionBuilder to help to build conditions.Retrieves the condition type associated with the specified identifier.Retrieves the set of condition types with the specified system tag.Retrieves the set of condition types with the specified tag.Retrieves the property merge strategy type associated with the specified identifier.Retrieves a Map of plugin identifier to a list of plugin types defined by that particular plugin.getValueType(String id) Retrieves the value type associated with the specified identifier.getValueTypeByTag(String tag) Retrieves the set of value types with the specified tag.voidvoidvoidrefresh()Forces a refresh of the definitions from the persistence service.voidreloadTypes(boolean refresh) voidRemove the action typevoidRemove the condition typebooleanresolveConditionType(Condition rootCondition) Resolves (if possible) theConditionTypes for the specified condition and its sub-conditions (if any) from the type identifiers existing on the specified condition TODO: remove from API and move to a different class?voidsetActionType(ActionType actionType) Stores the action typevoidsetBundleContext(org.osgi.framework.BundleContext bundleContext) voidsetConditionType(ConditionType conditionType) Stores the condition typevoidsetDefinitionsRefreshInterval(long definitionsRefreshInterval) voidsetPersistenceService(PersistenceService persistenceService) voidsetSchedulerService(SchedulerService schedulerService)
-
Constructor Details
-
DefinitionsServiceImpl
public DefinitionsServiceImpl()
-
-
Method Details
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext) -
setPersistenceService
-
setSchedulerService
-
setDefinitionsRefreshInterval
public void setDefinitionsRefreshInterval(long definitionsRefreshInterval) -
postConstruct
public void postConstruct() -
reloadTypes
public void reloadTypes(boolean refresh) -
preDestroy
public void preDestroy() -
getTypesByPlugin
Description copied from interface:DefinitionsServiceRetrieves a Map of plugin identifier to a list of plugin types defined by that particular plugin.- Specified by:
getTypesByPluginin interfaceDefinitionsService- Returns:
- a Map of plugin identifier to a list of plugin types defined by that particular plugin
-
getAllConditionTypes
Description copied from interface:DefinitionsServiceRetrieves all condition types.- Specified by:
getAllConditionTypesin interfaceDefinitionsService- Returns:
- a Collection of all collection types
-
getConditionTypesByTag
Description copied from interface:DefinitionsServiceRetrieves the set of condition types with the specified tag.- Specified by:
getConditionTypesByTagin interfaceDefinitionsService- Parameters:
tag- the tag marking the condition types we want to retrieve- Returns:
- the set of condition types with the specified tag (and its sub-tags, if specified)
-
getConditionTypesBySystemTag
Description copied from interface:DefinitionsServiceRetrieves the set of condition types with the specified system tag.- Specified by:
getConditionTypesBySystemTagin interfaceDefinitionsService- Parameters:
tag- the system tag marking the condition types we want to retrieve- Returns:
- the set of condition types with the specified tag (and its sub-tags, if specified)
-
getConditionType
Description copied from interface:DefinitionsServiceRetrieves the condition type associated with the specified identifier.- Specified by:
getConditionTypein interfaceDefinitionsService- Parameters:
id- the identifier of the condition type to retrieve- Returns:
- the condition type associated with the specified identifier or
nullif no such condition type exists
-
removeConditionType
Description copied from interface:DefinitionsServiceRemove the condition type- Specified by:
removeConditionTypein interfaceDefinitionsService- Parameters:
id- the condition type to remove
-
setConditionType
Description copied from interface:DefinitionsServiceStores the condition type- Specified by:
setConditionTypein interfaceDefinitionsService- Parameters:
conditionType- the condition type to store
-
getAllActionTypes
Description copied from interface:DefinitionsServiceRetrieves all known action types.- Specified by:
getAllActionTypesin interfaceDefinitionsService- Returns:
- all known action types
-
getActionTypeByTag
Description copied from interface:DefinitionsServiceRetrieves the set of action types with the specified tag.- Specified by:
getActionTypeByTagin interfaceDefinitionsService- Parameters:
tag- the tag marking the action types we want to retrieve- Returns:
- the set of action types with the specified tag
-
getActionTypeBySystemTag
Description copied from interface:DefinitionsServiceRetrieves the set of action types with the specified system tag.- Specified by:
getActionTypeBySystemTagin interfaceDefinitionsService- Parameters:
tag- the system tag marking the action types we want to retrieve- Returns:
- the set of action types with the specified tag
-
getActionType
Description copied from interface:DefinitionsServiceRetrieves the action type associated with the specified identifier.- Specified by:
getActionTypein interfaceDefinitionsService- Parameters:
id- the identifier of the action type to retrieve- Returns:
- the action type associated with the specified identifier or
nullif no such action type exists
-
removeActionType
Description copied from interface:DefinitionsServiceRemove the action type- Specified by:
removeActionTypein interfaceDefinitionsService- Parameters:
id- the action type to remove
-
setActionType
Description copied from interface:DefinitionsServiceStores the action type- Specified by:
setActionTypein interfaceDefinitionsService- Parameters:
actionType- the action type to store
-
getAllValueTypes
Description copied from interface:DefinitionsServiceRetrieves all known value types.- Specified by:
getAllValueTypesin interfaceDefinitionsService- Returns:
- all known value types
-
getValueTypeByTag
Description copied from interface:DefinitionsServiceRetrieves the set of value types with the specified tag.- Specified by:
getValueTypeByTagin interfaceDefinitionsService- Parameters:
tag- the tag marking the value types we want to retrieve- Returns:
- the set of value types with the specified tag
-
getValueType
Description copied from interface:DefinitionsServiceRetrieves the value type associated with the specified identifier.- Specified by:
getValueTypein interfaceDefinitionsService- Parameters:
id- the identifier of the value type to retrieve- Returns:
- the value type associated with the specified identifier or
nullif no such value type exists
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event) - Specified by:
bundleChangedin interfaceorg.osgi.framework.BundleListener
-
getPropertyMergeStrategyType
Description copied from interface:DefinitionsServiceRetrieves the property merge strategy type associated with the specified identifier.- Specified by:
getPropertyMergeStrategyTypein interfaceDefinitionsService- Parameters:
id- the identifier of the property merge strategy type to retrieve- Returns:
- the property merge strategy type associated with the specified identifier or
nullif no such property merge strategy type exists
-
extractConditionsByType
Description copied from interface:DefinitionsServiceRetrieves all conditions of the specified type from the specified root condition. TODO: remove?- Specified by:
extractConditionsByTypein interfaceDefinitionsService- Parameters:
rootCondition- the condition from which we want to extract all conditions with the specified typetypeId- the identifier of the condition type we want conditions to extract to match- Returns:
- a set of conditions contained in the specified root condition and matching the specified condition type or an empty set if no such condition exists
-
extractConditionByTag
Deprecated.As of version 1.2.0-incubating, useextractConditionBySystemTag(Condition, String)insteadDescription copied from interface:DefinitionsServiceRetrieves a condition matching the specified tag identifier from the specified root condition. TODO: remove from API and move to a different class? TODO: purpose and behavior not clear- Specified by:
extractConditionByTagin interfaceDefinitionsService- Parameters:
rootCondition- the root condition where to start the extraction by classtag- the tag to use to extract the condition- Returns:
- Condition the condition that has been found matching the tag, or null if none matched
-
extractConditionBySystemTag
Description copied from interface:DefinitionsServiceRetrieves a condition matching the specified system tag identifier from the specified root condition.- Specified by:
extractConditionBySystemTagin interfaceDefinitionsService- Parameters:
rootCondition- the root condition where to start the extraction by classsystemTag- the tag to use to extract the condition- Returns:
- Condition the condition that has been found matching the tag, or null if none matched
-
resolveConditionType
Description copied from interface:DefinitionsServiceResolves (if possible) theConditionTypes for the specified condition and its sub-conditions (if any) from the type identifiers existing on the specified condition TODO: remove from API and move to a different class?- Specified by:
resolveConditionTypein interfaceDefinitionsService- Parameters:
rootCondition- the condition for which we want to resolve the condition types from the existing condition type identifiers- Returns:
true
-
refresh
public void refresh()Description copied from interface:DefinitionsServiceForces a refresh of the definitions from the persistence service. Warning: this may seriously impact performance so it is recommended to use this in specific cases such as for example in integration tests.- Specified by:
refreshin interfaceDefinitionsService
-
getConditionBuilder
Description copied from interface:DefinitionsServiceRetrieves a new instance of a ConditionBuilder to help to build conditions.- Specified by:
getConditionBuilderin interfaceDefinitionsService- Returns:
- a new instance of a ConditionBuilder
-
extractConditionBySystemTag(Condition, String)instead