Class PutWatchRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.support.master.MasterNodeRequest<PutWatchRequest>
-
- org.elasticsearch.protocol.xpack.watcher.PutWatchRequest
-
- All Implemented Interfaces:
Streamable
,Writeable
,TaskAwareRequest
public class PutWatchRequest extends MasterNodeRequest<PutWatchRequest>
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 class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V extends java.lang.Object>, Writeable.Writer<V extends java.lang.Object>
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
DEFAULT_MASTER_NODE_TIMEOUT, masterNodeTimeout
-
-
Constructor Summary
Constructors Constructor Description PutWatchRequest()
PutWatchRequest(java.lang.String id, BytesReference source, XContentType xContentType)
PutWatchRequest(StreamInput in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getId()
BytesReference
getSource()
long
getVersion()
boolean
isActive()
static boolean
isValidId(java.lang.String id)
void
readFrom(StreamInput in)
void
setActive(boolean active)
Sets the initial active state of the watchvoid
setId(java.lang.String id)
Set the watch namevoid
setSource(BytesReference source, XContentType xContentType)
Set the source of the watchvoid
setVersion(long version)
ActionRequestValidationException
validate()
void
writeTo(StreamOutput out)
XContentType
xContentType()
Get the content type for the source-
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
-
Methods inherited from class org.elasticsearch.action.support.master.MasterNodeRequest
masterNodeTimeout, masterNodeTimeout, masterNodeTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.io.stream.Streamable
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
-
-
-
Constructor Detail
-
PutWatchRequest
public PutWatchRequest()
-
PutWatchRequest
public PutWatchRequest(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
PutWatchRequest
public PutWatchRequest(java.lang.String id, BytesReference source, XContentType xContentType)
-
-
Method Detail
-
getId
public java.lang.String getId()
- Returns:
- The name that will be the ID of the indexed document
-
setId
public void setId(java.lang.String id)
Set the watch name
-
getSource
public BytesReference getSource()
- Returns:
- The source of the watch
-
setSource
public void setSource(BytesReference source, XContentType xContentType)
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 XContentType xContentType()
Get the content type for the source
-
getVersion
public long getVersion()
-
setVersion
public void setVersion(long version)
-
validate
public ActionRequestValidationException validate()
- Specified by:
validate
in classActionRequest
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classMasterNodeRequest<PutWatchRequest>
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classMasterNodeRequest<PutWatchRequest>
- Throws:
java.io.IOException
-
isValidId
public static boolean isValidId(java.lang.String id)
-
-