Class MessageBusDocumentAccess


  • public class MessageBusDocumentAccess
    extends DocumentAccess
    This class implements the DocumentAccess interface using message bus for communication.
    Author:
    Einar Rosenvinge, bratseth
    • 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 class DocumentAccess
      • 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 class DocumentAccess
        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 class DocumentAccess
        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,
                                                             java.lang.IllegalArgumentException
        Description copied from class: DocumentAccess
        Run a visitor with the given visitor parameters, and get the result back here.
        Specified by:
        createVisitorSession in class DocumentAccess
        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 parsed
        java.lang.IllegalArgumentException
      • 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 class DocumentAccess
        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 class DocumentAccess
        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.