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 Rules.
  • Constructor Details

    • RulesServiceEndPoint

      public RulesServiceEndPoint()
  • Method Details

    • 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 specified Query.
      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

      @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 PartialList of 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 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

      @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 anymore
      TODO: remove