Class CloseIndexRequest

java.lang.Object
org.elasticsearch.client.TimedRequest
org.elasticsearch.client.indices.CloseIndexRequest
All Implemented Interfaces:
Validatable

public class CloseIndexRequest
extends TimedRequest
implements Validatable
A request to close an index.
  • Field Summary

    Fields inherited from class org.elasticsearch.client.TimedRequest

    DEFAULT_ACK_TIMEOUT, DEFAULT_MASTER_NODE_TIMEOUT

    Fields inherited from interface org.elasticsearch.client.Validatable

    EMPTY
  • Constructor Summary

    Constructors 
    Constructor Description
    CloseIndexRequest​(java.lang.String... indices)
    Creates a new close index request
  • Method Summary

    Modifier and Type Method Description
    java.lang.String[] indices()
    Returns the indices to close
    org.elasticsearch.action.support.IndicesOptions indicesOptions()
    Specifies what type of requested indices to ignore and how to deal with wildcard expressions.
    CloseIndexRequest indicesOptions​(org.elasticsearch.action.support.IndicesOptions indicesOptions)
    Specifies what type of requested indices to ignore and how to deal with wildcard expressions.
    java.util.Optional<ValidationException> validate()
    Perform validation.
    org.elasticsearch.action.support.ActiveShardCount waitForActiveShards()
    Returns the wait for active shard count or null if the default should be used
    CloseIndexRequest waitForActiveShards​(org.elasticsearch.action.support.ActiveShardCount waitForActiveShards)
    Sets the number of shard copies that should be active for indices opening to return.

    Methods inherited from class org.elasticsearch.client.TimedRequest

    masterNodeTimeout, setMasterTimeout, setTimeout, timeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CloseIndexRequest

      public CloseIndexRequest​(java.lang.String... indices)
      Creates a new close index request
      Parameters:
      indices - the indices to close
  • Method Details

    • indices

      public java.lang.String[] indices()
      Returns the indices to close
    • indicesOptions

      public org.elasticsearch.action.support.IndicesOptions indicesOptions()
      Specifies what type of requested indices to ignore and how to deal with wildcard expressions. For example indices that don't exist.
      Returns:
      the current behaviour when it comes to index names and wildcard indices expressions
    • indicesOptions

      public CloseIndexRequest indicesOptions​(org.elasticsearch.action.support.IndicesOptions indicesOptions)
      Specifies what type of requested indices to ignore and how to deal with wildcard expressions. For example indices that don't exist.
      Parameters:
      indicesOptions - the desired behaviour regarding indices to ignore and wildcard indices expressions
    • waitForActiveShards

      public org.elasticsearch.action.support.ActiveShardCount waitForActiveShards()
      Returns the wait for active shard count or null if the default should be used
    • waitForActiveShards

      public CloseIndexRequest waitForActiveShards​(org.elasticsearch.action.support.ActiveShardCount waitForActiveShards)
      Sets the number of shard copies that should be active for indices opening to return. Defaults to ActiveShardCount.DEFAULT, which will wait for one shard copy (the primary) to become active. Set this value to ActiveShardCount.ALL to wait for all shards (primary and all replicas) to be active before returning. Otherwise, use ActiveShardCount.from(int) to set this value to any non-negative integer, up to the number of copies per shard (number of replicas + 1), to wait for the desired amount of shard copies to become active before returning. Indices opening will only wait up until the timeout value for the number of shard copies to be active before returning. Check ShardsAcknowledgedResponse.isShardsAcknowledged() to determine if the requisite shard copies were all started before returning or timing out.
      Parameters:
      waitForActiveShards - number of active shard copies to wait on
    • validate

      public java.util.Optional<ValidationException> validate()
      Description copied from interface: Validatable
      Perform validation. This method does not have to be overridden in the event that no validation needs to be done, or the validation was done during object construction time. A ValidationException that is not null is assumed to contain validation errors and will be thrown.
      Specified by:
      validate in interface Validatable
      Returns:
      An Optional ValidationException that contains a list of validation errors.