public abstract class ListCommand extends com.mapr.cliframework.base.CLIBaseClass implements ListIterator
| Constructor and Description |
|---|
ListCommand(com.mapr.cliframework.base.ProcessedInput input,
com.mapr.cliframework.base.CLICommand cliCommand) |
| Modifier and Type | Method and Description |
|---|---|
abstract com.google.protobuf.MessageLite |
buildNextRequest(com.google.protobuf.MessageLite prevReq,
com.google.protobuf.MessageLite prevResp)
Builds the next request object by inspecting the previous request and previous response.
|
protected <T> java.util.List<com.mapr.fs.cli.proto.CLIProto.Filter> |
getFilters(java.util.Map<T,com.mapr.cliframework.util.FieldInfo> table,
java.lang.String filterParam)
Helper method for the sub classes to build a list of Filters from the input filter string.
|
protected com.mapr.fs.cli.proto.CLIProto.Limiter |
getNextLimiter(int prevStart,
int prevCount,
int origStart,
int origLimit,
int numRecsPerRpc)
Helper method to build limiter for next request.
|
protected boolean |
hasMore(int origStart,
int origLimit,
int prevStart,
int prevCount)
A method that helps the sub classes to determine if there are more records to be processed.
|
abstract boolean |
hasMore(com.google.protobuf.MessageLite prevReq,
com.google.protobuf.MessageLite prevResp)
Inspect the last request and last response to see if there are more records to be fetched.
|
void |
list(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out)
Initiates the iteration process.
|
abstract void |
processResponse(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out,
com.google.protobuf.MessageLite resp)
Parse the response and populate the output hierarchy.
|
abstract com.google.protobuf.MessageLite |
sendRequest(com.google.protobuf.MessageLite req)
Send the request using RPC and fetch the response.
|
executeCommand, executeRealCommand, executeSimpleSHHCommand, executeSimpleSHHCommand, getCLICommand, getCommandUsage, getGIds, getInput, getKeyType, getParamBooleanValue, getParamDateValue, getParamIntValue, getParamLongValue, getParamObjectValue, getParamTextValue, getUserCredentials, getUserId, getUserLoginId, getVersion, isParamPresent, isParamValueEmpty, setServerCall, setUserCredentials, setVersion, validateInputpublic ListCommand(com.mapr.cliframework.base.ProcessedInput input,
com.mapr.cliframework.base.CLICommand cliCommand)
protected com.mapr.fs.cli.proto.CLIProto.Limiter getNextLimiter(int prevStart,
int prevCount,
int origStart,
int origLimit,
int numRecsPerRpc)
prevStart - - start index of the limiter in prev requestprevCount - - number of records returned in prev responseorigStart - - starting index of the records originally requested (using the cli -start param)origLimit - - number of records originally requested (using the cli -limit param)numRecsPerRpc - - number of records an rpc response can carryprotected <T> java.util.List<com.mapr.fs.cli.proto.CLIProto.Filter> getFilters(java.util.Map<T,com.mapr.cliframework.util.FieldInfo> table,
java.lang.String filterParam)
throws com.mapr.cliframework.base.CLIProcessingException
T - table - filterParam - com.mapr.cliframework.base.CLIProcessingExceptionprotected boolean hasMore(int origStart,
int origLimit,
int prevStart,
int prevCount)
origStart - - The original value for the -start parameterorigLimit - - The original value for the -limit parameterprevStart - - The value for the start parameter supplied during previous iteration.prevCount - - The number of records returned in the previous iteration.public void list(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out)
throws com.mapr.cliframework.base.CLIProcessingException
ListIteratorlist in interface ListIteratorout - - The output of all the processed responses.com.mapr.cliframework.base.CLIProcessingExceptionpublic abstract boolean hasMore(com.google.protobuf.MessageLite prevReq,
com.google.protobuf.MessageLite prevResp)
throws com.mapr.cliframework.base.CLIProcessingException
ListIteratorhasMore in interface ListIteratorcom.mapr.cliframework.base.CLIProcessingExceptionpublic abstract com.google.protobuf.MessageLite buildNextRequest(com.google.protobuf.MessageLite prevReq,
com.google.protobuf.MessageLite prevResp)
throws com.mapr.cliframework.base.CLIProcessingException
ListIteratorbuildNextRequest in interface ListIteratorcom.mapr.cliframework.base.CLIProcessingExceptionpublic abstract com.google.protobuf.MessageLite sendRequest(com.google.protobuf.MessageLite req)
throws com.mapr.cliframework.base.CLIProcessingException
ListIteratorsendRequest in interface ListIteratorreq - - request object.com.mapr.cliframework.base.CLIProcessingExceptionpublic abstract void processResponse(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out,
com.google.protobuf.MessageLite resp)
throws com.mapr.cliframework.base.CLIProcessingException
ListIteratorprocessResponse in interface ListIteratorout - - CommandOutput.OutputHierarchyresp - - response objectcom.mapr.cliframework.base.CLIProcessingException