Package org.elasticsearch.client.watcher
Class PutWatchRequest
java.lang.Object
org.elasticsearch.client.watcher.PutWatchRequest
- All Implemented Interfaces:
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
Fields inherited from interface org.elasticsearch.client.Validatable
EMPTY
-
Constructor Summary
ConstructorDescriptionPutWatchRequest
(String id, BytesReference source, org.elasticsearch.xcontent.XContentType xContentType) -
Method Summary
Modifier and TypeMethodDescriptiongetId()
long
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
void
setActive
(boolean active) Sets the initial active state of the watchsetIfPrimaryTerm
(long term) only performs this put request if the watch's last modification was assigned the given primary term.setIfSeqNo
(long seqNo) only performs this put request if the watch's last modification was assigned the given sequence number.org.elasticsearch.xcontent.XContentType
Get the content type for the sourceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.client.Validatable
validate
-
Constructor Details
-
PutWatchRequest
public PutWatchRequest(String id, BytesReference source, org.elasticsearch.xcontent.XContentType xContentType)
-
-
Method Details
-
getId
- Returns:
- The name that will be the ID of the indexed document
-
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 org.elasticsearch.xcontent.XContentType xContentType()Get the content type for the source -
setIfSeqNo
only performs this put request if the watch's last modification was assigned the given sequence number. Must be used in combination withsetIfPrimaryTerm(long)
If the watch's last modification was assigned a different sequence number aVersionConflictEngineException
will be thrown. -
setIfPrimaryTerm
only performs this put request if the watch's last modification was assigned the given primary term. Must be used in combination withsetIfSeqNo(long)
If the watch last modification was assigned a different term aVersionConflictEngineException
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 aVersionConflictEngineException
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 aVersionConflictEngineException
will be thrown. -
isValidId
-