@Override
  public void updateExtensionLink(ExtensionLinkEntity oldLinkEntity, ExtensionLinkRequest newLinkRequest) throws AmbariException {
    StackInfo stackInfo = ambariMetaInfo.getStack(oldLinkEntity.getStack().getStackName(), oldLinkEntity.getStack().getStackVersion());

    if (stackInfo == null) {
      throw new StackAccessException(String.format("stackName=%s, stackVersion=%s", oldLinkEntity.getStack().getStackName(), oldLinkEntity.getStack().getStackVersion()));
    }

    if (newLinkRequest.getExtensionName() == null || newLinkRequest.getExtensionVersion() == null) {
      throw new AmbariException(String.format("Invalid extension name or version: %s/%s",
		  newLinkRequest.getExtensionName(), newLinkRequest.getExtensionVersion()));
    }

    if (!newLinkRequest.getExtensionName().equals(oldLinkEntity.getExtension().getExtensionName())) {
      throw new AmbariException(String.format("Update is not allowed to switch the extension name, only the version.  Old name/new name: %s/%s",
		  oldLinkEntity.getExtension().getExtensionName(), newLinkRequest.getExtensionName()));
    }

    ExtensionInfo oldExtensionInfo = ambariMetaInfo.getExtension(oldLinkEntity.getExtension().getExtensionName(), oldLinkEntity.getExtension().getExtensionVersion());
    ExtensionInfo newExtensionInfo = ambariMetaInfo.getExtension(newLinkRequest.getExtensionName(), newLinkRequest.getExtensionVersion());

    if (oldExtensionInfo == null) {
      throw new StackAccessException(String.format("Old extensionName=%s, extensionVersion=%s", oldLinkEntity.getExtension().getExtensionName(), oldLinkEntity.getExtension().getExtensionVersion()));
    }
    if (newExtensionInfo == null) {
      throw new StackAccessException(String.format("New extensionName=%s, extensionVersion=%s", newLinkRequest.getExtensionName(), newLinkRequest.getExtensionVersion()));
    }

    helper.updateExtensionLink(ambariMetaInfo.getStackManager(), oldLinkEntity, stackInfo, oldExtensionInfo, newExtensionInfo);
  }
Update a link - switch the link's extension version while keeping the same stack version and extension name

@throws AmbariException if we fail to link the extension to the stack
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java