public class MessageBusDocumentAccess extends DocumentAccess
DocumentAccess
interface using message bus for communication.Modifier and Type | Field and Description |
---|---|
private com.yahoo.messagebus.NetworkMessageBus |
bus |
private MessageBusParams |
params |
private ScheduledExecutorService |
scheduledExecutorService |
Constructor and Description |
---|
MessageBusDocumentAccess()
Creates a new document access using default values for all parameters.
|
MessageBusDocumentAccess(MessageBusParams params)
Creates a new document access using the supplied parameters.
|
Modifier and Type | Method and Description |
---|---|
MessageBusAsyncSession |
createAsyncSession(AsyncParameters parameters)
Returns a session for asynchronous document access.
|
SubscriptionSession |
createSubscription(SubscriptionParameters parameters)
Creates a subscription and returns a session for getting data from
it.
|
MessageBusSyncSession |
createSyncSession(SyncParameters parameters)
Returns a session for synchronous document access.
|
MessageBusVisitorDestinationSession |
createVisitorDestinationSession(VisitorDestinationParameters params)
Creates a destination session for receiving data from visiting.
|
MessageBusVisitorSession |
createVisitorSession(VisitorParameters params)
Run a visitor with the given visitor parameters, and get the result
back here.
|
com.yahoo.messagebus.MessageBus |
getMessageBus()
Returns the internal message bus object so that clients can use it directly.
|
com.yahoo.messagebus.network.Network |
getNetwork()
Returns the network layer of the internal message bus object so that clients can use it directly.
|
MessageBusParams |
getParams()
Returns the parameter object that controls the underlying message bus.
|
private com.yahoo.messagebus.MessageBus |
messageBus() |
SubscriptionSession |
openSubscription(SubscriptionParameters parameters)
Returns a session for document subscription.
|
void |
shutdown()
Shuts down the underlying sessions used by this DocumentAccess;
subsequent use of this DocumentAccess will throw unspecified exceptions,
depending on implementation.
|
createDefault, getDocumentTypeManager
private final com.yahoo.messagebus.NetworkMessageBus bus
private final MessageBusParams params
private final ScheduledExecutorService scheduledExecutorService
public MessageBusDocumentAccess()
public MessageBusDocumentAccess(MessageBusParams params)
params
- All parameters for construction.private com.yahoo.messagebus.MessageBus messageBus()
public void shutdown()
DocumentAccess
shutdown
in class DocumentAccess
public MessageBusSyncSession createSyncSession(SyncParameters parameters)
DocumentAccess
Returns a session for synchronous document access. Use this for simple access.
createSyncSession
in class DocumentAccess
parameters
- The parameters of this sync session.public MessageBusAsyncSession createAsyncSession(AsyncParameters parameters)
DocumentAccess
Returns a session for asynchronous document access. Use this if high operation throughput is required.
createAsyncSession
in class DocumentAccess
parameters
- The parameters of this async session.public MessageBusVisitorSession createVisitorSession(VisitorParameters params) throws com.yahoo.document.select.parser.ParseException, IllegalArgumentException
DocumentAccess
Run a visitor with the given visitor parameters, and get the result back here.
createVisitorSession
in class DocumentAccess
params
- The parameters of this visitor session.com.yahoo.document.select.parser.ParseException
- If the document selection string
could not be parsed.IllegalArgumentException
public MessageBusVisitorDestinationSession createVisitorDestinationSession(VisitorDestinationParameters params)
DocumentAccess
Creates a destination session for receiving data from visiting. The visitor must be started and progress tracked through a visitor session.
createVisitorDestinationSession
in class DocumentAccess
params
- The parameters of this visitor destination session.public SubscriptionSession createSubscription(SubscriptionParameters parameters)
DocumentAccess
Creates a subscription and returns a session for getting data from it. Use this to get document operations being done by other parties.
createSubscription
in class DocumentAccess
parameters
- The parameters of this subscription session.public SubscriptionSession openSubscription(SubscriptionParameters parameters)
DocumentAccess
Returns a session for document subscription. Use this to get document operations being done by other parties.
openSubscription
in class DocumentAccess
parameters
- The parameters of this subscription session.public com.yahoo.messagebus.MessageBus getMessageBus()
public com.yahoo.messagebus.network.Network getNetwork()
public MessageBusParams getParams()
Copyright © 2018. All rights reserved.