Q - the native query typeC - the constraint typeS - the solution typepublic class BasicSubscription<C,Q,S> extends java.lang.Object implements Subscription
| Constructor and Description |
|---|
BasicSubscription(C sparqlQuery,
Q query,
java.util.function.BiConsumer<S,java.lang.Long> solutionConsumer,
BasicStreamProcessor<?,C,Q,?,S> processor) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Marks this subscription as inactive, so that the query no longer receives results
|
C |
getConstraint() |
java.lang.String |
getId() |
Q |
getQuery() |
java.util.function.BiConsumer<S,java.lang.Long> |
getSolutionConsumer() |
boolean |
isActive() |
boolean |
renew(int ttl)
Renews the subscription for another ttl milliseconds (or indefinitely, if ttl=0),
provided the renewal operation is accepted by the query engine.
|
void |
setQuery(Q query) |
void |
setSolutionConsumer(java.util.function.BiConsumer<S,java.lang.Long> solutionConsumer) |
public java.lang.String getId()
getId in interface Subscriptionpublic boolean isActive()
isActive in interface SubscriptionStreamProcessor
(occupying resources and potentially receiving and handling query results)public void cancel()
throws java.io.IOException
Subscriptioncancel in interface Subscriptionjava.io.IOException - if there is a problem communicating with this query engine
(for example, if there are network operations involved)public boolean renew(int ttl)
throws java.io.IOException
Subscriptionrenew in interface Subscriptionttl - the new time-to-live in seconds, or 0 for infinite time-to-livejava.io.IOException - if there is a problem communicating with this query engine
(for example, if there are network operations involved)public C getConstraint()
StreamProcessorpublic Q getQuery()
public java.util.function.BiConsumer<S,java.lang.Long> getSolutionConsumer()
public void setQuery(Q query)
public void setSolutionConsumer(java.util.function.BiConsumer<S,java.lang.Long> solutionConsumer)
Copyright © 2016. All Rights Reserved.