class UsernamePasswordInterceptor extends AbstractCliAroundInterceptor {

  @Override
  public ResultModel preExecution(GfshParseResult parseResult) {
    if (gfsh == null || !gfsh.isConnectedAndReady()) {
      return new ResultModel();
    }

    String userInput = parseResult.getUserInput();

    String username = parseResult.getParamValueAsString("username");
    String password = parseResult.getParamValueAsString("password");

    if (!StringUtils.isBlank(password) && StringUtils.isBlank(username)) {
      username = gfsh.readText(CliStrings.INTERCEPTOR_USERNAME);
      userInput = userInput + " --username=" + username;
      parseResult.setUserInput(userInput);
    } else if (!StringUtils.isBlank(username) && StringUtils.isBlank(password)) {
      password = gfsh.readPassword(CliStrings.INTERCEPTOR_PASSWORD);
      userInput = userInput + " --password=" + password;
      parseResult.setUserInput(userInput);
    }

    return new ResultModel();
  }

  public  UsernamePasswordInterceptor();
  public  UsernamePasswordInterceptor(Gfsh gfsh);

}