@RequestMapping(value = "/update/{oid}", method = RequestMethod.POST)
  public String update(
      @PathVariable("oid") DomainKeyStore domainKeyStore,
      @RequestParam(value = "name", required = false) java.lang.String name,
      @RequestParam(value = "oldPassword", required = false) java.lang.String oldPassword,
      @RequestParam(value = "password", required = false) java.lang.String password,
      @RequestParam(value = "passwordVerification", required = false)
          java.lang.String passwordVerification,
      Model model) {

    setDomainKeyStore(domainKeyStore, model);

    if (domainKeyStore.isAbleToOpenKeyStore()
        && oldPassword != null
        && !domainKeyStore.getPassword().equals(oldPassword)) {
      addErrorMessage("Password incorrect", model);
      return "webservices/management/keystores/domainkeystore/update";
    }
    if (password != null && !password.equals(passwordVerification)) {
      addErrorMessage("Password and password verification did not match", model);
      if (!domainKeyStore.isAbleToOpenKeyStore()) {
        addWarningMessage(
            "Unable to open keystore. The most common problem is that the password is incorrect, hence when doing password update we'll only change in the system and not in the keystore itself. You can use this to fix the password problem.",
            model);
        model.addAttribute("noOldPasswordRequest", true);
      }
      return "webservices/management/keystores/domainkeystore/update";
    }

    updateDomainKeyStore(name, oldPassword, password, model);
    return "redirect:/webservices/management/keystores/domainkeystore/read/"
        + getDomainKeyStore(model).getExternalId();
  }
  @RequestMapping(value = "/read/{oid}")
  public String read(@PathVariable("oid") DomainKeyStore domainKeyStore, Model model) {

    if (!domainKeyStore.isAbleToOpenKeyStore()) {
      addWarningMessage(
          "Unable to open keystore. The most common problem is that the password is incorrect",
          model);
    }
    setDomainKeyStore(domainKeyStore, model);
    return "webservices/management/keystores/domainkeystore/read";
  }
  @RequestMapping(value = "/update/{oid}", method = RequestMethod.GET)
  public String update(@PathVariable("oid") DomainKeyStore domainKeyStore, Model model) {
    setDomainKeyStore(domainKeyStore, model);
    if (!domainKeyStore.isAbleToOpenKeyStore()) {
      addWarningMessage(
          "Unable to open keystore. The most common problem is that the password is incorrect, hence when doing password update we'll only change in the system and not in the keystore itself. You can use this to fix the password problem.",
          model);
      model.addAttribute("noOldPasswordRequest", true);
    }

    return "webservices/management/keystores/domainkeystore/update";
  }