Package com.yahoo.documentapi.messagebus
Class MessageBusDocumentAccess
java.lang.Object
com.yahoo.documentapi.DocumentAccess
com.yahoo.documentapi.messagebus.MessageBusDocumentAccess
This class implements the
DocumentAccess
interface using message bus for communication.- Author:
- Einar Rosenvinge, bratseth
-
Constructor Summary
ConstructorDescriptionCreates a new document access using default values for all parameters.Creates a new document access using the supplied parameters. -
Method Summary
Modifier and TypeMethodDescriptioncreateAsyncSession
(AsyncParameters parameters) Returns a session for asynchronous document access.createSubscription
(SubscriptionParameters parameters) Creates a subscription and returns a session for getting data from it.createSyncSession
(SyncParameters parameters) Returns a session for synchronous document access.Creates a destination session for receiving data from visiting.Run a visitor with the given visitor parameters, and get the result back here.com.yahoo.messagebus.MessageBus
Returns the internal message bus object so that clients can use it directly.com.yahoo.messagebus.network.Network
Returns the network layer of the internal message bus object so that clients can use it directly.Returns the parameter object that controls the underlying message bus.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.Methods inherited from class com.yahoo.documentapi.DocumentAccess
createForNonContainer, getDocumentTypeManager
-
Constructor Details
-
MessageBusDocumentAccess
public MessageBusDocumentAccess()Creates a new document access using default values for all parameters. -
MessageBusDocumentAccess
Creates a new document access using the supplied parameters.- Parameters:
params
- All parameters for construction.
-
-
Method Details
-
shutdown
public void shutdown()Description copied from class:DocumentAccess
Shuts down the underlying sessions used by this DocumentAccess; subsequent use of this DocumentAccess will throw unspecified exceptions, depending on implementation. Classes overriding this must call super.shutdown().- Overrides:
shutdown
in classDocumentAccess
-
createSyncSession
Description copied from class:DocumentAccess
Returns a session for synchronous document access. Use this for simple access.- Specified by:
createSyncSession
in classDocumentAccess
- Parameters:
parameters
- the parameters of this sync session- Returns:
- a session to use for synchronous document access
-
createAsyncSession
Description copied from class:DocumentAccess
Returns a session for asynchronous document access. Use this if high operation throughput is required.- Specified by:
createAsyncSession
in classDocumentAccess
- Parameters:
parameters
- the parameters of this async session.- Returns:
- a session to use for asynchronous document access.
-
createVisitorSession
public MessageBusVisitorSession createVisitorSession(VisitorParameters params) throws com.yahoo.document.select.parser.ParseException, IllegalArgumentException Description copied from class:DocumentAccess
Run a visitor with the given visitor parameters, and get the result back here.- Specified by:
createVisitorSession
in classDocumentAccess
- Parameters:
params
- The parameters of this visitor session.- Returns:
- a session used to track progress of the visitor and get the actual data returned.
- Throws:
com.yahoo.document.select.parser.ParseException
- if the document selection string could not be parsedIllegalArgumentException
-
createVisitorDestinationSession
public MessageBusVisitorDestinationSession createVisitorDestinationSession(VisitorDestinationParameters params) Description copied from class:DocumentAccess
Creates a destination session for receiving data from visiting. The visitor must be started and progress tracked through a visitor session.- Specified by:
createVisitorDestinationSession
in classDocumentAccess
- Parameters:
params
- the parameters of this visitor destination session- Returns:
- a session used to get the actual data returned
-
createSubscription
Description copied from class:DocumentAccess
Creates a subscription and returns a session for getting data from it. Use this to get document operations being done by other parties.- Specified by:
createSubscription
in classDocumentAccess
- Parameters:
parameters
- The parameters of this subscription session- Returns:
- a session to use for document subscription
-
openSubscription
Description copied from class:DocumentAccess
Returns a session for document subscription. Use this to get document operations being done by other parties.- Specified by:
openSubscription
in classDocumentAccess
- Parameters:
parameters
- the parameters of this subscription session- Returns:
- a session to use for document subscription
-
getMessageBus
public com.yahoo.messagebus.MessageBus getMessageBus()Returns the internal message bus object so that clients can use it directly. -
getNetwork
public com.yahoo.messagebus.network.Network getNetwork()Returns the network layer of the internal message bus object so that clients can use it directly. This may seem abit arbitrary, but the fact is that the RPCNetwork actually implements the IMirror API as well as exposing the SystemState object. -
getParams
Returns the parameter object that controls the underlying message bus. Changes to these parameters do not affect previously created sessions.
-