Package com.yahoo.documentapi.messagebus
Class MessageBusDocumentAccess
- java.lang.Object
-
- com.yahoo.documentapi.DocumentAccess
-
- com.yahoo.documentapi.messagebus.MessageBusDocumentAccess
-
public class MessageBusDocumentAccess extends DocumentAccess
This class implements theDocumentAccess
interface using message bus for communication.- Author:
- Einar Rosenvinge, bratseth
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.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.-
Methods inherited from class com.yahoo.documentapi.DocumentAccess
createDefault, createForNonContainer, getDocumentTypeManager
-
-
-
-
Constructor Detail
-
MessageBusDocumentAccess
public MessageBusDocumentAccess()
Creates a new document access using default values for all parameters.
-
MessageBusDocumentAccess
public MessageBusDocumentAccess(MessageBusParams params)
Creates a new document access using the supplied parameters.- Parameters:
params
- All parameters for construction.
-
-
Method Detail
-
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
public MessageBusSyncSession createSyncSession(SyncParameters parameters)
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
public MessageBusAsyncSession createAsyncSession(AsyncParameters parameters)
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
public SubscriptionSession createSubscription(SubscriptionParameters parameters)
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
public SubscriptionSession openSubscription(SubscriptionParameters parameters)
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
public MessageBusParams getParams()
Returns the parameter object that controls the underlying message bus. Changes to these parameters do not affect previously created sessions.
-
-