public class AllocationCommands
extends java.lang.Object
AllocationCommand
composite managing several
AllocationCommand
implementationsConstructor and Description |
---|
AllocationCommands(AllocationCommand... commands)
Creates a new set of
AllocationCommands |
public AllocationCommands(AllocationCommand... commands)
AllocationCommands
commands
- AllocationCommand
s that are wrapped by this instancepublic static void registerFactory(java.lang.String type, AllocationCommand.Factory factory)
@Nullable public static <T extends AllocationCommand> AllocationCommand.Factory<T> lookupFactory(java.lang.String name)
public static <T extends AllocationCommand> AllocationCommand.Factory<T> lookupFactorySafe(java.lang.String name)
public AllocationCommands add(AllocationCommand... commands)
commands
- Array of commands to add to this instanceAllocationCommands
with the given commands addedpublic java.util.List<AllocationCommand> commands()
List
of commandspublic RoutingExplanations execute(RoutingAllocation allocation, boolean explain)
RoutingAllocation
allocation
- RoutingAllocation
to apply this command toElasticsearchException
- if something happens during executionpublic static AllocationCommands readFrom(StreamInput in) throws java.io.IOException
AllocationCommands
from a StreamInput
in
- StreamInput
to read fromAllocationCommands
readjava.io.IOException
- if something happens during readpublic static void writeTo(AllocationCommands commands, StreamOutput out) throws java.io.IOException
AllocationCommands
to a StreamOutput
commands
- Commands to writeout
- StreamOutput
to write the commands tojava.io.IOException
- if something happens during writepublic static AllocationCommands fromXContent(XContentParser parser) throws java.io.IOException
AllocationCommands
from a XContentParser
{ "commands" : [ {"allocate" : {"index" : "test", "shard" : 0, "node" : "test"}} ] }
parser
- XContentParser
to read the commands fromAllocationCommands
readjava.io.IOException
- if something bad happens while reading the streampublic static void toXContent(AllocationCommands commands, XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
AllocationCommands
to a XContentBuilder
commands
- AllocationCommands
to writebuilder
- XContentBuilder
to useparams
- Parameters to use for buildingjava.io.IOException
- if something bad happens while building the content