Interface ListIterator

All Known Implementing Classes:
AlarmCommands, ClusterGroupCommands, DiskCommands, EntityCommands, FileFilterCommands, Heatmap, IamRolesCommands, IdentityPolicyCommands, InstallerCommands, ListCommand, NfsShareCommands, OffloadRuleCommands, S3BucketCommands, S3DomainCommands, S3KeysCommands, S3UserCommands, SecurityPolicyCommands, ServerCommands, ShareTemplateCommands, SnapshotCommands, TierCommands, UserSessionCommands, VirtualIPCommands, VolumeCommands, VolumeMetricsCommand

public interface ListIterator
Interface to fetch records from server in iterations.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    void
    processResponse(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, com.google.protobuf.MessageLite resp)
    Parse the response and populate the output hierarchy.
    com.google.protobuf.MessageLite
    sendRequest(com.google.protobuf.MessageLite req)
    Send the request using RPC and fetch the response.
  • Method Details

    • list

      void list(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out) throws com.mapr.cliframework.base.CLIProcessingException
      Initiates the iteration process. while (hasMore()) { buildNextRequest sendRequest processResponse }
      Parameters:
      out - - The output of all the processed responses.
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • hasMore

      boolean hasMore(com.google.protobuf.MessageLite prevReq, com.google.protobuf.MessageLite prevResp) throws com.mapr.cliframework.base.CLIProcessingException
      Inspect the last request and last response to see if there are more records to be fetched.
      Parameters:
      prevReq -
      prevResp -
      Returns:
      - true, if there are more records. false, if no more.
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • buildNextRequest

      com.google.protobuf.MessageLite buildNextRequest(com.google.protobuf.MessageLite prevReq, com.google.protobuf.MessageLite prevResp) throws com.mapr.cliframework.base.CLIProcessingException
      Builds the next request object by inspecting the previous request and previous response.
      Parameters:
      req - - Previous request
      resp - - Previous response
      Returns:
      - new request object
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • sendRequest

      com.google.protobuf.MessageLite sendRequest(com.google.protobuf.MessageLite req) throws com.mapr.cliframework.base.CLIProcessingException
      Send the request using RPC and fetch the response.
      Parameters:
      req - - request object.
      Returns:
      - the response object.
      Throws:
      com.mapr.cliframework.base.CLIProcessingException
    • processResponse

      void processResponse(com.mapr.cliframework.base.CommandOutput.OutputHierarchy out, com.google.protobuf.MessageLite resp) throws com.mapr.cliframework.base.CLIProcessingException
      Parse the response and populate the output hierarchy.
      Parameters:
      out - - CommandOutput.OutputHierarchy
      resp - - response object
      Throws:
      com.mapr.cliframework.base.CLIProcessingException