Interface DocWriteRequest<T>

    • Method Summary

      Modifier and Type Method Description
      T defaultTypeIfNull​(java.lang.String defaultType)
      Set the default type supplied to a bulk request if this individual request's type is null or empty
      java.lang.String id()
      Get the id of the document for this request
      long ifPrimaryTerm()
      If set, only perform this request if the document was last modification was assigned this primary term.
      long ifSeqNo()
      If set, only perform this request if the document was last modification was assigned this sequence number.
      java.lang.String index()
      Get the index that this request operates on
      T index​(java.lang.String index)
      Set the index for this request
      IndicesOptions indicesOptions()
      Get the options for this request
      DocWriteRequest.OpType opType()
      Get the requested document operation type of the request
      static DocWriteRequest<?> readDocumentRequest​(StreamInput in)
      read a document write (index/delete/update) request
      java.lang.String routing()
      Get the routing for this request
      T routing​(java.lang.String routing)
      Set the routing for this request
      T setIfPrimaryTerm​(long term)
      only performs this request if the document was last modification was assigned the given primary term.
      T setIfSeqNo​(long seqNo)
      only perform this request if the document was last modification was assigned the given sequence number.
      java.lang.String type()
      Get the type that this request operates on
      T type​(java.lang.String type)
      Set the type for this request
      static ActionRequestValidationException validateSeqNoBasedCASParams​(DocWriteRequest request, ActionRequestValidationException validationException)  
      long version()
      Get the document version for this request
      T version​(long version)
      Sets the version, which will perform the operation only if a matching version exists and no changes happened on the doc since then.
      VersionType versionType()
      Get the document version type for this request
      T versionType​(VersionType versionType)
      Sets the versioning type.
      static void writeDocumentRequest​(StreamOutput out, DocWriteRequest<?> request)
      write a document write (index/delete/update) request
    • Method Detail

      • index

        T index​(java.lang.String index)
        Set the index for this request
        Returns:
        the Request
      • index

        java.lang.String index()
        Get the index that this request operates on
        Returns:
        the index
      • type

        T type​(java.lang.String type)
        Set the type for this request
        Returns:
        the Request
      • type

        java.lang.String type()
        Get the type that this request operates on
        Returns:
        the type
      • defaultTypeIfNull

        T defaultTypeIfNull​(java.lang.String defaultType)
        Set the default type supplied to a bulk request if this individual request's type is null or empty
        Returns:
        the Request
      • id

        java.lang.String id()
        Get the id of the document for this request
        Returns:
        the id
      • routing

        T routing​(java.lang.String routing)
        Set the routing for this request
        Returns:
        the Request
      • routing

        java.lang.String routing()
        Get the routing for this request
        Returns:
        the Routing
      • version

        long version()
        Get the document version for this request
        Returns:
        the document version
      • version

        T version​(long version)
        Sets the version, which will perform the operation only if a matching version exists and no changes happened on the doc since then.
      • versionType

        VersionType versionType()
        Get the document version type for this request
        Returns:
        the document version type
      • setIfSeqNo

        T setIfSeqNo​(long seqNo)
        only perform this request if the document was last modification was assigned the given sequence number. Must be used in combination with setIfPrimaryTerm(long) If the document last modification was assigned a different sequence number a VersionConflictEngineException will be thrown.
      • setIfPrimaryTerm

        T setIfPrimaryTerm​(long term)
        only performs this request if the document was last modification was assigned the given primary term. Must be used in combination with setIfSeqNo(long) If the document last modification was assigned a different term a VersionConflictEngineException will be thrown.
      • ifSeqNo

        long ifSeqNo()
        If set, only perform this request if the document was last modification was assigned this sequence number. If the document last modification was assigned a different sequence number a VersionConflictEngineException will be thrown.
      • ifPrimaryTerm

        long ifPrimaryTerm()
        If set, only perform this request if the document was last modification was assigned this primary term. If the document last modification was assigned a different term a VersionConflictEngineException will be thrown.
      • readDocumentRequest

        static DocWriteRequest<?> readDocumentRequest​(StreamInput in)
                                               throws java.io.IOException
        read a document write (index/delete/update) request
        Throws:
        java.io.IOException
      • writeDocumentRequest

        static void writeDocumentRequest​(StreamOutput out,
                                         DocWriteRequest<?> request)
                                  throws java.io.IOException
        write a document write (index/delete/update) request
        Throws:
        java.io.IOException