private boolean checkKeytabsPrincipal(JsonArray identities) {
    String keytabFile = "";
    String principalValue = "";
    for (int i = 0; i < identities.size(); i++) {
      if (identities.get(i).getAsJsonObject().get("keytab") != null) {
        keytabFile = String.valueOf(identities.get(i).getAsJsonObject().get("keytab").getAsJsonObject().get("file"));
      }
      if (identities.get(i).getAsJsonObject().get("principal") != null) {
        principalValue = String.valueOf(identities.get(i).getAsJsonObject().get("principal").getAsJsonObject().get("value"));
      }
      if (!keytabFile.isEmpty() && !"null".equals(keytabFile)) {
        if (validateValues(keytabFile)) {
          return true;
        }
      }
      if (!principalValue.isEmpty() && !"null".equals(principalValue)) {
        if (validateValues(principalValue)) {
          return true;
        }
        ;
      }
    }
    return false;
  }
Create an artifact resource instance.

@param clusterName  cluster name
@param artifactName artifact name

@return an artifact resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java