Class ScoringServiceEndPoint

  • @Produces("application/json")
    public class ScoringServiceEndPoint
    extends Object
    A JAX-RS endpoint to manage Scorings
    • Constructor Detail

      • ScoringServiceEndPoint

        public ScoringServiceEndPoint()
    • Method Detail

      • setSegmentService

        public void setSegmentService​(SegmentService segmentService)
      • getScoringMetadatas

        public List<Metadata> getScoringMetadatas​(@QueryParam("offset") @DefaultValue("0")
                                                  int offset,
                                                  @QueryParam("size") @DefaultValue("50")
                                                  int size,
                                                  String sortBy)
        Retrieves the set of all scoring metadata.
        offset - zero or a positive integer specifying the position of the first element in the total ordered collection of matching elements
        size - a positive integer specifying how many matching elements should be retrieved or -1 if all of them should be retrieved
        sortBy - an optional (null if no sorting is required) String of comma (,) separated property names on which ordering should be performed, ordering elements according to the property order in the String, considering each in turn and moving on to the next one in case of equality of all preceding ones. Each property name is optionally followed by a column (:) and an order specifier: asc or desc.
        the set of all scoring metadata
      • getScoringMetadatas

        public PartialList<Metadata> getScoringMetadatas​(Query query)
        Retrieves the set of scoring metadata for scorings matching the specified query.
        query - the query the scorings must match for their metadata to be retrieved
        the set of scoring metadata for scorings matching the specified query
      • getScoringDefinition

        public Scoring getScoringDefinition​(@PathParam("scoringID")
                                            String scoringId)
        Retrieves the scoring identified by the specified identifier.
        scoringId - the identifier of the scoring to be retrieved
        the scoring identified by the specified identifier or null if no such scoring exists
      • setScoringDefinition

        public void setScoringDefinition​(Scoring scoring)
        Persists the specified scoring in the context server.
        scoring - the scoring to be persisted
      • createScoringDefinition

        public void createScoringDefinition​(@PathParam("scope")
                                            String scope,
                                            String scoringId,
                                            String scoringName,
                                            String scoringDescription)
        Creates a scoring with the specified scope, identifier, name and description from form-encoded data.
        scope - the scope for the new scoring
        scoringId - the identifier for the new scoring
        scoringName - the name of the new scoring
        scoringDescription - the description of the new scoring
        See Also:
        Item's description for a discussion of scope
      • removeScoringDefinition

        public DependentMetadata removeScoringDefinition​(@PathParam("scoringID")
                                                         String scoringId,
                                                         boolean validate)
        Removes the scoring definition identified by the specified identifier. We can specify that we want the operation to be validated beforehand so that we can know if any other segment that might use the segment we're trying to delete as a condition might be impacted. If validate is set to false, no validation is performed. If set to true, we will first check if any segment or scoring depends on the scoring we're trying to delete and if so we will not delete the scoring but rather return the list of the metadata of the impacted items. If no dependents are found, then we properly delete the scoring.
        scoringId - the identifier of the scoring we want to delete
        validate - whether or not to perform validation
        a list of impacted items metadata if any or an empty list if none were found or validation was skipped
      • getScoringDependentMetadata

        public DependentMetadata getScoringDependentMetadata​(@PathParam("scoringID")
                                                             String scoringId)
        Retrieves the list of Segment and Scoring metadata depending on the specified scoring. A segment or scoring is depending on a segment if it includes a scoringCondition with a test on this scoring.
        scoringId - the segment identifier
        a list of Segment/Scoring Metadata depending on the specified scoring
      • resetQueries

        public void resetQueries()
        As of version 1.1.0-incubating, not needed anymore
        TODO: remove