Package org.codice.ddf.commands.catalog
Class CommandSupport
java.lang.Object
org.codice.ddf.commands.catalog.CommandSupport
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action
- Direct Known Subclasses:
EnvListCommand,SubjectCommands
public abstract class CommandSupport
extends Object
implements org.apache.karaf.shell.api.action.Action
CommandSupport provides printing and progress bar support for extending classes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PrintStreamprotected static final org.fusesource.jansi.Ansi.Colorprotected static final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcalculateRecordsPerSecond(long currentCount, long start, long end) protected voidprintColor(org.fusesource.jansi.Ansi.Color color, String message) protected voidprintErrorMessage(String message) protected voidprintHeaderMessage(String message) protected voidprintProgressAndFlush(long start, long totalCount, long currentCount) Logic mimicsorg.apache.karaf.main.StartupListener#showProgressBarprotected voidprintSuccessMessage(String message) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.karaf.shell.api.action.Action
execute
-
Field Details
-
MS_PER_SECOND
protected static final double MS_PER_SECOND- See Also:
-
ERROR_COLOR
protected static final org.fusesource.jansi.Ansi.Color ERROR_COLOR -
console
-
-
Constructor Details
-
CommandSupport
public CommandSupport()
-
-
Method Details
-
printColor
-
printErrorMessage
-
printHeaderMessage
-
printSuccessMessage
-
printProgressAndFlush
protected void printProgressAndFlush(long start, long totalCount, long currentCount) Logic mimicsorg.apache.karaf.main.StartupListener#showProgressBar- Parameters:
start- time started processing recordstotalCount- count of total recordscurrentCount- count of records completed
-
calculateRecordsPerSecond
protected int calculateRecordsPerSecond(long currentCount, long start, long end)
-