Module org.elasticsearch.xcore
Class PutWatchRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.protocol.xpack.watcher.PutWatchRequest
- All Implemented Interfaces:
Writeable,org.elasticsearch.core.RefCounted,TaskAwareRequest,TransportRequest
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionPutWatchRequest(String id, BytesReference source, org.elasticsearch.xcontent.XContentType xContentType) -
Method Summary
Modifier and TypeMethodDescriptiongetId()longIf set, only perform this put watch request if the watch's last modification was assigned this primary term.longIf set, only perform this put watch request if the watch's last modification was assigned this sequence number.longbooleanisActive()static booleanvoidsetActive(boolean active) Sets the initial active state of the watchvoidSet the watch namesetIfPrimaryTerm(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.voidsetSource(BytesReference source, org.elasticsearch.xcontent.XContentType xContentType) Set the source of the watchvoidsetVersion(long version) validate()voidwriteTo(StreamOutput out) org.elasticsearch.xcontent.XContentTypeGet the content type for the sourceMethods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, createTask, getDescription, setParentTask
-
Constructor Details
-
PutWatchRequest
public PutWatchRequest() -
PutWatchRequest
- Throws:
IOException
-
PutWatchRequest
public PutWatchRequest(String id, BytesReference source, org.elasticsearch.xcontent.XContentType xContentType)
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classActionRequest- Throws:
IOException
-
getId
- Returns:
- The name that will be the ID of the indexed document
-
setId
Set the watch name -
getSource
- Returns:
- The source of the watch
-
setSource
Set 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 -
getVersion
public long getVersion() -
setVersion
public void setVersion(long version) -
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 a
VersionConflictEngineExceptionwill 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 a
VersionConflictEngineExceptionwill be thrown. -
getIfSeqNo
public long getIfSeqNo()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 aVersionConflictEngineExceptionwill be thrown. -
getIfPrimaryTerm
public long getIfPrimaryTerm()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
VersionConflictEngineExceptionwill be thrown. -
validate
- Specified by:
validatein classActionRequest
-
isValidId
-