Package org.jboss.as.cli.batch.impl
Class DefaultBatch
- java.lang.Object
-
- org.jboss.as.cli.batch.impl.DefaultBatch
-
-
Constructor Summary
Constructors Constructor Description DefaultBatch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(BatchedCommand cmd)Adds a command or an operation to the batch.voidclear()Removes all the commands and the operations from the batch.protected voidensureRange(int lineNumber)AttachmentsgetAttachments()List<BatchedCommand>getCommands()Returns all the commands and operations in the batch as a list.voidmove(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.voidremove(int lineNumber)Removes command or operation corresponding to its index in the list.voidset(int index, BatchedCommand cmd)Replaces the command or operation at the specified index with the new one.intsize()Returns the number of the commands and operations in the batch.org.jboss.dmr.ModelNodetoRequest()Generates a composite operation request from all the commands and operations in the batch.
-
-
-
Method Detail
-
getCommands
public List<BatchedCommand> getCommands()
Description copied from interface:BatchReturns all the commands and operations in the batch as a list.- Specified by:
getCommandsin interfaceBatch- Returns:
- list of commands and operations in the batch
-
add
public void add(BatchedCommand cmd)
Description copied from interface:BatchAdds a command or an operation to the batch.
-
clear
public void clear()
Description copied from interface:BatchRemoves all the commands and the operations from the batch.
-
remove
public void remove(int lineNumber)
Description copied from interface:BatchRemoves command or operation corresponding to its index in the list. The indexes start with 0.
-
set
public void set(int index, BatchedCommand cmd)Description copied from interface:BatchReplaces the command or operation at the specified index with the new one. The indexes start with 0.
-
ensureRange
protected void ensureRange(int lineNumber)
-
size
public int size()
Description copied from interface:BatchReturns the number of the commands and operations in the batch.
-
move
public void move(int currentIndex, int newIndex)Description copied from interface:BatchMove 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.
-
toRequest
public org.jboss.dmr.ModelNode toRequest()
Description copied from interface:BatchGenerates a composite operation request from all the commands and operations in the batch.
-
getAttachments
public Attachments getAttachments()
- Specified by:
getAttachmentsin interfaceBatch
-
-