Package org.apache.unomi.rest.endpoints
Class GoalsServiceEndPoint
- java.lang.Object
-
- org.apache.unomi.rest.endpoints.GoalsServiceEndPoint
-
-
Constructor Summary
Constructors Constructor Description GoalsServiceEndPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Goal
getGoal(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 specifiedQuery
GoalReport
getGoalReport(String goalId)
Retrieves the report for the goal identified with the specified identifier.GoalReport
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
setGoal(Goal goal)
Saves the specified goal in the context server and creates associatedRule
s if the goal is enabled.void
setGoalsService(GoalsService goalsService)
-
-
-
Method Detail
-
setGoalsService
public void setGoalsService(GoalsService goalsService)
-
getGoalMetadatas
@GET @Path("/") public Set<Metadata> getGoalMetadatas()
Retrieves the set of Metadata associated with existing goals.- Returns:
- the set of Metadata associated with existing goals
-
setGoal
@POST @Path("/") public void setGoal(Goal goal)
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
@POST @Path("/query") public Set<Metadata> getGoalMetadatas(Query query)
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
@GET @Path("/{goalId}") public Goal getGoal(@PathParam("goalId") String goalId)
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
@DELETE @Path("/{goalId}") public void removeGoal(@PathParam("goalId") String goalId)
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
@GET @Path("/{goalID}/report") public GoalReport getGoalReport(@PathParam("goalID") String goalId)
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
-
-