ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject [4/5] ambari git commit: AMBARI-22353. Remove properties.json And Switch To Adding Properties to ResourceProviders Dynamically (dlysnichenko)
Date Mon, 04 Dec 2017 16:21:51 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
index 2a25bc4..db514de 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentProcessResourceProvider.java
@@ -18,7 +18,6 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Map;
@@ -39,6 +38,9 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ServiceComponentHost;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 /**
  * Resource Provider for HostComponent process resources.
  */
@@ -54,22 +56,36 @@ public class HostComponentProcessResourceProvider extends ReadOnlyResourceProvid
   public static final String HC_PROCESS_HOST_NAME_ID = "HostComponentProcess/host_name";
   public static final String HC_PROCESS_COMPONENT_NAME_ID = "HostComponentProcess/component_name";
 
-  // Primary Key Fields
-  private static Set<String> pkPropertyIds =
-    new HashSet<>(Arrays.asList(new String[]{
-      HC_PROCESS_CLUSTER_NAME_ID, HC_PROCESS_HOST_NAME_ID, HC_PROCESS_COMPONENT_NAME_ID, HC_PROCESS_NAME_ID}));
+  /**
+   * The key property ids for a HostComponentProcess resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Cluster, HC_PROCESS_CLUSTER_NAME_ID)
+      .put(Resource.Type.Host, HC_PROCESS_HOST_NAME_ID)
+      .put(Resource.Type.Component, HC_PROCESS_COMPONENT_NAME_ID)
+      .put(Resource.Type.HostComponent, HC_PROCESS_COMPONENT_NAME_ID)
+      .put(Resource.Type.HostComponentProcess, HC_PROCESS_NAME_ID)
+      .build();
+
+  /**
+   * The property ids for a HostComponentProcess resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      HC_PROCESS_NAME_ID,
+      HC_PROCESS_STATUS_ID,
+      HC_PROCESS_CLUSTER_NAME_ID,
+      HC_PROCESS_HOST_NAME_ID,
+      HC_PROCESS_COMPONENT_NAME_ID);
 
   // ----- Constructors ----------------------------------------------------
 
   /**
    * Create a  new resource provider for the given management controller.
    *
-   * @param propertyIds     the property ids
-   * @param keyPropertyIds  the key property ids
+   * @param amc the management controller
    */
