Class LocalAsyncSession

    • Method Detail

      • getCurrentWindowSize

        public double getCurrentWindowSize()
        Description copied from interface: AsyncSession
        Returns the current send window size of the session.
        Specified by:
        getCurrentWindowSize in interface AsyncSession
        Returns:
        Returns the window size.
      • put

        public Result put​(com.yahoo.document.Document document)
        Description copied from interface: AsyncSession

        Puts a document. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentResponse objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document submitted here. If it was not a success, this method has no further effects.

        Specified by:
        put in interface AsyncSession
        Parameters:
        document - the Document to put
        Returns:
        the synchronous result of this operation
      • put

        public Result put​(com.yahoo.document.Document document,
                          DocumentProtocol.Priority pri)
        Description copied from interface: AsyncSession

        Puts a document. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentResponse objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document submitted here. If it was not a success, this method has no further effects.

        Specified by:
        put in interface AsyncSession
        Parameters:
        document - the Document to put
        Returns:
        the synchronous result of this operation
      • get

        public Result get​(com.yahoo.document.DocumentId id)
        Description copied from interface: AsyncSession

        Gets a document. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentResponse objects to appear within the timeout time of this session. The response returned later will contain the requested document if it is a success. If it was not a success, this method has no further effects.

        Specified by:
        get in interface AsyncSession
        Parameters:
        id - the id of the document to get
        Returns:
        the synchronous result of this operation
      • get

        @Deprecated
        public Result get​(com.yahoo.document.DocumentId id,
                          boolean headersOnly,
                          DocumentProtocol.Priority pri)
        Deprecated.
        Description copied from interface: AsyncSession

        Gets a document. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentResponse objects to appear within the timeout time of this session. The response returned later will contain the requested document if it is a success. If it was not a success, this method has no further effects.

        Specified by:
        get in interface AsyncSession
        Parameters:
        id - the id of the document to get
        pri - The priority with which to perform this operation.
        Returns:
        the synchronous result of this operation
      • get

        public Result get​(com.yahoo.document.DocumentId id,
                          DocumentProtocol.Priority pri)
        Description copied from interface: AsyncSession

        Gets a document. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentResponse objects to appear within the timeout time of this session. The response returned later will contain the requested document if it is a success. If it was not a success, this method has no further effects.

        Specified by:
        get in interface AsyncSession
        Parameters:
        id - the id of the document to get
        pri - The priority with which to perform this operation.
        Returns:
        the synchronous result of this operation
      • remove

        public Result remove​(com.yahoo.document.DocumentId id)
        Description copied from interface: AsyncSession

        Removes a document if it is present. This method returns immediately.

        If this result is a success, this call will cause one or more RemoveResponse objects to appear within the timeout time of this session. The response returned later will either be a success, or contain the document id submitted here. If it was not a success, this method has no further effects.

        Specified by:
        remove in interface AsyncSession
        Parameters:
        id - the id of the document to remove
        Returns:
        the synchronous result of this operation
      • remove

        public Result remove​(com.yahoo.document.DocumentId id,
                             DocumentProtocol.Priority pri)
        Description copied from interface: AsyncSession

        Removes a document if it is present. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentIdResponse objects to apprear within the timeout time of this session. The response returned later will either be a success, or contain the document id submitted here. If it was not a success, this method has no further effects.

        Specified by:
        remove in interface AsyncSession
        Parameters:
        id - the id of the document to remove
        pri - The priority with which to perform this operation.
        Returns:
        the synchronous result of this operation
      • update

        public Result update​(com.yahoo.document.DocumentUpdate update)
        Description copied from interface: AsyncSession

        Updates a document. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentUpdateResponse within the timeout time of this session. The returned response returned later will either be a success or contain the update submitted here. If it was not a success, this method has no further effects.

        Specified by:
        update in interface AsyncSession
        Parameters:
        update - the updates to perform
        Returns:
        the synchronous result of this operation
      • update

        public Result update​(com.yahoo.document.DocumentUpdate update,
                             DocumentProtocol.Priority pri)
        Description copied from interface: AsyncSession

        Updates a document. This method returns immediately.

        If this result is a success, this call will cause one or more DocumentUpdateResponse within the timeout time of this session. The returned response returned later will either be a success or contain the update submitted here. If it was not a success, this method has no further effects.

        Specified by:
        update in interface AsyncSession
        Parameters:
        update - the updates to perform
        pri - The priority with which to perform this operation.
        Returns:
        the synchronous result of this operation
      • getNext

        public Response getNext()
        Description copied from interface: Session
        Returns the next response of this session. This method returns immediately.
        Specified by:
        getNext in interface Session
        Returns:
        the next response, or null if no response is ready at this time
      • getNext

        public Response getNext​(int timeout)
        Description copied from interface: Session
        Returns the next response of this session. This will block until a response is ready or until the given timeout is reached
        Specified by:
        getNext in interface Session
        Parameters:
        timeout - the max time to wait for a response.
        Returns:
        the next response, or null if no response becomes ready before the timeout expires
      • destroy

        public void destroy()
        Description copied from interface: Session
        Destroys this session and frees up any resources it has held. Making further calls on a destroyed session causes a runtime exception.
        Specified by:
        destroy in interface Session