Constructor and Description |
---|
SegmentServiceEndPoint() |
Modifier and Type | Method and Description |
---|---|
PartialList<Metadata> |
getListMetadatas(Query query)
Retrieves the metadata for segments matching the specified
Query . |
PartialList<Profile> |
getMatchingIndividuals(String segmentId,
int offset,
int size,
String sortBy)
Retrieves a list of profiles matching the conditions defined by the segment identified by the specified identifier, ordered according to the specified
sortBy
String and and paged: only size of them are retrieved, starting with the offset -th one. |
long |
getMatchingIndividualsCount(String segmentId)
Retrieves the number of profiles matching the conditions defined by the segment identified by the specified identifier.
|
Segment |
getSegmentDefinition(String segmentId)
Retrieves the segment identified by the specified identifier.
|
DependentMetadata |
getSegmentDependentMetadata(String segmentId)
Retrieves the list of Segment and Scoring metadata depending on the specified segment.
|
List<Metadata> |
getSegmentMetadatas(int offset,
int size,
String sortBy)
Retrieves the 50 first segment metadatas.
|
Boolean |
isProfileInSegment(Profile profile,
String segmentId)
Determines whether the specified profile is part of the segment identified by the specified identifier.
|
DependentMetadata |
removeSegmentDefinition(String segmentId,
boolean validate)
Removes the segment definition identified by the specified identifier.
|
void |
resetQueries()
Deprecated.
As of version 1.1.0-incubating, not needed anymore
|
void |
setSegmentDefinition(Segment segment)
Persists the specified segment in the context server.
|
void |
setSegmentService(SegmentService segmentService) |
public void setSegmentService(SegmentService segmentService)
@GET @Path(value="/{segmentID}/match") public PartialList<Profile> getMatchingIndividuals(@PathParam(value="segmentID") String segmentId, @QueryParam(value="offset") @DefaultValue(value="0") int offset, @QueryParam(value="size") @DefaultValue(value="50") int size, @QueryParam(value="sort") String sortBy)
sortBy
String and and paged: only size
of them are retrieved, starting with the offset
-th one.segmentId
- the identifier of the segment for which we want to retrieve matching profilesoffset
- zero or a positive integer specifying the position of the first element in the total ordered collection of matching elementssize
- a positive integer specifying how many matching elements should be retrieved or -1
if all of them should be retrievedsortBy
- 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
.PartialList
of profiles matching the specified segment@GET @Path(value="/{segmentID}/count") public long getMatchingIndividualsCount(@PathParam(value="segmentID") String segmentId)
segmentId
- the identifier of the segment for which we want to retrieve matching profiles@GET @Path(value="/{segmentID}/match/{profile}") public Boolean isProfileInSegment(@PathParam(value="profile") Profile profile, @PathParam(value="segmentID") String segmentId)
profile
- the profile we want to checksegmentId
- the identifier of the segment against which we want to check the profiletrue
if the specified profile is in the specified segment, false
otherwise@GET @Path(value="/") public List<Metadata> getSegmentMetadatas(@QueryParam(value="offset") @DefaultValue(value="0") int offset, @QueryParam(value="size") @DefaultValue(value="50") int size, @QueryParam(value="sort") String sortBy)
offset
- zero or a positive integer specifying the position of the first element in the total ordered collection of matching elementssize
- a positive integer specifying how many matching elements should be retrieved or -1
if all of them should be retrievedsortBy
- 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
.@GET @Path(value="/{segmentID}/impacted") public DependentMetadata getSegmentDependentMetadata(@PathParam(value="segmentID") String segmentId)
segmentId
- the segment identifier@POST @Path(value="/") public void setSegmentDefinition(Segment segment)
segment
- the segment to be persisted@POST @Path(value="/query") public PartialList<Metadata> getListMetadatas(Query query)
Query
.query
- the query that the segments must match for their metadata to be retrievedPartialList
of segment metadata@GET @Path(value="/{segmentID}") public Segment getSegmentDefinition(@PathParam(value="segmentID") String segmentId)
segmentId
- the identifier of the segment to be retrievednull
if no such segment exists@DELETE @Path(value="/{segmentID}") public DependentMetadata removeSegmentDefinition(@PathParam(value="segmentID") String segmentId, @QueryParam(value="validate") boolean validate)
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 segment we're trying to delete and if so we will not delete the
segment but rather return the list of the metadata of the impacted items. If no dependents are found, then we properly delete the segment.segmentId
- the identifier of the segment we want to deletevalidate
- whether or not to perform validation@Deprecated @GET @Path(value="/resetQueries") public void resetQueries()
Copyright © 2014–2023 Apache Software Foundation. All rights reserved.