-  HostComponentProcessResourceProvider(Set<String> propertyIds,
-      Map<Resource.Type, String> keyPropertyIds, AmbariManagementController amc) {
-    super(propertyIds, keyPropertyIds, amc);
+  HostComponentProcessResourceProvider(AmbariManagementController amc) {
+    super(Resource.Type.HostComponentProcess, propertyIds, keyPropertyIds, amc);
   }
 
 
@@ -77,7 +93,7 @@ public class HostComponentProcessResourceProvider extends ReadOnlyResourceProvid
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index 94766a5..cf58325 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -18,7 +18,6 @@
 package org.apache.ambari.server.controller.internal;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumMap;
@@ -69,6 +68,8 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.assistedinject.Assisted;
@@ -84,6 +85,8 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
   // ----- Property ID constants ---------------------------------------------
 
   // Host Components
+  public static final String HOST_COMPONENT_ROLE_ID
+      = PropertyHelper.getPropertyId("HostRoles", "role_id");
   public static final String HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID
       = PropertyHelper.getPropertyId("HostRoles", "cluster_name");
   public static final String HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID
@@ -120,12 +123,40 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
 
   //Parameters from the predicate
   private static final String QUERY_PARAMETERS_RUN_SMOKE_TEST_ID = "params/run_smoke_test";
-  private static Set<String> pkPropertyIds =
-    new HashSet<>(Arrays.asList(new String[]{
+
+  /**
+   * The key property ids for a HostComponent resource.
+   */
+  public static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Cluster, HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID)
+      .put(Resource.Type.Host, HOST_COMPONENT_HOST_NAME_PROPERTY_ID)
+      .put(Resource.Type.HostComponent, HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID)
+      .put(Resource.Type.Component, HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a HostComponent resource.
+   */
+  protected static Set<String> propertyIds = Sets.newHashSet(
+      HOST_COMPONENT_ROLE_ID,
       HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID,
       HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID,
       HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID,
-      HOST_COMPONENT_HOST_NAME_PROPERTY_ID}));
+      HOST_COMPONENT_DISPLAY_NAME_PROPERTY_ID,
+      HOST_COMPONENT_HOST_NAME_PROPERTY_ID,
+      HOST_COMPONENT_PUBLIC_HOST_NAME_PROPERTY_ID,
+      HOST_COMPONENT_STATE_PROPERTY_ID,
+      HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID,
+      HOST_COMPONENT_VERSION_PROPERTY_ID,
+      HOST_COMPONENT_DESIRED_STACK_ID_PROPERTY_ID,
+      HOST_COMPONENT_DESIRED_REPOSITORY_VERSION,
+      HOST_COMPONENT_ACTUAL_CONFIGS_PROPERTY_ID,
+      HOST_COMPONENT_STALE_CONFIGS_PROPERTY_ID,
+      HOST_COMPONENT_RELOAD_CONFIGS_PROPERTY_ID,
+      HOST_COMPONENT_DESIRED_ADMIN_STATE_PROPERTY_ID,
+      HOST_COMPONENT_MAINTENANCE_STATE_PROPERTY_ID,
+      HOST_COMPONENT_UPGRADE_STATE_PROPERTY_ID,
+      QUERY_PARAMETERS_RUN_SMOKE_TEST_ID);
 
   /**
    * maintenance state helper
@@ -141,16 +172,12 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
   /**
    * Create a  new resource provider for the given management controller.
    *
-   * @param propertyIds          the property ids
-   * @param keyPropertyIds       the key property ids
    * @param managementController the management controller
    */
   @AssistedInject
-  public HostComponentResourceProvider(@Assisted Set<String> propertyIds,
-                                       @Assisted Map<Resource.Type, String> keyPropertyIds,
-                                       @Assisted AmbariManagementController managementController,
+  public HostComponentResourceProvider(@Assisted AmbariManagementController managementController,
                                        Injector injector) {
-    super(propertyIds, keyPropertyIds, managementController);
+    super(Resource.Type.HostComponent, propertyIds, keyPropertyIds, managementController);
 
     setRequiredCreateAuthorizations(EnumSet.of(RoleAuthorization.SERVICE_ADD_DELETE_SERVICES,RoleAuthorization.HOST_ADD_DELETE_COMPONENTS));
     setRequiredDeleteAuthorizations(EnumSet.of(RoleAuthorization.SERVICE_ADD_DELETE_SERVICES,RoleAuthorization.HOST_ADD_DELETE_COMPONENTS));
@@ -662,7 +689,7 @@ public class HostComponentResourceProvider extends AbstractControllerResourcePro
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
index 0672500..52ab9b5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostKerberosIdentityResourceProvider.java
@@ -125,7 +125,7 @@ public class HostKerberosIdentityResourceProvider extends ReadOnlyResourceProvid
    */
   @AssistedInject
   HostKerberosIdentityResourceProvider(@Assisted AmbariManagementController managementController) {
-    super(PROPERTY_IDS, PK_PROPERTY_MAP, managementController);
+    super(Resource.Type.HostKerberosIdentity, PROPERTY_IDS, PK_PROPERTY_MAP, managementController);
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
index 5c740f1..f683afd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
@@ -72,7 +72,8 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
 import com.google.inject.assistedinject.AssistedInject;
@@ -114,6 +115,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
   public static final String RECOVERY_SUMMARY_PROPERTY_ID = "recovery_summary";
   public static final String STATE_PROPERTY_ID = "host_state";
   public static final String TOTAL_MEM_PROPERTY_ID = "total_mem";
+  public static final String ATTRIBUTES_PROPERTY_ID = "attributes";
 
   public static final String HOST_CLUSTER_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + CLUSTER_NAME_PROPERTY_ID;
   public static final String HOST_CPU_COUNT_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + CPU_COUNT_PROPERTY_ID;
@@ -137,6 +139,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
   public static final String HOST_RECOVERY_SUMMARY_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + RECOVERY_SUMMARY_PROPERTY_ID;
   public static final String HOST_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + STATE_PROPERTY_ID;
   public static final String HOST_TOTAL_MEM_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + TOTAL_MEM_PROPERTY_ID;
+  public static final String HOST_ATTRIBUTES_PROPERTY_ID = PropertyHelper.getPropertyId(RESPONSE_KEY,ATTRIBUTES_PROPERTY_ID);
 
   public static final String BLUEPRINT_PROPERTY_ID = "blueprint";
   public static final String HOST_GROUP_PROPERTY_ID = "host_group";
@@ -145,7 +148,41 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
 
   //todo use the same json structure for cluster host addition (cluster template and upscale)
 
-  private static final Set<String> PK_PROPERTY_IDS = ImmutableSet.of(HOST_HOST_NAME_PROPERTY_ID);
+  /**
+   * The key property ids for a Host resource.
+   */
+  public static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Host, HOST_HOST_NAME_PROPERTY_ID)
+      .put(Resource.Type.Cluster, HOST_CLUSTER_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a Host resource.
+   */
+  public static Set<String> propertyIds = Sets.newHashSet(
+      HOST_CLUSTER_NAME_PROPERTY_ID,
+      HOST_CPU_COUNT_PROPERTY_ID,
+      HOST_DESIRED_CONFIGS_PROPERTY_ID,
+      HOST_DISK_INFO_PROPERTY_ID,
+      HOST_HOST_HEALTH_REPORT_PROPERTY_ID,
+      HOST_HOST_STATUS_PROPERTY_ID,
+      HOST_IP_PROPERTY_ID,
+      HOST_LAST_AGENT_ENV_PROPERTY_ID,
+      HOST_LAST_HEARTBEAT_TIME_PROPERTY_ID,
+      HOST_LAST_REGISTRATION_TIME_PROPERTY_ID,
+      HOST_MAINTENANCE_STATE_PROPERTY_ID,
+      HOST_HOST_NAME_PROPERTY_ID,
+      HOST_OS_ARCH_PROPERTY_ID,
+      HOST_OS_FAMILY_PROPERTY_ID,
+      HOST_OS_TYPE_PROPERTY_ID,
+      HOST_PHYSICAL_CPU_COUNT_PROPERTY_ID,
+      HOST_PUBLIC_NAME_PROPERTY_ID,
+      HOST_RACK_INFO_PROPERTY_ID,
+      HOST_RECOVERY_REPORT_PROPERTY_ID,
+      HOST_RECOVERY_SUMMARY_PROPERTY_ID,
+      HOST_STATE_PROPERTY_ID,
+      HOST_TOTAL_MEM_PROPERTY_ID,
+      HOST_ATTRIBUTES_PROPERTY_ID);
 
   @Inject
   private OsFamily osFamily;
@@ -158,15 +195,11 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
   /**
    * Create a  new resource provider for the given management controller.
    *
-   * @param propertyIds           the property ids
-   * @param keyPropertyIds        the key property ids
    * @param managementController  the management controller
    */
   @AssistedInject
-  HostResourceProvider(@Assisted Set<String> propertyIds,
-                       @Assisted Map<Resource.Type, String> keyPropertyIds,
-                       @Assisted AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  HostResourceProvider(@Assisted AmbariManagementController managementController) {
+    super(Resource.Type.Host, propertyIds, keyPropertyIds, managementController);
 
     Set<RoleAuthorization> authorizationsAddDelete = EnumSet.of(RoleAuthorization.HOST_ADD_DELETE_HOSTS);
 
@@ -354,7 +387,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return PK_PROPERTY_IDS;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
index 48e9f59..5282ad4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
@@ -166,7 +166,7 @@ public class HostStackVersionResourceProvider extends AbstractControllerResource
    */
   public HostStackVersionResourceProvider(
           AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+    super(Type.HostStackVersion, propertyIds, keyPropertyIds, managementController);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
index d3a695b..3d34982 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/InstanceResourceProvider.java
@@ -18,7 +18,6 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -39,6 +38,9 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 /**
  * DR instance resource provider.
  */
@@ -54,21 +56,34 @@ public class InstanceResourceProvider extends AbstractDRResourceProvider {
   protected static final String INSTANCE_DETAILS_PROPERTY_ID    = PropertyHelper.getPropertyId("Instance", "details");
   protected static final String INSTANCE_LOG_PROPERTY_ID        = PropertyHelper.getPropertyId("Instance", "log");
 
-  private static Set<String> pkPropertyIds =
-    new HashSet<>(Arrays.asList(new String[]{
+
+
+  /**
+   * The key property ids for a Instance resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.DRInstance, INSTANCE_FEED_NAME_PROPERTY_ID)
+      .put(Resource.Type.Workflow, INSTANCE_ID_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a Instance resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
       INSTANCE_FEED_NAME_PROPERTY_ID,
-      INSTANCE_ID_PROPERTY_ID}));
+      INSTANCE_ID_PROPERTY_ID,
+      INSTANCE_STATUS_PROPERTY_ID,
+      INSTANCE_START_TIME_PROPERTY_ID,
+      INSTANCE_END_TIME_PROPERTY_ID,
+      INSTANCE_DETAILS_PROPERTY_ID,
+      INSTANCE_LOG_PROPERTY_ID);
 
   /**
    * Construct a provider.
    *
    * @param ivoryService    the ivory service
-   * @param propertyIds     the properties associated with this provider
-   * @param keyPropertyIds  the key property ids
    */
-  public InstanceResourceProvider(IvoryService ivoryService,
-                                  Set<String> propertyIds,
-                                  Map<Resource.Type, String> keyPropertyIds) {
+  public InstanceResourceProvider(IvoryService ivoryService) {
     super(propertyIds, keyPropertyIds, ivoryService);
   }
 
@@ -180,7 +195,7 @@ public class InstanceResourceProvider extends AbstractDRResourceProvider {
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
index e70c367..93bf42a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/JobResourceProvider.java
@@ -22,7 +22,6 @@ import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -45,6 +44,9 @@ import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 /**
  * Resource provider for job resources.
  */
@@ -81,22 +83,40 @@ public class JobResourceProvider extends
   protected static final String JOB_WORKFLOW_ENTITY_NAME_PROPERTY_ID = PropertyHelper
       .getPropertyId("Job", "workflow_entity_name");
 
-  private static final Set<String> pkPropertyIds = new HashSet<>(
-    Arrays.asList(new String[]{JOB_CLUSTER_NAME_PROPERTY_ID,
-      JOB_WORKFLOW_ID_PROPERTY_ID, JOB_ID_PROPERTY_ID}));
-
   protected JobFetcher jobFetcher;
 
   /**
+   * The key property ids for a Job resource.
+   */
+  protected static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.Cluster, JOB_CLUSTER_NAME_PROPERTY_ID)
+      .put(Type.Workflow, JOB_WORKFLOW_ID_PROPERTY_ID)
+      .put(Type.Job, JOB_ID_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a Job resource.
+   */
+  protected static Set<String> propertyIds = Sets.newHashSet(
+      JOB_CLUSTER_NAME_PROPERTY_ID,
+      JOB_WORKFLOW_ID_PROPERTY_ID,
+      JOB_ID_PROPERTY_ID,
+      JOB_NAME_PROPERTY_ID,
+      JOB_STATUS_PROPERTY_ID,
+      JOB_USER_NAME_PROPERTY_ID,
+      JOB_SUBMIT_TIME_PROPERTY_ID,
+      JOB_ELAPSED_TIME_PROPERTY_ID,
+      JOB_MAPS_PROPERTY_ID,
+      JOB_REDUCES_PROPERTY_ID,
+      JOB_INPUT_BYTES_PROPERTY_ID,
+      JOB_OUTPUT_BYTES_PROPERTY_ID,
+      JOB_CONF_PATH_PROPERTY_ID,
+      JOB_WORKFLOW_ENTITY_NAME_PROPERTY_ID);
+
+  /**
    * Create a new job resource provider.
-   * 
-   * @param propertyIds
-   *          the property ids
-   * @param keyPropertyIds
-   *          the key property ids
    */
-  protected JobResourceProvider(Set<String> propertyIds,
-      Map<Type,String> keyPropertyIds) {
+  protected JobResourceProvider() {
     super(propertyIds, keyPropertyIds);
     jobFetcher = new PostgresJobFetcher(
         new JobHistoryPostgresConnectionFactory());
@@ -105,15 +125,10 @@ public class JobResourceProvider extends
   /**
    * Create a new job resource provider.
    * 
-   * @param propertyIds
-   *          the property ids
-   * @param keyPropertyIds
-   *          the key property ids
    * @param jobFetcher
    *          job fetcher
    */
-  protected JobResourceProvider(Set<String> propertyIds,
-      Map<Type,String> keyPropertyIds, JobFetcher jobFetcher) {
+  protected JobResourceProvider(JobFetcher jobFetcher) {
     super(propertyIds, keyPropertyIds);
     this.jobFetcher = jobFetcher;
   }
@@ -162,15 +177,11 @@ public class JobResourceProvider extends
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
   @Override
   public Map<Type,String> getKeyPropertyIds() {
-    Map<Type,String> keyPropertyIds = new HashMap<>();
-    keyPropertyIds.put(Type.Cluster, JOB_CLUSTER_NAME_PROPERTY_ID);
-    keyPropertyIds.put(Type.Workflow, JOB_WORKFLOW_ID_PROPERTY_ID);
-    keyPropertyIds.put(Type.Job, JOB_ID_PROPERTY_ID);
     return keyPropertyIds;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
index 9301341..773064d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
@@ -26,6 +26,8 @@ import org.apache.ambari.server.topology.KerberosDescriptorFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 import com.google.inject.assistedinject.Assisted;
 
 /**
@@ -55,6 +57,20 @@ public class KerberosDescriptorResourceProvider extends AbstractControllerResour
   private static final String KERBEROS_DESCRIPTOR_TEXT_PROPERTY_ID =
       PropertyHelper.getPropertyId("KerberosDescriptors", "kerberos_descriptor_text");
 
+  /**
+   * The key property ids for a KerberosDescriptor resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.KerberosDescriptor, KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a KerberosDescriptor resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID,
+      KERBEROS_DESCRIPTOR_TEXT_PROPERTY_ID);
+
   private KerberosDescriptorDAO kerberosDescriptorDAO;
 
   private KerberosDescriptorFactory kerberosDescriptorFactory;
@@ -63,10 +79,8 @@ public class KerberosDescriptorResourceProvider extends AbstractControllerResour
   @Inject
   KerberosDescriptorResourceProvider(KerberosDescriptorDAO kerberosDescriptorDAO,
                                      KerberosDescriptorFactory kerberosDescriptorFactory,
-                                     @Assisted Set<String> propertyIds,
-                                     @Assisted Map<Resource.Type, String> keyPropertyIds,
                                      @Assisted AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+    super(Resource.Type.KerberosDescriptor, propertyIds, keyPropertyIds, managementController);
     this.kerberosDescriptorDAO = kerberosDescriptorDAO;
     this.kerberosDescriptorFactory = kerberosDescriptorFactory;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
index fc409a3..ad7562a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java
@@ -60,6 +60,9 @@ import org.apache.ambari.server.security.ldap.LdapBatchDto;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 /**
  * Resource provider for ldap sync events.
  */
@@ -97,33 +100,29 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
   /**
    * The key property ids for a event resource.
    */
-  private static Map<Resource.Type, String> keyPropertyIds = new HashMap<>();
-  static {
-    keyPropertyIds.put(Resource.Type.LdapSyncEvent, EVENT_ID_PROPERTY_ID);
-  }
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.LdapSyncEvent, EVENT_ID_PROPERTY_ID)
+      .build();
 
   /**
    * The property ids for a event resource.
    */
-  private static Set<String> propertyIds = new HashSet<>();
-
-  static {
-    propertyIds.add(EVENT_ID_PROPERTY_ID);
-    propertyIds.add(EVENT_STATUS_PROPERTY_ID);
-    propertyIds.add(EVENT_STATUS_DETAIL_PROPERTY_ID);
-    propertyIds.add(EVENT_START_TIME_PROPERTY_ID);
-    propertyIds.add(EVENT_END_TIME_PROPERTY_ID);
-    propertyIds.add(USERS_CREATED_PROPERTY_ID);
-    propertyIds.add(USERS_UPDATED_PROPERTY_ID);
-    propertyIds.add(USERS_REMOVED_PROPERTY_ID);
-    propertyIds.add(USERS_SKIPPED_PROPERTY_ID);
-    propertyIds.add(GROUPS_CREATED_PROPERTY_ID);
-    propertyIds.add(GROUPS_UPDATED_PROPERTY_ID);
-    propertyIds.add(GROUPS_REMOVED_PROPERTY_ID);
-    propertyIds.add(MEMBERSHIPS_CREATED_PROPERTY_ID);
-    propertyIds.add(MEMBERSHIPS_REMOVED_PROPERTY_ID);
-    propertyIds.add(EVENT_SPECS_PROPERTY_ID);
-  }
+  private static Set<String> propertyIds = Sets.newHashSet(
+      EVENT_ID_PROPERTY_ID,
+      EVENT_STATUS_PROPERTY_ID,
+      EVENT_STATUS_DETAIL_PROPERTY_ID,
+      EVENT_START_TIME_PROPERTY_ID,
+      EVENT_END_TIME_PROPERTY_ID,
+      USERS_CREATED_PROPERTY_ID,
+      USERS_UPDATED_PROPERTY_ID,
+      USERS_REMOVED_PROPERTY_ID,
+      USERS_SKIPPED_PROPERTY_ID,
+      GROUPS_CREATED_PROPERTY_ID,
+      GROUPS_UPDATED_PROPERTY_ID,
+      GROUPS_REMOVED_PROPERTY_ID,
+      MEMBERSHIPS_CREATED_PROPERTY_ID,
+      MEMBERSHIPS_REMOVED_PROPERTY_ID,
+      EVENT_SPECS_PROPERTY_ID);
 
   /**
    * Spec property keys.
@@ -164,7 +163,7 @@ public class LdapSyncEventResourceProvider extends AbstractControllerResourcePro
    * Construct a event resource provider.
    */
   public LdapSyncEventResourceProvider(AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+    super(Resource.Type.LdapSyncEvent, propertyIds, keyPropertyIds, managementController);
 
     EnumSet<RoleAuthorization> roleAuthorizations =
         EnumSet.of(RoleAuthorization.AMBARI_MANAGE_GROUPS, RoleAuthorization.AMBARI_MANAGE_USERS);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
index d6afe7b..01766ed 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
@@ -66,13 +66,8 @@ public class LoggingResourceProvider extends AbstractControllerResourceProvider
   }
 
 
-  public LoggingResourceProvider(Set<String> propertyIds,
-                                 Map<Resource.Type, String> keyPropertyIds,
-                                 AmbariManagementController controller) {
-
-
-
-    super(PROPERTY_IDS, KEY_PROPERTY_IDS, controller);
+  public LoggingResourceProvider(AmbariManagementController controller) {
+    super(Resource.Type.LoggingQuery, PROPERTY_IDS, KEY_PROPERTY_IDS, controller);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
index 3cecddb..d4c1e03 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/MemberResourceProvider.java
@@ -17,7 +17,6 @@
  */
 package org.apache.ambari.server.controller.internal;
 
-import java.util.Arrays;
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -42,6 +41,8 @@ import org.apache.ambari.server.security.authorization.RoleAuthorization;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 import com.google.inject.assistedinject.Assisted;
 import com.google.inject.assistedinject.AssistedInject;
 import com.google.inject.persist.Transactional;
@@ -59,23 +60,29 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
   public static final String MEMBER_GROUP_NAME_PROPERTY_ID = PropertyHelper.getPropertyId("MemberInfo", "group_name");
   public static final String MEMBER_USER_NAME_PROPERTY_ID  = PropertyHelper.getPropertyId("MemberInfo", "user_name");
 
-  private static Set<String> pkPropertyIds =
-    new HashSet<>(Arrays.asList(new String[]{
+  /**
+   * The key property ids for a Member resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Group, MEMBER_GROUP_NAME_PROPERTY_ID)
+      .put(Resource.Type.Member, MEMBER_USER_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a Member resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
       MEMBER_GROUP_NAME_PROPERTY_ID,
-      MEMBER_USER_NAME_PROPERTY_ID}));
+      MEMBER_USER_NAME_PROPERTY_ID);
 
   /**
    * Create a  new resource provider for the given management controller.
    *
-   * @param propertyIds           the property ids
-   * @param keyPropertyIds        the key property ids
    * @param managementController  the management controller
    */
   @AssistedInject
-  public MemberResourceProvider(@Assisted Set<String> propertyIds,
-                          @Assisted Map<Resource.Type, String> keyPropertyIds,
-                          @Assisted AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  public MemberResourceProvider(@Assisted AmbariManagementController managementController) {
+    super(Resource.Type.Member, propertyIds, keyPropertyIds, managementController);
 
     EnumSet<RoleAuthorization> manageUserAuthorizations = EnumSet.of(RoleAuthorization.AMBARI_MANAGE_USERS);
     setRequiredCreateAuthorizations(manageUserAuthorizations);
@@ -193,7 +200,7 @@ public class MemberResourceProvider extends AbstractControllerResourceProvider {
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
   private MemberRequest getRequest(Map<String, Object> properties) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
index 174fdf6..2310a28 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
@@ -74,7 +74,7 @@ public class OperatingSystemResourceProvider extends ReadOnlyResourceProvider {
   };
 
   protected OperatingSystemResourceProvider(AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+    super(Resource.Type.OperatingSystem, propertyIds, keyPropertyIds, managementController);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
index 43cdf2b..dd9fa16 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
@@ -18,7 +18,6 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
@@ -35,6 +34,9 @@ import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.orm.dao.PermissionDAO;
 import org.apache.ambari.server.orm.entities.PermissionEntity;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 /**
  * Resource provider for permission instances.
  */
@@ -58,22 +60,19 @@ public class PermissionResourceProvider extends AbstractResourceProvider {
   /**
    * The key property ids for a permission resource.
    */
-  private static Map<Resource.Type, String> keyPropertyIds = new HashMap<>();
-  static {
-    keyPropertyIds.put(Resource.Type.Permission, PERMISSION_ID_PROPERTY_ID);
-  }
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Permission, PERMISSION_ID_PROPERTY_ID)
+      .build();
 
   /**
    * The property ids for a permission resource.
    */
-  private static Set<String> propertyIds = new HashSet<>();
-  static {
-    propertyIds.add(PERMISSION_ID_PROPERTY_ID);
-    propertyIds.add(PERMISSION_NAME_PROPERTY_ID);
-    propertyIds.add(PERMISSION_LABEL_PROPERTY_ID);
-    propertyIds.add(RESOURCE_NAME_PROPERTY_ID);
-    propertyIds.add(SORT_ORDER_PROPERTY_ID);
-  }
+  private static Set<String> propertyIds = Sets.newHashSet(
+      PERMISSION_ID_PROPERTY_ID,
+      PERMISSION_NAME_PROPERTY_ID,
+      PERMISSION_LABEL_PROPERTY_ID,
+      RESOURCE_NAME_PROPERTY_ID,
+      SORT_ORDER_PROPERTY_ID);
 
 
   // ----- Constructors ------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java
index fabce6b..717b83b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java
@@ -111,7 +111,7 @@ public abstract class PrivilegeResourceProvider<T> extends AbstractAuthorizedRes
   public PrivilegeResourceProvider(Set<String> propertyIds,
                                    Map<Resource.Type, String> keyPropertyIds,
                                    Resource.Type resourceType) {
-    super(propertyIds, keyPropertyIds);
+    super(resourceType, propertyIds, keyPropertyIds);
     this.resourceType = resourceType;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
index f293941..534c369 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/QuickLinkArtifactResourceProvider.java
@@ -96,7 +96,7 @@ public class QuickLinkArtifactResourceProvider extends AbstractControllerResourc
    * @param managementController the management controller
    */
   protected QuickLinkArtifactResourceProvider(AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+    super(Resource.Type.QuickLink, propertyIds, keyPropertyIds, managementController);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReadOnlyResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReadOnlyResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReadOnlyResourceProvider.java
index 505ec63..e0f95d6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReadOnlyResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReadOnlyResourceProvider.java
@@ -28,7 +28,6 @@ import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.RequestStatus;
 import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.Resource.Type;
 import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
@@ -37,12 +36,6 @@ public abstract class ReadOnlyResourceProvider extends AbstractControllerResourc
 
   private static final String READ_ONLY_MSG = "Read-only resource";
 
-  protected ReadOnlyResourceProvider(Set<String> propertyIds,
-      Map<Type, String> keyPropertyIds,
-      AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
-  }
-
   /**
    * Create a new resource provider for the given management controller. This
    * constructor will initialize the specified {@link Resource.Type} with the

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
index 9c6259c..dcc6cb6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RecommendationResourceProvider.java
@@ -46,6 +46,9 @@ import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 public class RecommendationResourceProvider extends StackAdvisorResourceProvider {
 
   private static final Logger LOG = LoggerFactory.getLogger(RecommendationResourceProvider.class);
@@ -56,10 +59,13 @@ public class RecommendationResourceProvider extends StackAdvisorResourceProvider
   protected static final String HOSTS_PROPERTY_ID = "hosts";
   protected static final String SERVICES_PROPERTY_ID = "services";
   protected static final String RECOMMEND_PROPERTY_ID = "recommend";
+  protected static final String RECOMMENDATIONS_PROPERTY_ID = "recommendations";
 
   protected static final String CONFIG_GROUPS_PROPERTY_ID = PropertyHelper
       .getPropertyId("recommendations", "config-groups");
 
+  protected static final String BLUEPRINT_PROPERTY_ID = PropertyHelper
+      .getPropertyId("recommendations", "blueprint");
   protected static final String BLUEPRINT_CONFIGURATIONS_PROPERTY_ID = PropertyHelper
       .getPropertyId("recommendations/blueprint", "configurations");
 
@@ -72,13 +78,56 @@ public class RecommendationResourceProvider extends StackAdvisorResourceProvider
       "recommendations/blueprint_cluster_binding", "host_groups");
   protected static final String BINDING_HOST_GROUPS_NAME_PROPERTY_ID = "name";
   protected static final String BINDING_HOST_GROUPS_HOSTS_PROPERTY_ID = "hosts";
-
-  private static Set<String> pkPropertyIds = new HashSet<>(
-    Arrays.asList(new String[]{RECOMMENDATION_ID_PROPERTY_ID}));
-
-  protected RecommendationResourceProvider(Set<String> propertyIds,
-      Map<Type, String> keyPropertyIds, AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  protected static final String CHANGED_CONFIGURATIONS_PROPERTY_ID = "changed_configurations";
+  protected static final String BINDING_PROPERTY_ID = PropertyHelper
+      .getPropertyId("recommendations", "blueprint_cluster_binding");
+  protected static final String USER_CONTEXT_PROPERTY_ID = "user_context";
+  protected static final String USER_CONTEXT_OPERATION_PROPERTY_ID = PropertyHelper
+      .getPropertyId(USER_CONTEXT_PROPERTY_ID, "operation");
+  protected static final String USER_CONTEXT_OPERATION_DETAILS_PROPERTY_ID = PropertyHelper
+      .getPropertyId(USER_CONTEXT_PROPERTY_ID, "operation_details");
+
+
+  /**
+   * The key property ids for a Recommendation resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.Recommendation, RECOMMENDATION_ID_PROPERTY_ID)
+      .put(Type.Stack, STACK_NAME_PROPERTY_ID)
+      .put(Type.StackVersion, STACK_VERSION_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a Recommendation resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      RECOMMENDATION_ID_PROPERTY_ID,
+      STACK_NAME_PROPERTY_ID,
+      STACK_VERSION_PROPERTY_ID,
+      RECOMMEND_PROPERTY_ID,
+      HOSTS_PROPERTY_ID,
+      SERVICES_PROPERTY_ID,
+      CONFIG_GROUPS_PROPERTY_ID,
+      CHANGED_CONFIGURATIONS_PROPERTY_ID,
+      USER_CONTEXT_PROPERTY_ID,
+      USER_CONTEXT_OPERATION_PROPERTY_ID,
+      USER_CONTEXT_OPERATION_DETAILS_PROPERTY_ID,
+      RECOMMENDATIONS_PROPERTY_ID,
+      BLUEPRINT_PROPERTY_ID,
+      BLUEPRINT_CONFIGURATIONS_PROPERTY_ID,
+      BLUEPRINT_HOST_GROUPS_PROPERTY_ID,
+      PropertyHelper.getPropertyId(BLUEPRINT_HOST_GROUPS_PROPERTY_ID, BLUEPRINT_HOST_GROUPS_NAME_PROPERTY_ID),
+      PropertyHelper.getPropertyId(BLUEPRINT_HOST_GROUPS_PROPERTY_ID, BLUEPRINT_HOST_GROUPS_COMPONENTS_PROPERTY_ID),
+      BINDING_PROPERTY_ID,
+      BINDING_HOST_GROUPS_PROPERTY_ID,
+      PropertyHelper.getPropertyId(BINDING_HOST_GROUPS_PROPERTY_ID, BINDING_HOST_GROUPS_NAME_PROPERTY_ID),
+      PropertyHelper.getPropertyId(BINDING_HOST_GROUPS_PROPERTY_ID, BINDING_HOST_GROUPS_HOSTS_PROPERTY_ID),
+      BINDING_HOST_GROUPS_NAME_PROPERTY_ID,
+      BINDING_HOST_GROUPS_HOSTS_PROPERTY_ID);
+
+
+  protected RecommendationResourceProvider(AmbariManagementController managementController) {
+    super(Type.Recommendation, propertyIds, keyPropertyIds, managementController);
   }
 
   @Override
@@ -155,7 +204,7 @@ public class RecommendationResourceProvider extends StackAdvisorResourceProvider
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RemoteClusterResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RemoteClusterResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RemoteClusterResourceProvider.java
index 0b2d2b3..312fcb4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RemoteClusterResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RemoteClusterResourceProvider.java
@@ -21,7 +21,6 @@ package org.apache.ambari.server.controller.internal;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
@@ -52,6 +51,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 import com.google.inject.Inject;
 
 /**
@@ -78,23 +79,20 @@ public class RemoteClusterResourceProvider extends AbstractAuthorizedResourcePro
   /**
    * The key property ids for a Remote Cluster resource.
    */
-  private static Map<Resource.Type, String> keyPropertyIds = new HashMap<>();
-  static {
-    keyPropertyIds.put(Resource.Type.RemoteCluster, CLUSTER_NAME_PROPERTY_ID);
-  }
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.RemoteCluster, CLUSTER_NAME_PROPERTY_ID)
+      .build();
 
   /**
    * The property ids for a Remote Cluster resource.
    */
-  private static Set<String> propertyIds = new HashSet<>();
-  static {
-    propertyIds.add(CLUSTER_NAME_PROPERTY_ID);
-    propertyIds.add(CLUSTER_ID_PROPERTY_ID);
-    propertyIds.add(CLUSTER_URL_PROPERTY_ID);
-    propertyIds.add(USERNAME_PROPERTY_ID);
-    propertyIds.add(PASSWORD_PROPERTY_ID);
-    propertyIds.add(SERVICES_PROPERTY_ID);
-  }
+  private static Set<String> propertyIds = Sets.newHashSet(
+      CLUSTER_NAME_PROPERTY_ID,
+      CLUSTER_ID_PROPERTY_ID,
+      CLUSTER_URL_PROPERTY_ID,
+      USERNAME_PROPERTY_ID,
+      PASSWORD_PROPERTY_ID,
+      SERVICES_PROPERTY_ID);
 
   @Inject
   private static RemoteAmbariClusterDAO remoteAmbariClusterDAO;
@@ -109,7 +107,7 @@ public class RemoteClusterResourceProvider extends AbstractAuthorizedResourcePro
    * Create a  new resource provider.
    */
   protected RemoteClusterResourceProvider() {
-    super(propertyIds, keyPropertyIds);
+    super(Resource.Type.RemoteCluster, propertyIds, keyPropertyIds);
 
     EnumSet<RoleAuthorization> requiredAuthorizations = EnumSet.of(RoleAuthorization.AMBARI_ADD_DELETE_CLUSTERS);
     setRequiredCreateAuthorizations(requiredAuthorizations);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
index 26e3b86..eb8334b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestResourceProvider.java
@@ -23,7 +23,6 @@ import static org.apache.ambari.server.controller.internal.HostComponentResource
 import static org.apache.ambari.server.controller.internal.HostComponentResourceProvider.HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -74,6 +73,7 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
 import com.google.inject.Inject;
 
@@ -135,13 +135,18 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
   public static final String EXLUSIVE_ID = "exclusive";
   public static final String HAS_RESOURCE_FILTERS = "HAS_RESOURCE_FILTERS";
 
-  private static Set<String> pkPropertyIds =
-    new HashSet<>(Arrays.asList(new String[]{
-      REQUEST_ID_PROPERTY_ID}));
-
   private PredicateCompiler predicateCompiler = new PredicateCompiler();
 
+  /**
+   * The key property ids for a Request resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Request, REQUEST_ID_PROPERTY_ID)
+      .put(Resource.Type.Cluster, REQUEST_CLUSTER_NAME_PROPERTY_ID)
+      .build();
+
   static Set<String> PROPERTY_IDS = Sets.newHashSet(
+    REQUEST_ID_PROPERTY_ID,
     REQUEST_CLUSTER_NAME_PROPERTY_ID,
     REQUEST_CLUSTER_ID_PROPERTY_ID,
     REQUEST_STATUS_PROPERTY_ID,
@@ -175,14 +180,10 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
   /**
    * Create a  new resource provider for the given management controller.
    *
-   * @param propertyIds          the property ids
-   * @param keyPropertyIds       the key property ids
    * @param managementController the management controller
    */
-  RequestResourceProvider(Set<String> propertyIds,
-                          Map<Resource.Type, String> keyPropertyIds,
-                          AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  RequestResourceProvider(AmbariManagementController managementController) {
+    super(Resource.Type.Request, PROPERTY_IDS, keyPropertyIds, managementController);
   }
 
   // ----- ResourceProvider ------------------------------------------------
@@ -424,7 +425,7 @@ public class RequestResourceProvider extends AbstractControllerResourceProvider
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(Collections.singletonList(REQUEST_ID_PROPERTY_ID));
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestScheduleResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestScheduleResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestScheduleResourceProvider.java
index 4e25369..f556c9c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestScheduleResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestScheduleResourceProvider.java
@@ -18,7 +18,6 @@
 package org.apache.ambari.server.controller.internal;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -53,6 +52,9 @@ import org.apache.ambari.server.state.scheduler.Schedule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 public class RequestScheduleResourceProvider extends AbstractControllerResourceProvider {
   private static final Logger LOG = LoggerFactory.getLogger
     (RequestScheduleResourceProvider.class);
@@ -115,27 +117,60 @@ public class RequestScheduleResourceProvider extends AbstractControllerResourceP
   protected static final String SCHEDULE_END_TIME_PROPERTY_ID =
     PropertyHelper.getPropertyId(REQUEST_SCHEDULE_SCHEDULE_PROPERTY_ID, "endTime");
 
-  private static Set<String> pkPropertyIds = new HashSet<>(Arrays
-    .asList(new String[]{REQUEST_SCHEDULE_ID_PROPERTY_ID}));
+  /**
+   * The key property ids for a RequestSchedule resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Cluster, REQUEST_SCHEDULE_CLUSTER_NAME_PROPERTY_ID)
+      .put(Resource.Type.RequestSchedule, REQUEST_SCHEDULE_ID_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a RequestSchedule resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      REQUEST_SCHEDULE_ID_PROPERTY_ID,
+      REQUEST_SCHEDULE_CLUSTER_NAME_PROPERTY_ID,
+      REQUEST_SCHEDULE_DESC_PROPERTY_ID,
+      REQUEST_SCHEDULE_STATUS_PROPERTY_ID,
+      REQUEST_SCHEDULE_LAST_STATUS_PROPERTY_ID,
+      REQUEST_SCHEDULE_BATCH_PROPERTY_ID,
+      REQUEST_SCHEDULE_SCHEDULE_PROPERTY_ID,
+      REQUEST_SCHEDULE_CREATE_USER_PROPERTY_ID,
+      REQUEST_SCHEDULE_AUTHENTICATED_USER_PROPERTY_ID,
+      REQUEST_SCHEDULE_UPDATE_USER_PROPERTY_ID,
+      REQUEST_SCHEDULE_CREATE_TIME_PROPERTY_ID,
+      REQUEST_SCHEDULE_UPDATE_TIME_PROPERTY_ID,
+      REQUEST_SCHEDULE_BATCH_SEPARATION_PROPERTY_ID,
+      REQUEST_SCHEDULE_BATCH_TOLERATION_PROPERTY_ID,
+      REQUEST_SCHEDULE_BATCH_REQUESTS_PROPERTY_ID,
+      BATCH_REQUEST_TYPE_PROPERTY_ID,
+      BATCH_REQUEST_URI_PROPERTY_ID,
+      BATCH_REQUEST_ORDER_ID_PROPERTY_ID,
+      BATCH_REQUEST_BODY_PROPERTY_ID,
+      SCHEDULE_DAYS_OF_MONTH_PROPERTY_ID,
+      SCHEDULE_MINUTES_PROPERTY_ID,
+      SCHEDULE_HOURS_PROPERTY_ID,
+      SCHEDULE_YEAR_PROPERTY_ID,
+      SCHEDULE_DAY_OF_WEEK_PROPERTY_ID,
+      SCHEDULE_MONTH_PROPERTY_ID,
+      SCHEDULE_START_TIME_PROPERTY_ID,
+      SCHEDULE_END_TIME_PROPERTY_ID);
 
   /**
    * Create a  new resource provider for the given management controller.
    *
-   * @param propertyIds          the property ids
-   * @param keyPropertyIds       the key property ids
    * @param managementController the management controller
    */
 
-  protected RequestScheduleResourceProvider(Set<String> propertyIds,
-      Map<Resource.Type, String> keyPropertyIds,
-        AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  protected RequestScheduleResourceProvider(AmbariManagementController managementController) {
+    super(Resource.Type.RequestSchedule, propertyIds, keyPropertyIds, managementController);
   }
 
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
index 8dbe2bf..9ae1f47 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RoleAuthorizationResourceProvider.java
@@ -100,7 +100,7 @@ public class RoleAuthorizationResourceProvider extends ReadOnlyResourceProvider
    * Create a new resource provider.
    */
   public RoleAuthorizationResourceProvider(AmbariManagementController managementController) {
-    super(PROPERTY_IDS, KEY_PROPERTY_IDS, managementController);
+    super(Type.RoleAuthorization, PROPERTY_IDS, KEY_PROPERTY_IDS, managementController);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
index b9e7d67..74f8a4d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
@@ -81,7 +81,7 @@ public class RootServiceComponentConfigurationResourceProvider extends AbstractA
   private RootServiceComponentConfigurationHandlerFactory rootServiceComponentConfigurationHandlerFactory;
 
   public RootServiceComponentConfigurationResourceProvider() {
-    super(PROPERTIES, PK_PROPERTY_MAP);
+    super(Resource.Type.RootServiceComponentConfiguration, PROPERTIES, PK_PROPERTY_MAP);
 
     Set<RoleAuthorization> authorizations = EnumSet.of(RoleAuthorization.AMBARI_MANAGE_CONFIGURATION);
     setRequiredCreateAuthorizations(authorizations);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
index dfca00e..3c7fb6d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentResourceProvider.java
@@ -38,7 +38,8 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 
-import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 
 public class RootServiceComponentResourceProvider extends ReadOnlyResourceProvider {
 
@@ -57,12 +58,26 @@ public class RootServiceComponentResourceProvider extends ReadOnlyResourceProvid
   public static final String PROPERTIES_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + PROPERTIES;
   public static final String SERVER_CLOCK_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + SERVER_CLOCK;
 
-  private static final Set<String> PK_PROPERTY_IDS = ImmutableSet.of(SERVICE_NAME_PROPERTY_ID, COMPONENT_NAME_PROPERTY_ID);
-
-  protected RootServiceComponentResourceProvider(Set<String> propertyIds,
-      Map<Type, String> keyPropertyIds,
-      AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  /**
+   * The key property ids for a RootServiceComponent resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.RootService, SERVICE_NAME_PROPERTY_ID)
+      .put(Type.RootServiceComponent, COMPONENT_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a RootServiceComponent resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      SERVICE_NAME_PROPERTY_ID,
+      COMPONENT_NAME_PROPERTY_ID,
+      COMPONENT_VERSION_PROPERTY_ID,
+      PROPERTIES_PROPERTY_ID,
+      SERVER_CLOCK_PROPERTY_ID);
+
+  protected RootServiceComponentResourceProvider(AmbariManagementController managementController) {
+    super(Type.RootServiceComponent, propertyIds, keyPropertyIds, managementController);
   }
   
   @Override
@@ -116,7 +131,7 @@ public class RootServiceComponentResourceProvider extends ReadOnlyResourceProvid
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return PK_PROPERTY_IDS;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceHostComponentResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceHostComponentResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceHostComponentResourceProvider.java
index c37bb2e..94c870b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceHostComponentResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceHostComponentResourceProvider.java
@@ -39,7 +39,8 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 
-import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 
 public class RootServiceHostComponentResourceProvider extends ReadOnlyResourceProvider {
 
@@ -59,12 +60,29 @@ public class RootServiceHostComponentResourceProvider extends ReadOnlyResourcePr
   public static final String COMPONENT_STATE_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + COMPONENT_STATE;
   public static final String PROPERTIES_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + PROPERTIES;
 
-  private static final Set<String> PK_PROPERTY_IDS = ImmutableSet.of(SERVICE_NAME_PROPERTY_ID, HOST_NAME_PROPERTY_ID, COMPONENT_NAME_PROPERTY_ID);
-
-  public RootServiceHostComponentResourceProvider(Set<String> propertyIds,
-      Map<Type, String> keyPropertyIds,
-      AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  /**
+   * The key property ids for a RootServiceHostComponent resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.RootService, SERVICE_NAME_PROPERTY_ID)
+      .put(Type.Host, HOST_NAME_PROPERTY_ID)
+      .put(Type.RootServiceComponent, COMPONENT_NAME_PROPERTY_ID)
+      .put(Type.RootServiceHostComponent, COMPONENT_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a RootServiceHostComponent resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      SERVICE_NAME_PROPERTY_ID,
+      HOST_NAME_PROPERTY_ID,
+      COMPONENT_NAME_PROPERTY_ID,
+      COMPONENT_VERSION_PROPERTY_ID,
+      COMPONENT_STATE_PROPERTY_ID,
+      PROPERTIES_PROPERTY_ID);
+
+  public RootServiceHostComponentResourceProvider(AmbariManagementController managementController) {
+    super(Type.RootServiceHostComponent, propertyIds, keyPropertyIds, managementController);
   }
 
   
@@ -118,7 +136,7 @@ public class RootServiceHostComponentResourceProvider extends ReadOnlyResourcePr
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return PK_PROPERTY_IDS;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
   // Get the root service host components for the given set of requests

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceResourceProvider.java
index b24a94a..dcc8970 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceResourceProvider.java
@@ -37,7 +37,8 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 
-import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
 
 public class RootServiceResourceProvider extends ReadOnlyResourceProvider {
 
@@ -45,12 +46,21 @@ public class RootServiceResourceProvider extends ReadOnlyResourceProvider {
   public static final String SERVICE_NAME = "service_name";
   public static final String SERVICE_NAME_PROPERTY_ID = RESPONSE_KEY + PropertyHelper.EXTERNAL_PATH_SEP + SERVICE_NAME;
 
-  private static final Set<String> PK_PROPERTY_IDS = ImmutableSet.of(SERVICE_NAME_PROPERTY_ID);
-
-  protected RootServiceResourceProvider(Set<String> propertyIds,
-      Map<Type, String> keyPropertyIds,
-      AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  /**
+   * The key property ids for a RootService resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.RootService, SERVICE_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a RootService resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      SERVICE_NAME_PROPERTY_ID);
+
+  protected RootServiceResourceProvider(AmbariManagementController managementController) {
+    super(Type.RootService, propertyIds, keyPropertyIds, managementController);
   }
   
   @Override
@@ -94,7 +104,7 @@ public class RootServiceResourceProvider extends ReadOnlyResourceProvider {
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return PK_PROPERTY_IDS;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
index e7dbbc0..1019e57 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
@@ -115,7 +115,7 @@ public class ServiceConfigVersionResourceProvider extends
    */
   ServiceConfigVersionResourceProvider(
       AmbariManagementController managementController) {
-    super(PROPERTY_IDS, KEY_PROPERTY_IDS, managementController);
+    super(Resource.Type.ServiceConfigVersion, PROPERTY_IDS, KEY_PROPERTY_IDS, managementController);
 
     setRequiredGetAuthorizations(EnumSet.of(RoleAuthorization.CLUSTER_VIEW_CONFIGS,
         RoleAuthorization.SERVICE_VIEW_CONFIGS,

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/SettingResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/SettingResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/SettingResourceProvider.java
index 5235ef4..dd30904 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/SettingResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/SettingResourceProvider.java
@@ -103,7 +103,7 @@ public class SettingResourceProvider extends AbstractAuthorizedResourceProvider
   }
 
   protected SettingResourceProvider() {
-    super(propertyIds, keyPropertyIds);
+    super(Resource.Type.Setting, propertyIds, keyPropertyIds);
     EnumSet<RoleAuthorization> requiredAuthorizations = EnumSet.of(RoleAuthorization.AMBARI_MANAGE_SETTINGS);
     setRequiredCreateAuthorizations(requiredAuthorizations);
     setRequiredDeleteAuthorizations(requiredAuthorizations);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
index 67c177e..599b7c7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackAdvisorResourceProvider.java
@@ -39,6 +39,7 @@ import org.apache.ambari.server.api.services.stackadvisor.recommendations.Recomm
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.state.ChangedConfigInfo;
@@ -93,9 +94,9 @@ public abstract class StackAdvisorResourceProvider extends ReadOnlyResourceProvi
     configuration = serverConfig;
   }
 
-  protected StackAdvisorResourceProvider(Set<String> propertyIds, Map<Type, String> keyPropertyIds,
-      AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  protected StackAdvisorResourceProvider(Resource.Type type, Set<String> propertyIds, Map<Type, String> keyPropertyIds,
+                                         AmbariManagementController managementController) {
+    super(type, propertyIds, keyPropertyIds, managementController);
   }
 
   protected abstract String getRequestTypePropertyId();

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
index d042f86..292d4c1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java
@@ -184,7 +184,7 @@ public class StackArtifactResourceProvider extends AbstractControllerResourcePro
    * @param managementController ambari controller
    */
   protected StackArtifactResourceProvider(AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+    super(Resource.Type.StackArtifact, propertyIds, keyPropertyIds, managementController);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java
index 366b3ef..59341a0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationDependencyResourceProvider.java
@@ -19,7 +19,6 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Map;
@@ -39,6 +38,9 @@ import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 public class StackConfigurationDependencyResourceProvider extends
     ReadOnlyResourceProvider {
 
@@ -60,15 +62,31 @@ public class StackConfigurationDependencyResourceProvider extends
   public static final String DEPENDENCY_TYPE_PROPERTY_ID = PropertyHelper
       .getPropertyId("StackConfigurationDependency", "dependency_type");
 
-  private static Set<String> pkPropertyIds = new HashSet<>(
-    Arrays.asList(new String[]{STACK_NAME_PROPERTY_ID,
-      STACK_VERSION_PROPERTY_ID, SERVICE_NAME_PROPERTY_ID,
-      PROPERTY_NAME_PROPERTY_ID, DEPENDENCY_NAME_PROPERTY_ID}));
-
-  protected StackConfigurationDependencyResourceProvider(Set<String> propertyIds,
-                                                         Map<Type, String> keyPropertyIds,
-                                                         AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  /**
+   * The key property ids for a StackConfigurationDependency resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.Stack, STACK_NAME_PROPERTY_ID)
+      .put(Type.StackVersion, STACK_VERSION_PROPERTY_ID)
+      .put(Type.StackService, SERVICE_NAME_PROPERTY_ID)
+      .put(Type.StackConfiguration, PROPERTY_NAME_PROPERTY_ID)
+      .put(Type.StackLevelConfiguration, PROPERTY_NAME_PROPERTY_ID)
+      .put(Type.StackConfigurationDependency, DEPENDENCY_NAME_PROPERTY_ID)
+      .build();
+
+  /**
+   * The property ids for a StackConfigurationDependency resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      STACK_NAME_PROPERTY_ID,
+      STACK_VERSION_PROPERTY_ID,
+      SERVICE_NAME_PROPERTY_ID,
+      PROPERTY_NAME_PROPERTY_ID,
+      DEPENDENCY_NAME_PROPERTY_ID,
+      DEPENDENCY_TYPE_PROPERTY_ID);
+
+  protected StackConfigurationDependencyResourceProvider(AmbariManagementController managementController) {
+    super(Type.StackConfigurationDependency, propertyIds, keyPropertyIds, managementController);
   }
 
   @Override
@@ -137,7 +155,7 @@ public class StackConfigurationDependencyResourceProvider extends
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java
index 6f5b0f8..7b6c658 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java
@@ -19,7 +19,6 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Map;
@@ -40,6 +39,9 @@ import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.commons.lang.StringUtils;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 public class StackConfigurationResourceProvider extends
     ReadOnlyResourceProvider {
 
@@ -79,15 +81,35 @@ public class StackConfigurationResourceProvider extends
   public static final String PROPERTY_FINAL_PROPERTY_ID = PropertyHelper
       .getPropertyId("StackConfigurations", "final");
 
+  /**
+   * The key property ids for a StackConfiguration resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.Stack, STACK_NAME_PROPERTY_ID)
+      .put(Type.StackVersion, STACK_VERSION_PROPERTY_ID)
+      .put(Type.StackService, SERVICE_NAME_PROPERTY_ID)
+      .put(Type.StackConfiguration, PROPERTY_NAME_PROPERTY_ID)
+      .build();
 
-  private static Set<String> pkPropertyIds = new HashSet<>(
-    Arrays.asList(new String[]{STACK_NAME_PROPERTY_ID,
-      STACK_VERSION_PROPERTY_ID, SERVICE_NAME_PROPERTY_ID, PROPERTY_NAME_PROPERTY_ID}));
-
-  protected StackConfigurationResourceProvider(Set<String> propertyIds,
-      Map<Type, String> keyPropertyIds,
-      AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  /**
+   * The property ids for a StackConfiguration resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      STACK_NAME_PROPERTY_ID,
+      STACK_VERSION_PROPERTY_ID,
+      SERVICE_NAME_PROPERTY_ID,
+      PROPERTY_NAME_PROPERTY_ID,
+      PROPERTY_VALUE_PROPERTY_ID,
+      PROPERTY_VALUE_ATTRIBUTES_PROPERTY_ID,
+      PROPERTY_DEPENDS_ON_PROPERTY_ID,
+      PROPERTY_DESCRIPTION_PROPERTY_ID,
+      PROPERTY_DISPLAY_NAME_PROPERTY_ID,
+      PROPERTY_PROPERTY_TYPE_PROPERTY_ID,
+      PROPERTY_TYPE_PROPERTY_ID,
+      PROPERTY_FINAL_PROPERTY_ID);
+
+  protected StackConfigurationResourceProvider(AmbariManagementController managementController) {
+    super(Type.StackConfiguration, propertyIds, keyPropertyIds, managementController);
   }
 
 
@@ -188,7 +210,7 @@ public class StackConfigurationResourceProvider extends
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDependencyResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDependencyResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDependencyResourceProvider.java
index 8b69c6a..d28b5d9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDependencyResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDependencyResourceProvider.java
@@ -19,7 +19,6 @@
 package org.apache.ambari.server.controller.internal;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
@@ -42,6 +41,9 @@ import org.apache.ambari.server.state.AutoDeployInfo;
 import org.apache.ambari.server.state.DependencyConditionInfo;
 import org.apache.ambari.server.state.DependencyInfo;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 /**
  * Resource provider for Stack Dependency resource.
  */
@@ -70,10 +72,31 @@ public class StackDependencyResourceProvider extends AbstractResourceProvider {
   protected static final String AUTO_DEPLOY_LOCATION_ID = PropertyHelper
       .getPropertyId("auto_deploy", "location");
 
-  // Primary Key Fields
-  private static Set<String> pkPropertyIds =
-    new HashSet<>(Arrays.asList(new String[]{
-      SERVICE_NAME_ID, COMPONENT_NAME_ID}));
+  /**
+   * The key property ids for a StackDependency resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Resource.Type.Stack, STACK_NAME_ID)
+      .put(Resource.Type.StackVersion, STACK_VERSION_ID)
+      .put(Resource.Type.StackService, DEPENDENT_SERVICE_NAME_ID)
+      .put(Resource.Type.StackServiceComponent, DEPENDENT_COMPONENT_NAME_ID)
+      .put(Resource.Type.StackServiceComponentDependency, COMPONENT_NAME_ID)
+      .build();
+
+  /**
+   * The property ids for a StackDependency resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      STACK_NAME_ID,
+      STACK_VERSION_ID,
+      DEPENDENT_SERVICE_NAME_ID,
+      DEPENDENT_COMPONENT_NAME_ID,
+      SERVICE_NAME_ID,
+      COMPONENT_NAME_ID,
+      SCOPE_ID,
+      CONDITIONS_ID,
+      AUTO_DEPLOY_ENABLED_ID,
+      AUTO_DEPLOY_LOCATION_ID);
 
   /**
    * Provides stack information
@@ -85,12 +108,8 @@ public class StackDependencyResourceProvider extends AbstractResourceProvider {
 
   /**
    * Constructor.
-   *
-   * @param propertyIds    the property ids
-   * @param keyPropertyIds the key property ids
    */
-  protected StackDependencyResourceProvider(Set<String> propertyIds,
-                                            Map<Resource.Type, String> keyPropertyIds) {
+  protected StackDependencyResourceProvider() {
     super(propertyIds, keyPropertyIds);
   }
 
@@ -108,7 +127,7 @@ public class StackDependencyResourceProvider extends AbstractResourceProvider {
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/e77a31ab/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
index 819507b..7519da6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProvider.java
@@ -19,7 +19,6 @@
 
 package org.apache.ambari.server.controller.internal;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Map;
@@ -40,6 +39,9 @@ import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.commons.lang.StringUtils;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+
 public class StackLevelConfigurationResourceProvider extends
     ReadOnlyResourceProvider {
 
@@ -76,15 +78,33 @@ public class StackLevelConfigurationResourceProvider extends
   public static final String PROPERTY_FINAL_PROPERTY_ID = PropertyHelper
       .getPropertyId("StackLevelConfigurations", "final");
 
+  /**
+   * The key property ids for a StackLevelConfiguration resource.
+   */
+  private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
+      .put(Type.Stack, STACK_NAME_PROPERTY_ID)
+      .put(Type.StackVersion, STACK_VERSION_PROPERTY_ID)
+      .put(Type.StackLevelConfiguration, PROPERTY_NAME_PROPERTY_ID)
+      .build();
 
-  private static Set<String> pkPropertyIds = new HashSet<>(
-    Arrays.asList(new String[]{STACK_NAME_PROPERTY_ID,
-      STACK_VERSION_PROPERTY_ID, PROPERTY_NAME_PROPERTY_ID}));
-
-  protected StackLevelConfigurationResourceProvider(Set<String> propertyIds,
-      Map<Type, String> keyPropertyIds,
-      AmbariManagementController managementController) {
-    super(propertyIds, keyPropertyIds, managementController);
+  /**
+   * The property ids for a StackLevelConfiguration resource.
+   */
+  private static Set<String> propertyIds = Sets.newHashSet(
+      STACK_NAME_PROPERTY_ID,
+      STACK_VERSION_PROPERTY_ID,
+      PROPERTY_NAME_PROPERTY_ID,
+      PROPERTY_DISPLAY_NAME_PROPERTY_ID,
+      PROPERTY_VALUE_PROPERTY_ID,
+      PROPERTY_VALUE_ATTRIBUTES_PROPERTY_ID,
+      DEPENDS_ON_PROPERTY_ID,
+      PROPERTY_DESCRIPTION_PROPERTY_ID,
+      PROPERTY_PROPERTY_TYPE_PROPERTY_ID,
+      PROPERTY_TYPE_PROPERTY_ID,
+      PROPERTY_FINAL_PROPERTY_ID);
+
+  protected StackLevelConfigurationResourceProvider(AmbariManagementController managementController) {
+    super(Type.StackLevelConfiguration, propertyIds, keyPropertyIds, managementController);
   }
 
 
@@ -181,7 +201,7 @@ public class StackLevelConfigurationResourceProvider extends
 
   @Override
   protected Set<String> getPKPropertyIds() {
-    return pkPropertyIds;
+    return new HashSet<>(keyPropertyIds.values());
   }
 
 }


Mime
View raw message