Package org.jboss.as.cli.batch
Interface Batch
-
- All Known Implementing Classes:
DefaultBatch
public interface Batch
- Author:
- Alexey Loubyansky
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
add(BatchedCommand cmd)
Adds a command or an operation to the batch.void
clear()
Removes all the commands and the operations from the batch.default Attachments
getAttachments()
List<BatchedCommand>
getCommands()
Returns all the commands and operations in the batch as a list.void
move(int currentIndex, int newIndex)
Move the command or operation corresponding to the currentIndex to the newIndex position, shifting the commands/operations in between the indexes.void
remove(int index)
Removes command or operation corresponding to its index in the list.void
set(int index, BatchedCommand cmd)
Replaces the command or operation at the specified index with the new one.int
size()
Returns the number of the commands and operations in the batch.org.jboss.dmr.ModelNode
toRequest()
Generates a composite operation request from all the commands and operations in the batch.
-
-
-
Method Detail
-
add
void add(BatchedCommand cmd)
Adds a command or an operation to the batch.- Parameters:
cmd
- command or operation to add to the batch
-
getCommands
List<BatchedCommand> getCommands()
Returns all the commands and operations in the batch as a list.- Returns:
- list of commands and operations in the batch
-
clear
void clear()
Removes all the commands and the operations from the batch.
-
remove
void remove(int index)
Removes command or operation corresponding to its index in the list. The indexes start with 0.- Parameters:
index
- the index of the command or operation to be removed from the batch
-
move
void move(int currentIndex, int newIndex)
Move the command or operation corresponding to the currentIndex to the newIndex position, shifting the commands/operations in between the indexes. The indexes start with 0.- Parameters:
currentIndex
- the index of the command or operation to move the new positionnewIndex
- the new position for the command/operation
-
set
void set(int index, BatchedCommand cmd)
Replaces the command or operation at the specified index with the new one. The indexes start with 0.- Parameters:
index
- the position for the new command or operation.cmd
- the new command or operation
-
size
int size()
Returns the number of the commands and operations in the batch.- Returns:
- the number of the commands and operations in the batch
-
toRequest
org.jboss.dmr.ModelNode toRequest()
Generates a composite operation request from all the commands and operations in the batch.- Returns:
- operation request that includes all the commands and operations in the batch
-
getAttachments
default Attachments getAttachments()
-
-