Package org.apache.unomi.rest.endpoints
Class RulesServiceEndPoint
- java.lang.Object
-
- org.apache.unomi.rest.endpoints.RulesServiceEndPoint
-
-
Constructor Summary
Constructors Constructor Description RulesServiceEndPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Map<String,RuleStatistics>getAllRuleStatistics()Retrieves the rule statistics for all known rules.RulegetRule(String ruleId)Retrieves the rule identified by the specified identifier.PartialList<Rule>getRuleDetails(Query query)Retrieves rule details for rules matching the specified query.Set<Metadata>getRuleMetadatas()Retrieves the metadata for all known rules.PartialList<Metadata>getRuleMetadatas(Query query)Retrieves rule metadatas for rules matching the specifiedQuery.RuleStatisticsgetRuleStatistics(String ruleId)Retrieves the statistics for the rule with the specified identifiervoidremoveRule(String ruleId)Deletes the rule identified by the specified identifier.voidresetAllRuleStatistics()Deletes all the rule statistics, which basically resets them to 0.voidresetQueries()Deprecated.As of version 1.1.0-incubating, not needed anymorevoidsetRule(Rule rule)Persists the specified rule to the context server.voidsetRulesService(RulesService rulesService)
-
-
-
Method Detail
-
setRulesService
public void setRulesService(RulesService rulesService)
-
getRuleMetadatas
@GET @Path("/") public Set<Metadata> getRuleMetadatas()Retrieves the metadata for all known rules. Note that it only includes the rules in memory, not those persisted in storage.- Returns:
- the Set of known metadata
-
setRule
@POST @Path("/") public void setRule(Rule rule)Persists the specified rule to the context server.- Parameters:
rule- the rule to be persisted
-
getAllRuleStatistics
@GET @Path("/statistics") public Map<String,RuleStatistics> getAllRuleStatistics()Retrieves the rule statistics for all known rules.- Returns:
- a map that contains the rule key as a key and as the value a @RuleStatistics object.
-
resetAllRuleStatistics
@DELETE @Path("/statistics") public void resetAllRuleStatistics()Deletes all the rule statistics, which basically resets them to 0.
-
getRuleMetadatas
@POST @Path("/query") public PartialList<Metadata> getRuleMetadatas(Query query)Retrieves rule metadatas for rules matching the specifiedQuery.- Parameters:
query- the query the rules which metadata we want to retrieve must match- Returns:
- a
PartialListof rules metadata for the rules matching the specified query
-
getRuleDetails
@POST @Path("/query/detailed") public PartialList<Rule> getRuleDetails(Query query)Retrieves rule details for rules matching the specified query.- Parameters:
query- the query specifying which rules to retrieve- Returns:
- a
PartialListof rule details for the rules matching the specified query
-
getRule
@GET @Path("/{ruleId}") public Rule getRule(@PathParam("ruleId") String ruleId)Retrieves the rule identified by the specified identifier.- Parameters:
ruleId- the identifier of the rule we want to retrieve- Returns:
- the rule identified by the specified identifier or
nullif no such rule exists.
-
getRuleStatistics
@GET @Path("/{ruleId}/statistics") public RuleStatistics getRuleStatistics(@PathParam("ruleId") String ruleId)Retrieves the statistics for the rule with the specified identifier- Parameters:
ruleId- the identifier of the rule we want to retrieve- Returns:
- the statistics for the specified rule or
nullif no such rule exists.
-
removeRule
@DELETE @Path("/{ruleId}") public void removeRule(@PathParam("ruleId") String ruleId)Deletes the rule identified by the specified identifier.- Parameters:
ruleId- the identifier of the rule we want to delete
-
resetQueries
@Deprecated @GET @Path("/resetQueries") public void resetQueries()
Deprecated.As of version 1.1.0-incubating, not needed anymoreTODO: remove
-
-