protected ModelAndView doHandle()

in aws-core-server/src/main/java/jetbrains/buildServer/serverSide/oauth/aws/controllers/AwsRotateKeysController.java [36:58]


  protected ModelAndView doHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response) throws Exception {
    ActionErrors errors = new ActionErrors();
    try {
      final String projectId = request.getParameter("projectId");
      if (projectId == null) {
        throw new AwsConnectorException("The ID of the project where to rotate keys is null.");
      }
      SProject project = myProjectManager.findProjectByExternalId(projectId);
      if (project == null) {
        throw new AwsConnectorException("Could not find the project with id: " + projectId);
      }

      String connectionId = request.getParameter("connectionId");
      Loggers.CLOUD.debug("Starting the key rotation process...");
      myAwsKeyRotator.rotateConnectionKeys(connectionId, project);

    } catch (Exception e) {
      handleException(e, errors);
    }

    writeAsJson(errors, response);
    return null;
  }