Package org.apache.unomi.rest.endpoints
Class GoalsServiceEndPoint
java.lang.Object
org.apache.unomi.rest.endpoints.GoalsServiceEndPoint
@Produces("application/json")
@Consumes("application/json")
@Path("/goals")
public class GoalsServiceEndPoint
extends Object
A JAX-RS endpoint to manage
Goals and related information.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves 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 specifiedQuerygetGoalReport(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.voidremoveGoal(String goalId) Removes the goal associated with the specified identifier, also removing associated rules if needed.voidSaves the specified goal in the context server and creates associatedRules if the goal is enabled.voidsetGoalsService(GoalsService goalsService)
-
Constructor Details
-
GoalsServiceEndPoint
public GoalsServiceEndPoint()
-
-
Method Details
-
setGoalsService
-
getGoalMetadatas
Retrieves the set of Metadata associated with existing goals.- Returns:
- the set of Metadata associated with existing goals
-
setGoal
Saves the specified goal in the context server and creates associatedRules if the goal is enabled.- Parameters:
goal- the Goal to be saved
-
getGoalMetadatas
Retrieves the set of Metadata associated with existing goals matching the specifiedQuery- 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
Retrieves the goal associated with the specified identifier.- Parameters:
goalId- the identifier of the goal to retrieve- Returns:
- the goal associated with the specified identifier or
nullif no such goal exists
-
removeGoal
Removes the goal associated with the specified identifier, also removing associated rules if needed.- Parameters:
goalId- the identifier of the goal to be removed
-
getGoalReport
Retrieves the report for the goal identified with the specified identifier.- Parameters:
goalId- the identifier of the goal which report we want to retrieve- Returns:
- the report for the specified goal
-
getGoalReport
@POST @Path("/{goalID}/report") public GoalReport getGoalReport(@PathParam("goalID") String goalId, AggregateQuery query) Retrieves the report for the goal identified with the specified identifier, considering only elements determined by the specifiedAggregateQuery.- Parameters:
goalId- the identifier of the goal which report we want to retrievequery- anAggregateQueryto further specify which elements of the report we want- Returns:
- the report for the specified goal and query
-