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
ConstructorsConstructorDescriptionCreates 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.MessageBusReturns the internal message bus object so that clients can use it directly.com.yahoo.messagebus.network.NetworkReturns 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.voidshutdown()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:DocumentAccessShuts 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:
shutdownin classDocumentAccess
-
createSyncSession
Description copied from class:DocumentAccessReturns a session for synchronous document access. Use this for simple access.- Specified by:
createSyncSessionin classDocumentAccess- Parameters:
parameters- the parameters of this sync session- Returns:
- a session to use for synchronous document access
-
createAsyncSession
Description copied from class:DocumentAccessReturns a session for asynchronous document access. Use this if high operation throughput is required.- Specified by:
createAsyncSessionin 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:DocumentAccessRun a visitor with the given visitor parameters, and get the result back here.- Specified by:
createVisitorSessionin 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:DocumentAccessCreates a destination session for receiving data from visiting. The visitor must be started and progress tracked through a visitor session.- Specified by:
createVisitorDestinationSessionin 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:DocumentAccessCreates a subscription and returns a session for getting data from it. Use this to get document operations being done by other parties.- Specified by:
createSubscriptionin classDocumentAccess- Parameters:
parameters- The parameters of this subscription session- Returns:
- a session to use for document subscription
-
openSubscription
Description copied from class:DocumentAccessReturns a session for document subscription. Use this to get document operations being done by other parties.- Specified by:
openSubscriptionin 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.
-