code: public static RequestLocationMode getListingLocationMode(ResultContinuation token) {
          if ((token != null) && token.getTargetLocation() != null) {
              switch (token.getTargetLocation()) {
                  case PRIMARY:
                      return RequestLocationMode.PRIMARY_ONLY;
  
                  case SECONDARY:
                      return RequestLocationMode.SECONDARY_ONLY;
  
                  default:
                      throw new IllegalArgumentException(String.format(SR.ARGUMENT_OUT_OF_RANGE_ERROR, "token",
                              token.getTargetLocation()));
              }
          }
  
          return RequestLocationMode.PRIMARY_OR_SECONDARY;
      }
docs: Determines which location can the listing command target by looking at the
  continuation token.
  
  @param token
  Continuation token
  @return
  Location mode