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
Goal
s 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 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
removeGoal
(String goalId) Removes the goal associated with the specified identifier, also removing associated rules if needed.void
Saves the specified goal in the context server and creates associatedRule
s if the goal is enabled.void
setGoalsService
(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 associatedRule
s 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
null
if 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
- anAggregateQuery
to further specify which elements of the report we want- Returns:
- the report for the specified goal and query
-