@ServiceProvider(value=) public final class LocalSearchService extends AbstractLocalRpcService
match
and listSubscriptions
.
Subscriptions are persisted to the datastore in the default
namespace, stored in the entity type defined in ProspectiveSearchReservedKinds
. About 100,000 20 byte query
subscriptions can be stored. This constraint may change in future
releases.
Modifications to subscriptions will be persisted automatically.
This behavior can be toggled with the AUTOCOMMIT_PROPERTY
to allow for high performance for batches of state modifications.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTOCOMMIT_PROPERTY
This property controls whether the state of the local
ProspectiveSearchService will automatically be persisted after
modification.
|
static java.lang.String |
PACKAGE
The package name for this service.
|
Constructor and Description |
---|
LocalSearchService() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPackage() |
void |
init(LocalServiceContext context,
java.util.Map<java.lang.String,java.lang.String> properties) |
ListSubscriptionsResponse |
listSubscriptions(Status status,
ListSubscriptionsRequest request)
Return a list of subscriptions encapsulated in
ListSubscriptionsResponse that match the given
ListSubscriptionsRequest constraints on subscription topic, id
and expiry.
|
ListTopicsResponse |
listTopics(Status status,
ListTopicsRequest req)
List all topics from a given offset to a given limit.
|
MatchResponse |
match(Status status,
MatchRequest request)
Check the requested topic exists and then try matching the
document against all subscriptions in the topic.
|
SubscribeResponse |
subscribe(Status status,
SubscribeRequest request)
Add a subscription.
|
UnsubscribeResponse |
unsubscribe(Status status,
UnsubscribeRequest request)
Remove the subscription matching the given UnsubscribeResponse's
topic and id.
|
public static final java.lang.String AUTOCOMMIT_PROPERTY
public static final java.lang.String PACKAGE
public void init(LocalServiceContext context, java.util.Map<java.lang.String,java.lang.String> properties)
public java.lang.String getPackage()
public SubscribeResponse subscribe(Status status, SubscribeRequest request)
public UnsubscribeResponse unsubscribe(Status status, UnsubscribeRequest request)
public MatchResponse match(Status status, MatchRequest request)
If the query grammar changes, a stored subscription may become invalid. A log entry will be generated noting this, along with the subscription id, allowing for its removal.
public ListSubscriptionsResponse listSubscriptions(Status status, ListSubscriptionsRequest request)
public ListTopicsResponse listTopics(Status status, ListTopicsRequest req)