Package org.apache.unomi.rest.endpoints
Class RulesServiceEndPoint
java.lang.Object
org.apache.unomi.rest.endpoints.RulesServiceEndPoint
@Produces("application/json")
@Consumes("application/json")
@Path("/rules")
public class RulesServiceEndPoint
extends Object
A JAX-RS endpoint to manage
Rule
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the rule statistics for all known rules.Retrieves the rule identified by the specified identifier.getRuleDetails
(Query query) Retrieves rule details for rules matching the specified query.Retrieves the metadata for all known rules.getRuleMetadatas
(Query query) Retrieves rule metadatas for rules matching the specifiedQuery
.getRuleStatistics
(String ruleId) Retrieves the statistics for the rule with the specified identifiervoid
removeRule
(String ruleId) Deletes the rule identified by the specified identifier.void
Deletes all the rule statistics, which basically resets them to 0.void
Deprecated.As of version 1.1.0-incubating, not needed anymorevoid
Persists the specified rule to the context server.void
setRulesService
(RulesService rulesService)
-
Constructor Details
-
RulesServiceEndPoint
public RulesServiceEndPoint()
-
-
Method Details
-
setRulesService
-
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
Persists the specified rule to the context server.- Parameters:
rule
- the rule to be persisted
-
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
Retrieves rule metadatas for rules matching the specifiedQuery
.- Parameters:
query
- the query the rules which metadata we want to retrieve must match- Returns:
- a
PartialList
of rules metadata for the rules matching the specified query
-
getRuleDetails
Retrieves rule details for rules matching the specified query.- Parameters:
query
- the query specifying which rules to retrieve- Returns:
- a
PartialList
of rule details for the rules matching the specified query
-
getRule
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
null
if 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
null
if no such rule exists.
-
removeRule
Deletes the rule identified by the specified identifier.- Parameters:
ruleId
- the identifier of the rule we want to delete
-
resetQueries
Deprecated.As of version 1.1.0-incubating, not needed anymoreTODO: remove
-