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 Constructor Description GoalsServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbundleChanged(org.osgi.framework.BundleEvent event)CampaigngetCampaign(String id)Retrieves the campaign identified by the specified identifierCampaignDetailgetCampaignDetail(String id)Retrieves theCampaignDetailassociated with the campaign identified with the specified identifierPartialList<CampaignDetail>getCampaignDetails(Query query)Retrieves campaign details for campaigns matching the specified query.Set<Metadata>getCampaignGoalMetadatas(String campaignId)Set<Metadata>getCampaignMetadatas()Retrieves the set of Metadata associated with existing campaigns.Set<Metadata>getCampaignMetadatas(Query query)Retrieves the set of Metadata associated with existing campaign matching the specifiedQueryPartialList<CampaignEvent>getEvents(Query query)RetrievesCampaignEvents matching the specified query.GoalgetGoal(String goalId)Retrieves the goal associated with the specified identifier.Set<Metadata>getGoalMetadatas()Retrieves the set of Metadata associated with existing goals.Set<Metadata>getGoalMetadatas(Query query)Retrieves the set of Metadata associated with existing goals matching the specifiedQueryGoalReportgetGoalReport(String goalId)Retrieves the report for the goal identified with the specified identifier.GoalReportgetGoalReport(String goalId, AggregateQuery query)Retrieves the report for the goal identified with the specified identifier, considering only elements determined by the specifiedAggregateQuery.voidpostConstruct()voidpreDestroy()voidremoveCampaign(String id)Removes the campaign associated with the specified identifier, also removing associated rules if needed.voidremoveCampaignEvent(String campaignEventId)Removes the campaign event associated with the specified identifier.voidremoveGoal(String goalId)Removes the goal associated with the specified identifier, also removing associated rules if needed.voidsetBundleContext(org.osgi.framework.BundleContext bundleContext)voidsetCampaign(Campaign campaign)Saves the specified campaign in the context server and creates associatedRules if the campaign is enabled.voidsetCampaignEvent(CampaignEvent event)Saves the specified campaign event in the context server.voidsetDefinitionsService(DefinitionsService definitionsService)voidsetGoal(Goal goal)Saves the specified goal in the context server and creates associatedRules if the goal is enabled.voidsetPersistenceService(PersistenceService persistenceService)voidsetRulesService(RulesService rulesService)
-
-
-
Method Detail
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
-
setPersistenceService
public void setPersistenceService(PersistenceService persistenceService)
-
setDefinitionsService
public void setDefinitionsService(DefinitionsService definitionsService)
-
setRulesService
public void setRulesService(RulesService rulesService)
-
postConstruct
public void postConstruct()
-
preDestroy
public void preDestroy()
-
getGoalMetadatas
public Set<Metadata> getGoalMetadatas()
Description copied from interface:GoalsServiceRetrieves the set of Metadata associated with existing goals.- Specified by:
getGoalMetadatasin interfaceGoalsService- Returns:
- the set of Metadata associated with existing goals
-
getGoalMetadatas
public Set<Metadata> getGoalMetadatas(Query query)
Description copied from interface:GoalsServiceRetrieves the set of Metadata associated with existing goals matching the specifiedQuery- Specified by:
getGoalMetadatasin 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
public Goal getGoal(String goalId)
Description copied from interface:GoalsServiceRetrieves the goal associated with the specified identifier.- Specified by:
getGoalin interfaceGoalsService- Parameters:
goalId- the identifier of the goal to retrieve- Returns:
- the goal associated with the specified identifier or
nullif no such goal exists
-
removeGoal
public void removeGoal(String goalId)
Description copied from interface:GoalsServiceRemoves the goal associated with the specified identifier, also removing associated rules if needed.- Specified by:
removeGoalin interfaceGoalsService- Parameters:
goalId- the identifier of the goal to be removed
-
setGoal
public void setGoal(Goal goal)
Description copied from interface:GoalsServiceSaves the specified goal in the context server and creates associatedRules if the goal is enabled. TODO: rename to saveGoal- Specified by:
setGoalin interfaceGoalsService- Parameters:
goal- the Goal to be saved
-
getCampaignMetadatas
public Set<Metadata> getCampaignMetadatas()
Description copied from interface:GoalsServiceRetrieves the set of Metadata associated with existing campaigns.- Specified by:
getCampaignMetadatasin interfaceGoalsService- Returns:
- the set of Metadata associated with existing campaigns
-
getCampaignMetadatas
public Set<Metadata> getCampaignMetadatas(Query query)
Description copied from interface:GoalsServiceRetrieves the set of Metadata associated with existing campaign matching the specifiedQuery- Specified by:
getCampaignMetadatasin 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
public PartialList<CampaignDetail> getCampaignDetails(Query query)
Description copied from interface:GoalsServiceRetrieves campaign details for campaigns matching the specified query.- Specified by:
getCampaignDetailsin interfaceGoalsService- Parameters:
query- the query specifying which campaigns to retrieve- Returns:
- a
PartialListof campaign details for the campaigns matching the specified query
-
getCampaignDetail
public CampaignDetail getCampaignDetail(String id)
Description copied from interface:GoalsServiceRetrieves theCampaignDetailassociated with the campaign identified with the specified identifier- Specified by:
getCampaignDetailin 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
nullif no such campaign exists
-
getCampaign
public Campaign getCampaign(String id)
Description copied from interface:GoalsServiceRetrieves the campaign identified by the specified identifier- Specified by:
getCampaignin interfaceGoalsService- Parameters:
id- the identifier of the campaign we want to retrieve- Returns:
- the campaign associated with the specified identifier or
nullif no such campaign exists
-
removeCampaign
public void removeCampaign(String id)
Description copied from interface:GoalsServiceRemoves the campaign associated with the specified identifier, also removing associated rules if needed.- Specified by:
removeCampaignin interfaceGoalsService- Parameters:
id- the identifier of the campaign to be removed
-
setCampaign
public void setCampaign(Campaign campaign)
Description copied from interface:GoalsServiceSaves the specified campaign in the context server and creates associatedRules if the campaign is enabled. TODO: rename to saveCampaign- Specified by:
setCampaignin interfaceGoalsService- Parameters:
campaign- the Campaign to be saved
-
getGoalReport
public GoalReport getGoalReport(String goalId)
Description copied from interface:GoalsServiceRetrieves the report for the goal identified with the specified identifier.- Specified by:
getGoalReportin interfaceGoalsService- Parameters:
goalId- the identifier of the goal which report we want to retrieve- Returns:
- the report for the specified goal
-
getGoalReport
public GoalReport getGoalReport(String goalId, AggregateQuery query)
Description copied from interface:GoalsServiceRetrieves the report for the goal identified with the specified identifier, considering only elements determined by the specifiedAggregateQuery.- Specified by:
getGoalReportin 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
public PartialList<CampaignEvent> getEvents(Query query)
Description copied from interface:GoalsServiceRetrievesCampaignEvents matching the specified query.- Specified by:
getEventsin interfaceGoalsService- Parameters:
query- the Query specifying which CampaignEvents to retrieve- Returns:
- a
PartialListof campaign events matching the specified query
-
setCampaignEvent
public void setCampaignEvent(CampaignEvent event)
Description copied from interface:GoalsServiceSaves the specified campaign event in the context server. TODO: rename to saveCampaignEvent- Specified by:
setCampaignEventin interfaceGoalsService- Parameters:
event- the CampaignEvent to be saved
-
removeCampaignEvent
public void removeCampaignEvent(String campaignEventId)
Description copied from interface:GoalsServiceRemoves the campaign event associated with the specified identifier.- Specified by:
removeCampaignEventin interfaceGoalsService- Parameters:
campaignEventId- the identifier of the campaign event to be removed
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event)
- Specified by:
bundleChangedin interfaceorg.osgi.framework.BundleListener
-
-