private Resource toResource(String clusterName, String alias, CredentialStoreType credentialStoreType, Set<String> requestedIds) {
    Resource resource = new ResourceImpl(Type.Credential);
    setResourceProperty(resource, CREDENTIAL_CLUSTER_NAME_PROPERTY_ID, clusterName, requestedIds);
    setResourceProperty(resource, CREDENTIAL_ALIAS_PROPERTY_ID, alias, requestedIds);
    setResourceProperty(resource, CREDENTIAL_TYPE_PROPERTY_ID, credentialStoreType.name().toLowerCase(), requestedIds);
    return resource;
  }
Creates a new resource from the given cluster name, alias, and persist values.

@param clusterName         a cluster name
@param alias               an alias
@param credentialStoreType the relevant credential store type
@param requestedIds        the properties to include in the resulting resource instance
@return a resource
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java