Class GoalsServiceImpl
java.lang.Object
org.apache.unomi.services.impl.goals.GoalsServiceImpl
- All Implemented Interfaces:
EventListener
,GoalsService
,org.osgi.framework.BundleListener
,org.osgi.framework.SynchronousBundleListener
public class GoalsServiceImpl
extends Object
implements GoalsService, org.osgi.framework.SynchronousBundleListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
bundleChanged
(org.osgi.framework.BundleEvent event) getCampaign
(String id) Retrieves the campaign identified by the specified identifierRetrieves theCampaignDetail
associated with the campaign identified with the specified identifiergetCampaignDetails
(Query query) Retrieves campaign details for campaigns matching the specified query.getCampaignGoalMetadatas
(String campaignId) Retrieves the set of Metadata associated with existing campaigns.getCampaignMetadatas
(Query query) Retrieves the set of Metadata associated with existing campaign matching the specifiedQuery
RetrievesCampaignEvent
s matching the specified query.Retrieves the goal associated with the specified identifier.Retrieves the set of Metadata associated with existing goals.getGoalMetadatas
(Query query) Retrieves the set of Metadata associated with existing goals matching the specifiedQuery
getGoalReport
(String goalId) Retrieves the report for the goal identified with the specified identifier.getGoalReport
(String goalId, AggregateQuery query) Retrieves the report for the goal identified with the specified identifier, considering only elements determined by the specifiedAggregateQuery
.void
void
void
removeCampaign
(String id) Removes the campaign associated with the specified identifier, also removing associated rules if needed.void
removeCampaignEvent
(String campaignEventId) Removes the campaign event associated with the specified identifier.void
removeGoal
(String goalId) Removes the goal associated with the specified identifier, also removing associated rules if needed.void
setBundleContext
(org.osgi.framework.BundleContext bundleContext) void
setCampaign
(Campaign campaign) Saves the specified campaign in the context server and creates associatedRule
s if the campaign is enabled.void
setCampaignEvent
(CampaignEvent event) Saves the specified campaign event in the context server.void
setDefinitionsService
(DefinitionsService definitionsService) void
Saves the specified goal in the context server and creates associatedRule
s if the goal is enabled.void
setPersistenceService
(PersistenceService persistenceService) void
setRulesService
(RulesService rulesService)
-
Constructor Details
-
GoalsServiceImpl
public GoalsServiceImpl()
-
-
Method Details
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext) -
setPersistenceService
-
setDefinitionsService
-
setRulesService
-
postConstruct
public void postConstruct() -
preDestroy
public void preDestroy() -
getGoalMetadatas
Description copied from interface:GoalsService
Retrieves the set of Metadata associated with existing goals.- Specified by:
getGoalMetadatas
in interfaceGoalsService
- Returns:
- the set of Metadata associated with existing goals
-
getGoalMetadatas
Description copied from interface:GoalsService
Retrieves the set of Metadata associated with existing goals matching the specifiedQuery
- Specified by:
getGoalMetadatas
in interfaceGoalsService
- Parameters:
query
- the Query used to filter the Goals which metadata we want to retrieve- Returns:
- the set of Metadata associated with existing goals matching the specified
Query
-
getGoal
Description copied from interface:GoalsService
Retrieves the goal associated with the specified identifier.- Specified by:
getGoal
in interfaceGoalsService
- Parameters:
goalId
- the identifier of the goal to retrieve- Returns:
- the goal associated with the specified identifier or
null
if no such goal exists
-
removeGoal
Description copied from interface:GoalsService
Removes the goal associated with the specified identifier, also removing associated rules if needed.- Specified by:
removeGoal
in interfaceGoalsService
- Parameters:
goalId
- the identifier of the goal to be removed
-
setGoal
Description copied from interface:GoalsService
Saves the specified goal in the context server and creates associatedRule
s if the goal is enabled. TODO: rename to saveGoal- Specified by:
setGoal
in interfaceGoalsService
- Parameters:
goal
- the Goal to be saved
-
getCampaignGoalMetadatas
-
getCampaignMetadatas
Description copied from interface:GoalsService
Retrieves the set of Metadata associated with existing campaigns.- Specified by:
getCampaignMetadatas
in interfaceGoalsService
- Returns:
- the set of Metadata associated with existing campaigns
-
getCampaignMetadatas
Description copied from interface:GoalsService
Retrieves the set of Metadata associated with existing campaign matching the specifiedQuery
- Specified by:
getCampaignMetadatas
in interfaceGoalsService
- Parameters:
query
- the Query used to filter the campagins which metadata we want to retrieve- Returns:
- the set of Metadata associated with existing campaigns matching the specified
Query
-
getCampaignDetails
Description copied from interface:GoalsService
Retrieves campaign details for campaigns matching the specified query.- Specified by:
getCampaignDetails
in interfaceGoalsService
- Parameters:
query
- the query specifying which campaigns to retrieve- Returns:
- a
PartialList
of campaign details for the campaigns matching the specified query
-
getCampaignDetail
Description copied from interface:GoalsService
Retrieves theCampaignDetail
associated with the campaign identified with the specified identifier- Specified by:
getCampaignDetail
in interfaceGoalsService
- Parameters:
id
- the identifier of the campaign for which we want to retrieve the details- Returns:
- the CampaignDetail for the campaign identified by the specified identifier or
null
if no such campaign exists
-
getCampaign
Description copied from interface:GoalsService
Retrieves the campaign identified by the specified identifier- Specified by:
getCampaign
in interfaceGoalsService
- Parameters:
id
- the identifier of the campaign we want to retrieve- Returns:
- the campaign associated with the specified identifier or
null
if no such campaign exists
-
removeCampaign
Description copied from interface:GoalsService
Removes the campaign associated with the specified identifier, also removing associated rules if needed.- Specified by:
removeCampaign
in interfaceGoalsService
- Parameters:
id
- the identifier of the campaign to be removed
-
setCampaign
Description copied from interface:GoalsService
Saves the specified campaign in the context server and creates associatedRule
s if the campaign is enabled. TODO: rename to saveCampaign- Specified by:
setCampaign
in interfaceGoalsService
- Parameters:
campaign
- the Campaign to be saved
-
getGoalReport
Description copied from interface:GoalsService
Retrieves the report for the goal identified with the specified identifier.- Specified by:
getGoalReport
in interfaceGoalsService
- Parameters:
goalId
- the identifier of the goal which report we want to retrieve- Returns:
- the report for the specified goal
-
getGoalReport
Description copied from interface:GoalsService
Retrieves the report for the goal identified with the specified identifier, considering only elements determined by the specifiedAggregateQuery
.- Specified by:
getGoalReport
in interfaceGoalsService
- Parameters:
goalId
- the identifier of the goal which report we want to retrievequery
- an AggregateQuery to further specify which elements of the report we want- Returns:
- the report for the specified goal and query
-
getEvents
Description copied from interface:GoalsService
RetrievesCampaignEvent
s matching the specified query.- Specified by:
getEvents
in interfaceGoalsService
- Parameters:
query
- the Query specifying which CampaignEvents to retrieve- Returns:
- a
PartialList
of campaign events matching the specified query
-
setCampaignEvent
Description copied from interface:GoalsService
Saves the specified campaign event in the context server. TODO: rename to saveCampaignEvent- Specified by:
setCampaignEvent
in interfaceGoalsService
- Parameters:
event
- the CampaignEvent to be saved
-
removeCampaignEvent
Description copied from interface:GoalsService
Removes the campaign event associated with the specified identifier.- Specified by:
removeCampaignEvent
in interfaceGoalsService
- Parameters:
campaignEventId
- the identifier of the campaign event to be removed
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event) - Specified by:
bundleChanged
in interfaceorg.osgi.framework.BundleListener
-