Class PutWatchRequest

  • All Implemented Interfaces:
    Validatable

    public final class PutWatchRequest
    extends java.lang.Object
    implements Validatable
    This request class contains the data needed to create a watch along with the name of the watch. The name of the watch will become the ID of the indexed document.
    • Field Summary

    • Method Summary

      Modifier and Type Method Description
      java.lang.String getId()  
      BytesReference getSource()  
      long getVersion()  
      long ifPrimaryTerm()
      If set, only perform this put watch request if the watch's last modification was assigned this primary term.
      long ifSeqNo()
      If set, only perform this put watch request if the watch's last modification was assigned this sequence number.
      boolean isActive()  
      static boolean isValidId​(java.lang.String id)  
      void setActive​(boolean active)
      Sets the initial active state of the watch
      PutWatchRequest setIfPrimaryTerm​(long term)
      only performs this put request if the watch's last modification was assigned the given primary term.
      PutWatchRequest setIfSeqNo​(long seqNo)
      only performs this put request if the watch's last modification was assigned the given sequence number.
      void setVersion​(long version)  
      XContentType xContentType()
      Get the content type for the source
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getId

        public java.lang.String getId()
        Returns:
        The name that will be the ID of the indexed document
      • getSource

        public BytesReference getSource()
        Returns:
        The source of the watch
      • isActive

        public boolean isActive()
        Returns:
        The initial active state of the watch (defaults to true, e.g. "active")
      • setActive

        public void setActive​(boolean active)
        Sets the initial active state of the watch
      • xContentType

        public XContentType xContentType()
        Get the content type for the source
      • getVersion

        public long getVersion()
      • setVersion

        public void setVersion​(long version)
      • setIfSeqNo

        public PutWatchRequest setIfSeqNo​(long seqNo)
        only performs this put request if the watch's last modification was assigned the given sequence number. Must be used in combination with setIfPrimaryTerm(long) If the watch's last modification was assigned a different sequence number a VersionConflictEngineException will be thrown.
      • setIfPrimaryTerm

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

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

        public long ifPrimaryTerm()
        If set, only perform this put watch request if the watch's last modification was assigned this primary term. If the watch's last modification was assigned a different term a VersionConflictEngineException will be thrown.
      • isValidId

        public static boolean isValidId​(java.lang.String id)