public void createCredentials(AddServiceInfo request) {
    if (!request.getRequest().getCredentials().isEmpty()) {
      LOG.info("Creating {} credential(s) for {}", request.getRequest().getCredentials().size(), request);

      request.getRequest().getCredentials().values().stream()
        .peek(credential -> LOG.debug("Creating credential {}", credential))
        .map(credential -> createCredentialRequestProperties(request.clusterName(), credential))
        .forEach(
          properties -> createResources(request, Resource.Type.Credential, ImmutableSet.of(properties), null, true)
        );
    }
  }
Creates resources using the resource providers.
Translates {@link AddServiceInfo} to internal requests accepted by those.
ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java