private Collection<Resource> getDependencyResources(Map<String, Object> properties, Set<String> requestedIds)
      throws SystemException, NoSuchParentResourceException, NoSuchResourceException {

    final String stackName = (String) properties.get(STACK_NAME_ID);
    final String version = (String) properties.get(STACK_VERSION_ID);
    final String dependentService = (String) properties.get(DEPENDENT_SERVICE_NAME_ID);
    final String dependentComponent = (String)  properties.get(DEPENDENT_COMPONENT_NAME_ID);
    final String dependencyName = (String) properties.get(COMPONENT_NAME_ID);

    List<DependencyInfo> dependencies = new ArrayList<>();
    if (dependencyName != null) {
      dependencies.add(getResources(new Command<DependencyInfo>() {
        @Override
        public DependencyInfo invoke() throws AmbariException {
          return ambariMetaInfo.getComponentDependency(stackName, version, dependentService,
              dependentComponent, dependencyName);
        }
      }));
    } else {
      dependencies.addAll(getResources(new Command<List<DependencyInfo>>() {
        @Override
        public List<DependencyInfo> invoke() throws AmbariException {
          return ambariMetaInfo.getComponentDependencies(stackName, version,
              dependentService, dependentComponent);
        }
      }));
    }

    Collection<Resource> resources = new ArrayList<>();
    for (DependencyInfo dependency : dependencies) {
      if (dependency != null) {
        resources.add(toResource(dependency, stackName, version, dependentService,
            dependentComponent, requestedIds));
      }
    }
    return resources;
  }
Get dependencies resources.

@param properties    request properties
@param requestedIds  requested id's

@return collection of dependency resources

@throws SystemException an internal error occurred
@throws NoSuchParentResourceException parent resource not found
@throws NoSuchResourceException dependency resource not found
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDependencyResourceProvider.java