@RequiresSession
  public List<ExtensionLinkEntity> find(ExtensionLinkRequest request) {
    if (request.getLinkId() != null) {
      ExtensionLinkEntity entity = findById(Long.parseLong(request.getLinkId()));
      List<ExtensionLinkEntity> list = new ArrayList<>();
      list.add(entity);
      return list;
    }

    String stackName = request.getStackName();
    String stackVersion = request.getStackVersion();
    String extensionName = request.getExtensionName();
    String extensionVersion = request.getExtensionVersion();

    if (stackName != null && stackVersion != null) {
      if (extensionName != null) {
        if (extensionVersion != null) {
          ExtensionLinkEntity entity = findByStackAndExtension(stackName, stackVersion, extensionName, extensionVersion);
          List<ExtensionLinkEntity> list = new ArrayList<>();
          list.add(entity);
          return list;
        }
        return findByStackAndExtensionName(stackName, stackVersion, extensionName);
      }
      return findByStack(stackName, stackVersion);
    }
    if (extensionName != null && extensionVersion != null) {
      return findByExtension(extensionName, extensionVersion);
    }

    return findAll();
  }
Gets the extension links that match the specified stack name and version.

@return the extension links  matching the specified stack name and version if any.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ExtensionLinkDAO.java