ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject [13/51] [partial] AMBARI-7621. Import initial contribution for Ambari support on Windows to branch-windows-dev. (Jayush Luniya and Florian Barca via yusaku)
Date Tue, 07 Oct 2014 22:52:41 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
index 1afae39..db3dff8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
@@ -19,7 +19,6 @@
 package org.apache.ambari.server.api.query.render;
 
 import org.apache.ambari.server.api.query.QueryInfo;
-import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.api.services.Request;
 import org.apache.ambari.server.api.services.Result;
 import org.apache.ambari.server.api.services.ResultImpl;
@@ -27,25 +26,15 @@ import org.apache.ambari.server.api.services.ResultPostProcessor;
 import org.apache.ambari.server.api.services.ResultPostProcessorImpl;
 import org.apache.ambari.server.api.util.TreeNode;
 import org.apache.ambari.server.api.util.TreeNodeImpl;
-import org.apache.ambari.server.controller.AmbariManagementController;
-import org.apache.ambari.server.controller.AmbariServer;
-import org.apache.ambari.server.controller.internal.BlueprintConfigurationProcessor;
-import org.apache.ambari.server.controller.internal.HostGroup;
 import org.apache.ambari.server.controller.internal.ResourceImpl;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.ambari.server.state.DesiredConfig;
-import org.apache.ambari.server.state.HostConfig;
-import org.apache.ambari.server.state.PropertyInfo;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -55,18 +44,6 @@ import java.util.Set;
  */
 public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
 
-  /**
-   * Management Controller used to get stack information.
-   */
-  private AmbariManagementController controller = AmbariServer.getController();
-
-  /**
-   * Map of configuration type to configuration properties which are required that a user
-   * input.  These properties will be stripped from the exported blueprint.
-   */
-  private Map<String, Collection<String>> propertiesToStrip = new HashMap<String, Collection<String>>();
-
-
   // ----- Renderer ----------------------------------------------------------
 
   @Override
@@ -78,17 +55,6 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
         null, properties, queryProperties.getName());
 
     copyPropertiesToResult(queryProperties, resultTree);
-
-    String configType = Resource.Type.Configuration.name();
-    if (resultTree.getChild(configType) == null) {
-      resultTree.addChild(new HashSet<String>(), configType);
-    }
-
-    String serviceType = Resource.Type.Service.name();
-    if (resultTree.getChild(serviceType) == null) {
-      resultTree.addChild(new HashSet<String>(), serviceType);
-    }
-
     String hostType = Resource.Type.Host.name();
     String hostComponentType = Resource.Type.HostComponent.name();
     TreeNode<Set<String>> hostComponentNode = resultTree.getChild(
@@ -101,7 +67,6 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
       }
       hostComponentNode = hostNode.addChild(new HashSet<String>(), hostComponentType);
     }
-    resultTree.getChild(configType).getObject().add("properties");
     hostComponentNode.getObject().add("HostRoles/component_name");
 
     return resultTree;
@@ -141,141 +106,50 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
   private Resource createBlueprintResource(TreeNode<Resource> clusterNode) {
     Resource clusterResource = clusterNode.getObject();
     Resource blueprintResource = new ResourceImpl(Resource.Type.Cluster);
-
+    String clusterName = (String) clusterResource.getPropertyValue(
+        PropertyHelper.getPropertyId("Clusters", "cluster_name"));
+    //todo: deal with name collision?
+    String blueprintName = "blueprint-" + clusterName;
     String[] stackTokens = ((String) clusterResource.getPropertyValue(
             PropertyHelper.getPropertyId("Clusters", "version"))).split("-");
 
+    blueprintResource.setProperty("Blueprints/blueprint_name", blueprintName);
     blueprintResource.setProperty("Blueprints/stack_name", stackTokens[0]);
     blueprintResource.setProperty("Blueprints/stack_version", stackTokens[1]);
-
-    Collection<HostGroupImpl> hostGroups =  processHostGroups(clusterNode.getChild("hosts"));
-
-    List<Map<String, Object>> groupList = formatGroupsAsList(hostGroups);
-    blueprintResource.setProperty("host_groups", groupList);
-
-    determinePropertiesToStrip(clusterNode.getChild("services"), stackTokens[0], stackTokens[1]);
-
-    blueprintResource.setProperty("configurations", processConfigurations(clusterNode, hostGroups));
+    blueprintResource.setProperty(
+        "host_groups", processHostGroups(clusterNode.getChild("hosts")));
 
     return blueprintResource;
   }
 
   /**
-   * Determine which configuration properties need to be stripped from the configuration prior to exporting.
-   * Stripped properties are any property which are marked as required in the stack definition.  For example,
-   * all passwords are required properties and are therefore not exported.
-   *
-   * @param servicesNode  services node
-   * @param stackName     stack name
-   * @param stackVersion  stack version
-   */
-  private void determinePropertiesToStrip(TreeNode<Resource> servicesNode, String stackName, String stackVersion) {
-    AmbariMetaInfo stackInfo = getController().getAmbariMetaInfo();
-    for (TreeNode<Resource> service : servicesNode.getChildren()) {
-      String name = (String) service.getObject().getPropertyValue("ServiceInfo/service_name");
-      Map<String, PropertyInfo> requiredProperties = stackInfo.getRequiredProperties(stackName, stackVersion, name);
-      for (Map.Entry<String, PropertyInfo> entry : requiredProperties.entrySet()) {
-        String propertyName = entry.getKey();
-        PropertyInfo propertyInfo = entry.getValue();
-        String configCategory = propertyInfo.getFilename();
-        if (configCategory.endsWith(".xml")) {
-          configCategory = configCategory.substring(0, configCategory.indexOf(".xml"));
-        }
-        Collection<String> categoryProperties = propertiesToStrip.get(configCategory);
-        if (categoryProperties == null) {
-          categoryProperties = new ArrayList<String>();
-          propertiesToStrip.put(configCategory, categoryProperties);
-        }
-        categoryProperties.add(propertyName);
-      }
-    }
-  }
-
-  /**
-   * Process cluster scoped configurations.
-   *
-   * @param clusterNode  cluster node
-   * @param hostGroups   all host groups
-   *
-   * @return cluster configuration
-   */
-  private List<Map<String, Map<String, String>>>  processConfigurations(TreeNode<Resource> clusterNode,
-                                                                        Collection<HostGroupImpl> hostGroups) {
-
-    List<Map<String, Map<String, String>>> configList = new ArrayList<Map<String, Map<String, String>>>();
-
-    Map<String, Object> desiredConfigMap = clusterNode.getObject().getPropertiesMap().get("Clusters/desired_configs");
-    TreeNode<Resource> configNode = clusterNode.getChild("configurations");
-    for (TreeNode<Resource> config : configNode.getChildren()) {
-      Configuration configuration = new Configuration(config);
-      DesiredConfig desiredConfig = (DesiredConfig) desiredConfigMap.get(configuration.getType());
-      if (desiredConfig != null && desiredConfig.getTag().equals(configuration.getTag())) {
-        Map<String, Map<String, String>> properties = Collections.singletonMap(
-            configuration.getType(), configuration.getProperties());
-
-        BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(properties);
-        properties = updater.doUpdateForBlueprintExport(hostGroups);
-        configList.add(properties);
-      }
-    }
-    return configList;
-  }
-
-  /**
-   * Process cluster host groups.
+   * Process host group information for all hosts.
    *
-   * @param hostNode  host node
+   * @param hostNode a host node
    *
-   * @return collection of host groups
+   * @return list of host group property maps, one element for each host group
    */
-  private Collection<HostGroupImpl> processHostGroups(TreeNode<Resource> hostNode) {
-    Map<HostGroupImpl, HostGroupImpl> mapHostGroups = new HashMap<HostGroupImpl, HostGroupImpl>();
-    int count = 1;
+  private List<Map<String, Object>> processHostGroups(TreeNode<Resource> hostNode) {
+    Map<HostGroup, HostGroup> mapHostGroups = new HashMap<HostGroup, HostGroup>();
     for (TreeNode<Resource> host : hostNode.getChildren()) {
-      HostGroupImpl group = new HostGroupImpl(host);
-      String hostName = (String) host.getObject().getPropertyValue(
-          PropertyHelper.getPropertyId("Hosts", "host_name"));
-
+      HostGroup group = HostGroup.parse(host);
       if (mapHostGroups.containsKey(group)) {
-        HostGroupImpl hostGroup = mapHostGroups.get(group);
-        hostGroup.incrementCardinality();
-        hostGroup.addHost(hostName);
+        mapHostGroups.get(group).incrementCardinality();
       } else {
         mapHostGroups.put(group, group);
-        group.setName("host_group_" + count++);
-        group.addHost(hostName);
       }
     }
-    return mapHostGroups.values();
-  }
-
 
-  /**
-   * Process host group information for all hosts.
-   *
-   * @param hostGroups all host groups
-   *
-   * @return list of host group property maps, one element for each host group
-   */
-  private List<Map<String, Object>> formatGroupsAsList(Collection<HostGroupImpl> hostGroups) {
+    int count = 1;
     List<Map<String, Object>> listHostGroups = new ArrayList<Map<String, Object>>();
-    for (HostGroupImpl group : hostGroups) {
+    for (HostGroup group : mapHostGroups.values()) {
+      String groupName = "host_group_" + count++;
       Map<String, Object> mapGroupProperties = new HashMap<String, Object>();
       listHostGroups.add(mapGroupProperties);
 
-      mapGroupProperties.put("name", group.getName());
+      mapGroupProperties.put("name", groupName);
       mapGroupProperties.put("cardinality", String.valueOf(group.getCardinality()));
       mapGroupProperties.put("components", processHostGroupComponents(group));
-      List<Map<String, Map<String, String>>> hostConfigurations = new ArrayList<Map<String, Map<String, String>>>();
-      for (Configuration configuration : group.getConfigurations()) {
-        Map<String, Map<String, String>> propertyMap = Collections.singletonMap(
-            configuration.getType(), configuration.properties);
-        BlueprintConfigurationProcessor configurationProcessor = new BlueprintConfigurationProcessor(propertyMap);
-        Map<String, Map<String, String>> updatedProps = configurationProcessor.doUpdateForBlueprintExport(hostGroups);
-        hostConfigurations.add(updatedProps);
-
-      }
-      mapGroupProperties.put("configurations", hostConfigurations);
     }
     return listHostGroups;
   }
@@ -287,7 +161,7 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
    *
    * @return list of component names for the host
    */
-  private List<Map<String, String>> processHostGroupComponents(HostGroupImpl group) {
+  private List<Map<String, String>> processHostGroupComponents(HostGroup group) {
     List<Map<String, String>> listHostGroupComponents = new ArrayList<Map<String, String>>();
     for (String component : group.getComponents()) {
       Map<String, String> mapComponentProperties = new HashMap<String, String>();
@@ -309,37 +183,16 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
     return isCollection != null && isCollection.equals("true");
   }
 
-  /**
-   * Get management controller instance.
-   *
-   * @return  management controller
-   */
-  protected AmbariManagementController getController() {
-    return controller;
-  }
-
   // ----- Host Group inner class --------------------------------------------
 
   /**
    * Host Group representation.
    */
-  private class HostGroupImpl implements HostGroup {
-
-    /**
-     * Host Group name.
-     *
-     */
-    private String name;
-
+  private static class HostGroup {
     /**
      * Associated components.
      */
-    private Set<String> components = new HashSet<String>();
-
-    /**
-     * Host group scoped configurations.
-     */
-    private Collection<Configuration> configurations = new HashSet<Configuration>();
+    private Set<String> m_components = new HashSet<String>();
 
     /**
      * Number of instances.
@@ -347,107 +200,35 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
     private int m_cardinality = 1;
 
     /**
-     * Collection of associated hosts.
-     */
-    private Collection<String> hosts = new HashSet<String>();
-
-    /**
-     * Constructor.
+     * Factory method for obtaining a host group instance.
+     * Parses a host tree node for host related information.
      *
-     * @param host  host node
+     * @param host  host tree node
+     *
+     * @return a new HostGroup instance
      */
-    public HostGroupImpl(TreeNode<Resource> host) {
+    public static HostGroup parse(TreeNode<Resource> host) {
+      HostGroup group = new HostGroup();
+
       TreeNode<Resource> components = host.getChild("host_components");
       for (TreeNode<Resource> component : components.getChildren()) {
-        getComponents().add((String) component.getObject().getPropertyValue(
+        group.getComponents().add((String) component.getObject().getPropertyValue(
             "HostRoles/component_name"));
       }
-      addAmbariComponentIfLocalhost((String) host.getObject().getPropertyValue(
+
+      group.addAmbariComponentIfLocalhost((String) host.getObject().getPropertyValue(
           PropertyHelper.getPropertyId("Hosts", "host_name")));
 
-      processGroupConfiguration(host);
+      return group;
     }
 
-    /**
-     * Preocess host group configuration.
+    /**                                                           `
+     * Obtain associated components.
      *
-     * @param host  host node
+     * @return set of associated components
      */
-    private void processGroupConfiguration(TreeNode<Resource> host) {
-      Map<String, Object> desiredConfigMap = host.getObject().getPropertiesMap().get("Hosts/desired_configs");
-      if (desiredConfigMap != null) {
-        for (Map.Entry<String, Object> entry : desiredConfigMap.entrySet()) {
-          String type = entry.getKey();
-          HostConfig hostConfig = (HostConfig) entry.getValue();
-          Map<Long, String> overrides = hostConfig.getConfigGroupOverrides();
-
-          if (overrides != null && ! overrides.isEmpty()) {
-            Long version = Collections.max(overrides.keySet());
-            String tag = overrides.get(version);
-            TreeNode<Resource> clusterNode = host.getParent().getParent();
-            TreeNode<Resource> configNode = clusterNode.getChild("configurations");
-            for (TreeNode<Resource> config : configNode.getChildren()) {
-              Configuration configuration = new Configuration(config);
-              if (type.equals(configuration.getType()) && tag.equals(configuration.getTag())) {
-                getConfigurations().add(configuration);
-                break;
-              }
-            }
-          }
-        }
-      }
-    }
-
-    @Override
-    public String getName() {
-      return name;
-    }
-
-    @Override
     public Set<String> getComponents() {
-      return components;
-    }
-
-    @Override
-    public Collection<String> getHostInfo() {
-      return hosts;
-    }
-
-    @Override
-    public Map<String, Map<String, String>> getConfigurationProperties() {
-      Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();
-      for (Configuration configuration : configurations) {
-        properties.put(configuration.getType(), configuration.getProperties());
-      }
-
-      return properties;
-    }
-
-    /**
-     * Set the name.
-     *
-     * @param  name name of host group
-     */
-    public void setName(String name) {
-      this.name = name;
-    }
-
-    /**
-     * Add a host.
-     *
-     * @param host  host to add
-     */
-    public void addHost(String host) {
-      hosts.add(host);
-    }
-
-    /**
-     * Obtain associated host group scoped configurations.
-     *
-     * @return collection of host group scoped configurations
-     */
-    public Collection<Configuration> getConfigurations() {
-      return configurations;
+      return m_components;
     }
 
     /**
@@ -492,115 +273,14 @@ public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer {
       if (this == o) return true;
       if (o == null || getClass() != o.getClass()) return false;
 
-      HostGroupImpl hostGroup = (HostGroupImpl) o;
+      HostGroup hostGroup = (HostGroup) o;
 
-      return components.equals(hostGroup.components) &&
-          configurations.equals(hostGroup.configurations);
+      return m_components.equals(hostGroup.m_components);
     }
 
     @Override
     public int hashCode() {
-      int result = components.hashCode();
-      result = 31 * result + configurations.hashCode();
-      return result;
-    }
-  }
-
-  /**
-   * Encapsulates a configuration.
-   */
-  private class Configuration {
-    /**
-     * Configuration type such as hdfs-site.
-     */
-    private String type;
-
-    /**
-     * Configuration tag.
-     */
-    private String tag;
-
-    /**
-     * Properties of the configuration.
-     */
-    private Map<String, String> properties = new HashMap<String, String>();
-
-    /**
-     * Constructor.
-     *
-     * @param configNode  configuration node
-     */
-    @SuppressWarnings("unchecked")
-    public Configuration(TreeNode<Resource> configNode) {
-      Resource configResource = configNode.getObject();
-      type = (String) configResource.getPropertyValue("type");
-      tag  = (String) configResource.getPropertyValue("tag");
-
-      // property map type is currently <String, Object>
-      properties = (Map) configNode.getObject().getPropertiesMap().get("properties");
-      stripRequiredProperties(properties);
-    }
-
-    /**
-     * Get configuration type.
-     *
-     * @return configuration type
-     */
-    public String getType() {
-      return type;
-    }
-
-    /**
-     * Get configuration tag.
-     *
-     * @return configuration tag
-     */
-    public String getTag() {
-      return tag;
-    }
-
-    /**
-     * Get configuration properties.
-     *
-     * @return map of properties and values
-     */
-    public Map<String, String> getProperties() {
-      return properties;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-      if (this == o) return true;
-      if (o == null || getClass() != o.getClass()) return false;
-
-      Configuration that = (Configuration) o;
-      return tag.equals(that.tag) && type.equals(that.type) && properties.equals(that.properties);
-    }
-
-    @Override
-    public int hashCode() {
-      int result = type.hashCode();
-      result = 31 * result + tag.hashCode();
-      result = 31 * result + properties.hashCode();
-      return result;
-    }
-
-    /**
-     * Strip required properties from configuration.
-     *
-     * @param properties  property map
-     */
-    private void stripRequiredProperties(Map<String, String> properties) {
-      Iterator<Map.Entry<String, String>> iter = properties.entrySet().iterator();
-      while (iter.hasNext()) {
-        Map.Entry<String, String> entry = iter.next();
-        String property = entry.getKey();
-        String category = getType();
-        Collection<String> categoryProperties = propertiesToStrip.get(category);
-        if (categoryProperties != null && categoryProperties.contains(property)) {
-          iter.remove();
-        }
-      }
+      return m_components.hashCode();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertDefResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertDefResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertDefResourceDefinition.java
deleted file mode 100644
index 1a63097..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/AlertDefResourceDefinition.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ambari.server.api.resources;
-
-import org.apache.ambari.server.controller.spi.Resource;
-
-/**
- * Resource Definition for AlertDefinition types.
- * @author ncole
- *
- */
-public class AlertDefResourceDefinition extends BaseResourceDefinition {
-
-  public AlertDefResourceDefinition() {
-    super(Resource.Type.AlertDefinition);
-  }
-  
-  @Override
-  public String getPluralName() {
-    // TODO Auto-generated method stub
-    return "alert_definitions";
-  }
-  
-  @Override
-  public String getSingularName() {
-    return "alert_definition";
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java
index a5a7234..ef92302 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java
@@ -112,12 +112,6 @@ public abstract class BaseResourceDefinition implements ResourceDefinition {
     return m_type.hashCode();
   }
 
-  @Override
-  public boolean isCreatable() {
-    // by default all resources are creatable
-    return true;
-  }
-
   class BaseHrefPostProcessor implements PostProcessor {
     @Override
     public void process(Request request, TreeNode<Resource> resultNode, String href) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClientConfigResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClientConfigResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClientConfigResourceDefinition.java
deleted file mode 100644
index 4ff37ac..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClientConfigResourceDefinition.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import org.apache.ambari.server.api.query.render.ClusterBlueprintRenderer;
-import org.apache.ambari.server.api.query.render.DefaultRenderer;
-import org.apache.ambari.server.api.query.render.MinimalRenderer;
-import org.apache.ambari.server.api.query.render.Renderer;
-import org.apache.ambari.server.controller.spi.Resource;
-
-import java.util.Collection;
-
-
-/**
- * Blueprint resource definition.
- */
-public class ClientConfigResourceDefinition extends BaseResourceDefinition {
-  /**
-   * Constructor.
-   *
-   */
-  public ClientConfigResourceDefinition() {
-    super(Resource.Type.ClientConfig);
-  }
-
-  @Override
-  public String getPluralName() {
-    return "configurations";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "configuration";
-  }
-
-  @Override
-  public Renderer getRenderer(String name) {
-    if (name != null && name.equals("client_config_tar")) {
-      return new DefaultRenderer();
-    } else {
-      return super.getRenderer(name);
-    }
-  }
-
-  @Override
-  public Collection<String> getCreateDirectives() {
-    Collection<String> directives = super.getCreateDirectives();
-    directives.add("validate_topology");
-
-    return directives;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
index 702bcf8..43578c6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
@@ -62,12 +62,9 @@ public class ClusterResourceDefinition extends BaseResourceDefinition {
     setChildren.add(new SubResourceDefinition(Resource.Type.Service));
     setChildren.add(new SubResourceDefinition(Resource.Type.Host));
     setChildren.add(new SubResourceDefinition(Resource.Type.Configuration));
-    setChildren.add(new SubResourceDefinition(Resource.Type.ServiceConfigVersion));
     setChildren.add(new SubResourceDefinition(Resource.Type.Request));
     setChildren.add(new SubResourceDefinition(Resource.Type.Workflow));
     setChildren.add(new SubResourceDefinition(Resource.Type.ConfigGroup));
-    setChildren.add(new SubResourceDefinition(Resource.Type.ClusterPrivilege));
-    setChildren.add(new SubResourceDefinition(Resource.Type.AlertDefinition));
 
     return setChildren;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ControllerResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ControllerResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ControllerResourceDefinition.java
deleted file mode 100644
index 55e6502..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ControllerResourceDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ambari.server.api.resources;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.ambari.server.controller.internal.ControllerType;
-import org.apache.ambari.server.controller.spi.Resource;
-
-/**
- * Controller Resource Definition
- */
-public class ControllerResourceDefinition extends BaseResourceDefinition {
-
-  private final ControllerType type;
-
-  public ControllerResourceDefinition(ControllerType type) {
-    super(Resource.Type.Controller);
-    this.type = type;
-  }
-
-  @Override
-  public String getPluralName() {
-    return "controllers";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "controller";
-  }
-
-  @Override
-  public Set<SubResourceDefinition> getSubResourceDefinitions() {
-    final Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>();
-    if (type != null) {
-      switch (type) {
-      case LDAP:
-        break;
-      }
-    }
-    return subResourceDefinitions;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LdapSyncEventResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LdapSyncEventResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LdapSyncEventResourceDefinition.java
deleted file mode 100644
index 554c688..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LdapSyncEventResourceDefinition.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import org.apache.ambari.server.controller.spi.Resource;
-
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * LDAP sync event resource definition.
- */
-public class LdapSyncEventResourceDefinition extends BaseResourceDefinition {
-
-  // ----- Constructors ------------------------------------------------------
-
-  /**
-   * Construct an event resource definition.
-   */
-  public LdapSyncEventResourceDefinition() {
-    super(Resource.Type.LdapSyncEvent);
-  }
-
-
-  // ----- ResourceDefinition ------------------------------------------------
-
-  @Override
-  public String getPluralName() {
-    return "ldap_sync_events";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "ldap_sync_event";
-  }
-
-  @Override
-  public Set<SubResourceDefinition> getSubResourceDefinitions() {
-    return Collections.emptySet();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/PrivilegeResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/PrivilegeResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/PrivilegeResourceDefinition.java
deleted file mode 100644
index 61588f1..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/PrivilegeResourceDefinition.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import org.apache.ambari.server.controller.spi.Resource;
-
-import java.util.Collections;
-import java.util.Set;
-
-
-/**
- * Privilege resource definition.
- */
-public class PrivilegeResourceDefinition extends BaseResourceDefinition {
-
-  // ----- Constructors ------------------------------------------------------
-
-  /**
-   * Construct a privilege resource definition.
-   */
-  public PrivilegeResourceDefinition(Resource.Type type) {
-    super(type);
-  }
-
-
-  // ----- ResourceDefinition ------------------------------------------------
-
-  @Override
-  public String getPluralName() {
-    return "privileges";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "privilege";
-  }
-
-  @Override
-  public Set<SubResourceDefinition> getSubResourceDefinitions() {
-    return Collections.emptySet();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RecommendationResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RecommendationResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RecommendationResourceDefinition.java
deleted file mode 100644
index 203fc44..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RecommendationResourceDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import org.apache.ambari.server.controller.spi.Resource;
-
-/**
- * Recommendation resource definition.
- */
-public class RecommendationResourceDefinition extends BaseResourceDefinition {
-  /**
-   * Constructor.
-   */
-  public RecommendationResourceDefinition() {
-    super(Resource.Type.Recommendation);
-  }
-
-  @Override
-  public String getPluralName() {
-    return "recommendations";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "recommendation";
-  }
-
-  @Override
-  public boolean isCreatable() {
-    return false;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RequestResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RequestResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RequestResourceDefinition.java
index 291b01a..a3920d1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RequestResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RequestResourceDefinition.java
@@ -83,19 +83,15 @@ public class RequestResourceDefinition extends BaseResourceDefinition {
         sb.append(href);
         sb.append('/').append(requestId);
       } else {
-        // split the href up into its parts, intercepting "clusters" in order
+        // split the href up into its parts, intercepting "clusers" in order
         // to rewrite the href to be scoped for requests
         String[] tokens = href.split("/");
 
-        Integer tokenCount = tokens.length;
-        for (int i = 0; i < tokenCount; ++i) {
+        for (int i = 0; i < tokens.length; ++i) {
           String fragment = tokens[i];
-          sb.append(fragment);
-          if (i < tokenCount - 1 ) {
-            sb.append('/');
-          }
+          sb.append(fragment).append('/');
 
-          if ("clusters".equals(fragment) && i + 1 < tokenCount) {
+          if ("clusters".equals(fragment) && i + 1 < tokens.length) {
             String clusterName = tokens[i + 1];
             sb.append(clusterName).append("/");
             sb.append("requests/").append(requestId);

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceDefinition.java
index 7632e64..1e0a4db 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceDefinition.java
@@ -90,17 +90,6 @@ public interface ResourceDefinition {
   public Collection<String> getCreateDirectives();
 
   /**
-   * Defines if resource is actually created on the server side during POST
-   * operation.
-   * 
-   * @see <a
-   *      href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5">
-   *      http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5</a>
-   * @return {@code true} if resource is creatable, {@code false} otherwise
-   */
-  public boolean isCreatable();
-
-  /**
    * Resource specific result processor.
    * Used to provide resource specific processing of a result.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
index 2676fd3..2a87c4f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
@@ -24,7 +24,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.ambari.server.api.query.QueryImpl;
-import org.apache.ambari.server.controller.internal.ControllerType;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.utilities.ClusterControllerHelper;
 import org.apache.ambari.server.view.ViewRegistry;
@@ -110,10 +109,6 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
         resourceDefinition = new ConfigurationResourceDefinition();
         break;
 
-      case ServiceConfigVersion:
-        resourceDefinition = new ServiceConfigVersionResourceDefinition();
-        break;
-
       case Task:
         resourceDefinition = new TaskResourceDefinition();
         break;
@@ -141,10 +136,6 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
       case StackVersion:
         resourceDefinition = new StackVersionResourceDefinition();
         break;
-        
-      case StackLevelConfiguration:
-        resourceDefinition = new StackLevelConfigurationResourceDefinition();
-        break;
 
       case StackService:
         resourceDefinition = new StackServiceResourceDefinition();
@@ -235,14 +226,6 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
         resourceDefinition = new BlueprintResourceDefinition();
         break;
 
-      case Recommendation:
-        resourceDefinition = new RecommendationResourceDefinition();
-        break;
-
-      case Validation:
-        resourceDefinition = new ValidationResourceDefinition();
-        break;
-
       case HostComponentProcess:
         resourceDefinition = new HostComponentProcessResourceDefinition();
         break;
@@ -251,39 +234,6 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
         resourceDefinition = new PermissionResourceDefinition();
         break;
 
-      case AlertDefinition:
-        resourceDefinition = new AlertDefResourceDefinition();
-        break;
-
-      case AmbariPrivilege:
-        resourceDefinition = new PrivilegeResourceDefinition(Resource.Type.AmbariPrivilege);
-        break;
-
-      case ClusterPrivilege:
-        resourceDefinition = new PrivilegeResourceDefinition(Resource.Type.ClusterPrivilege);
-        break;
-
-      case ViewPrivilege:
-        resourceDefinition = new PrivilegeResourceDefinition(Resource.Type.ViewPrivilege);
-        break;
-
-      case ViewPermission:
-        resourceDefinition = new ViewPermissionResourceDefinition();
-        break;
-
-      case Controller:
-        resourceDefinition = new ControllerResourceDefinition(
-            ControllerType.getByName(mapIds.get(Resource.Type.Controller)));
-        break;
-
-      case ClientConfig:
-        resourceDefinition = new ClientConfigResourceDefinition();
-        break;
-
-      case LdapSyncEvent:
-        resourceDefinition = new LdapSyncEventResourceDefinition();
-        break;
-
       default:
         throw new IllegalArgumentException("Unsupported resource type: " + type);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceConfigVersionResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceConfigVersionResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceConfigVersionResourceDefinition.java
deleted file mode 100644
index ef4108c..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ServiceConfigVersionResourceDefinition.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import java.util.List;
-
-import org.apache.ambari.server.api.services.Request;
-import org.apache.ambari.server.api.util.TreeNode;
-import org.apache.ambari.server.controller.spi.Resource;
-
-public class ServiceConfigVersionResourceDefinition extends BaseResourceDefinition {
-  /**
-   * Constructor.
-   *
-   */
-  public ServiceConfigVersionResourceDefinition() {
-    super(Resource.Type.ServiceConfigVersion);
-  }
-
-  @Override
-  public List<PostProcessor> getPostProcessors() {
-    List<PostProcessor> listProcessors = super.getPostProcessors();
-    listProcessors.add(new HrefProcessor());
-
-    return listProcessors;
-  }
-
-  @Override
-  public String getPluralName() {
-    return "service_config_versions";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "service_config_version";
-  }
-
-  private class HrefProcessor extends BaseHrefPostProcessor {
-
-    @Override
-    public void process(Request request, TreeNode<Resource> resultNode, String href) {
-      if (resultNode.getObject().getType() == Resource.Type.ServiceConfigVersion) {
-
-        if (! href.endsWith("/")) {
-          href += '/';
-        }
-
-        String clustersToken = "/clusters";
-        int idx = href.indexOf(clustersToken) + clustersToken.length() + 1;
-        idx = href.indexOf("/", idx) + 1;
-
-        String serviceName = (String) resultNode.getObject().getPropertyValue("service_name");
-        Long version = (Long) resultNode.getObject().getPropertyValue("service_config_version");
-        href = href.substring(0, idx)
-            + "configurations/service_config_versions?service_name="
-            + serviceName + "&service_config_version=" + version;
-
-        resultNode.setProperty("href", href);
-      } else {
-        super.process(request, resultNode, href);
-      }
-
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java
deleted file mode 100644
index 9265234..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackLevelConfigurationResourceDefinition.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.Resource.Type;
-
-public class StackLevelConfigurationResourceDefinition extends BaseStacksResourceDefinition {
-
-  public StackLevelConfigurationResourceDefinition(Type resourceType) {
-    super(Resource.Type.StackLevelConfiguration);
-  }
-
-  public StackLevelConfigurationResourceDefinition() {
-    super(Resource.Type.StackLevelConfiguration);
-  }
-
-  @Override
-  public String getPluralName() {
-    return "configurations";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "configuration";
-  }
-  /*
-  @Override
-  public Set<SubResourceDefinition> getSubResourceDefinitions() {
-    Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>();
-    return setChildren;
-  }
-  */
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
index 5bf3bac..d641e4c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
@@ -51,7 +51,6 @@ public class StackVersionResourceDefinition extends BaseStacksResourceDefinition
     
     setChildren.add(new SubResourceDefinition(Resource.Type.OperatingSystem));
     setChildren.add(new SubResourceDefinition(Resource.Type.StackService));
-    setChildren.add(new SubResourceDefinition(Resource.Type.StackLevelConfiguration));
 
     return setChildren;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ValidationResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ValidationResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ValidationResourceDefinition.java
deleted file mode 100644
index cc2cc0e..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ValidationResourceDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import org.apache.ambari.server.controller.spi.Resource;
-
-/**
- * Validation resource definition.
- */
-public class ValidationResourceDefinition extends BaseResourceDefinition {
-  /**
-   * Constructor.
-   */
-  public ValidationResourceDefinition() {
-    super(Resource.Type.Validation);
-  }
-
-  @Override
-  public String getPluralName() {
-    return "validations";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "validation";
-  }
-
-  @Override
-  public boolean isCreatable() {
-    return false;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java
index 632a6bc..00b4264 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewInstanceResourceDefinition.java
@@ -20,7 +20,6 @@ package org.apache.ambari.server.api.resources;
 
 import org.apache.ambari.server.controller.spi.Resource;
 
-import java.util.HashSet;
 import java.util.Set;
 
 
@@ -41,8 +40,7 @@ public class ViewInstanceResourceDefinition extends BaseResourceDefinition {
    */
   public ViewInstanceResourceDefinition(Set<SubResourceDefinition> subResourceDefinitions) {
     super(Resource.Type.ViewInstance);
-    this.subResourceDefinitions = new HashSet<SubResourceDefinition>(subResourceDefinitions);
-    this.subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewPrivilege));
+    this.subResourceDefinitions = subResourceDefinitions;
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java
deleted file mode 100644
index 1ff360d..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewPermissionResourceDefinition.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.resources;
-
-import org.apache.ambari.server.controller.spi.Resource;
-
-import java.util.Collections;
-import java.util.Set;
-
-
-/**
- * Permission resource definition.
- */
-public class ViewPermissionResourceDefinition extends BaseResourceDefinition {
-
-  // ----- Constructors ------------------------------------------------------
-
-  /**
-   * Construct a permission resource definition.
-   */
-  public ViewPermissionResourceDefinition() {
-    super(Resource.Type.ViewPermission);
-  }
-
-
-  // ----- ResourceDefinition ------------------------------------------------
-
-  @Override
-  public String getPluralName() {
-    return "permissions";
-  }
-
-  @Override
-  public String getSingularName() {
-    return "permission";
-  }
-
-  @Override
-  public Set<SubResourceDefinition> getSubResourceDefinitions() {
-    return Collections.emptySet();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java
index be21d1b..e67a50b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ViewVersionResourceDefinition.java
@@ -20,7 +20,7 @@ package org.apache.ambari.server.api.resources;
 
 import org.apache.ambari.server.controller.spi.Resource;
 
-import java.util.HashSet;
+import java.util.Collections;
 import java.util.Set;
 
 
@@ -53,9 +53,6 @@ public class ViewVersionResourceDefinition extends BaseResourceDefinition {
 
   @Override
   public Set<SubResourceDefinition> getSubResourceDefinitions() {
-    Set<SubResourceDefinition> subResourceDefinitions = new HashSet<SubResourceDefinition>();
-    subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewInstance));
-    subResourceDefinitions.add(new SubResourceDefinition(Resource.Type.ViewPermission));
-    return subResourceDefinitions;
+    return Collections.singleton(new SubResourceDefinition(Resource.Type.ViewInstance));
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertDefinitionService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertDefinitionService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertDefinitionService.java
deleted file mode 100644
index 506f911..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AlertDefinitionService.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ambari.server.api.services;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import org.apache.ambari.server.api.resources.ResourceInstance;
-import org.apache.ambari.server.controller.spi.Resource;
-
-/**
- * Endpoint for alert definitions.
- */
-public class AlertDefinitionService extends BaseService {
-
-  private String clusterName = null;
-  
-  AlertDefinitionService(String clusterName) {
-    this.clusterName = clusterName;
-  }
-  
-  @GET
-  @Produces("text/plain")
-  public Response getDefinitions(String body,
-      @Context HttpHeaders headers,
-      @Context UriInfo ui) {
-    return handleRequest(headers, body, ui, Request.Type.GET,
-      createResourceInstance(clusterName, null));
-  }
-  
-  @POST
-  @Produces("text/plain")
-  public Response createDefinition(String body,
-      @Context HttpHeaders headers,
-      @Context UriInfo ui) {
-    return handleRequest(headers, body, ui, Request.Type.POST,
-      createResourceInstance(clusterName, null));
-  }
-  
-  @PUT
-  @Path("{alertDefinitionId}")
-  @Produces("text/plain")
-  public Response updateDefinition(String body,
-      @Context HttpHeaders headers,
-      @Context UriInfo ui,
-      @PathParam("alertDefinitionId") Long id) {
-    return handleRequest(headers, body, ui, Request.Type.PUT,
-      createResourceInstance(clusterName, id));
-  }
-  
-  @DELETE
-  @Path("{alertDefinitionId}")
-  @Produces("text/plain")
-  public Response deleteDefinition(String body,
-      @Context HttpHeaders headers,
-      @Context UriInfo ui,
-      @PathParam("alertDefinitionId") Long id) {
-    return handleRequest(headers, body, ui, Request.Type.DELETE,
-      createResourceInstance(clusterName, id));
-  }
-
-  
-  @GET
-  @Path("{alertDefinitionId}")
-  @Produces("text/plain")
-  public Response getDefinitions(String body,
-      @Context HttpHeaders headers,
-      @Context UriInfo ui,
-      @PathParam("alertDefinitionId") Long id) {
-    return handleRequest(headers, body, ui, Request.Type.GET,
-      createResourceInstance(clusterName, id));
-  }
-  
-  
-  /**
-   * Create a request schedule resource instance
-   * @param clusterName
-   * @param requestScheduleId
-   * @return
-   */
-  private ResourceInstance createResourceInstance(String clusterName,
-      Long definitionId) {
-    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
-    mapIds.put(Resource.Type.Cluster, clusterName);
-    mapIds.put(Resource.Type.AlertDefinition, null == definitionId ? null : definitionId.toString());
-
-    return createResource(Resource.Type.AlertDefinition, mapIds);
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 371ca3b..542db0d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -31,7 +31,6 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Scanner;
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
@@ -59,10 +58,6 @@ import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.Stack;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.StackInfo;
-import org.apache.ambari.server.state.alert.AlertDefinition;
-import org.apache.ambari.server.state.alert.MetricSource;
-import org.apache.ambari.server.state.alert.Source;
-import org.apache.ambari.server.state.alert.SourceType;
 import org.apache.ambari.server.state.stack.LatestRepoCallable;
 import org.apache.ambari.server.state.stack.MetricDefinition;
 import org.apache.ambari.server.state.stack.RepositoryXml;
@@ -72,12 +67,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParseException;
 import com.google.gson.reflect.TypeToken;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
@@ -97,7 +86,6 @@ public class AmbariMetaInfo {
   public static final String SERVICE_CONFIG_FILE_NAME_POSTFIX = ".xml";
   public static final String RCO_FILE_NAME = "role_command_order.json";
   public static final String SERVICE_METRIC_FILE_NAME = "metrics.json";
-  public static final String SERVICE_ALERT_FILE_NAME = "alerts.json";
   /**
    * This string is used in placeholder in places that are common for
    * all operating systems or in situations where os type is not important.
@@ -125,7 +113,7 @@ public class AmbariMetaInfo {
   // all the supported OS'es
   private static final List<String> ALL_SUPPORTED_OS = Arrays.asList(
       "centos5", "redhat5", "centos6", "redhat6", "oraclelinux5",
-      "oraclelinux6", "suse11", "sles11", "ubuntu12");
+      "oraclelinux6", "suse11", "sles11", "ubuntu12", "debian12", "win2008server6", "win2008serverr26", "win2012server6", "win2012serverr26");
 
   private final ActionDefinitionManager adManager = new ActionDefinitionManager();
   private String serverVersion = "undefined";
@@ -402,7 +390,15 @@ public class AmbariMetaInfo {
   public boolean isValidServiceComponent(String stackName, String version,
                                          String serviceName, String componentName) throws AmbariException {
     ServiceInfo service = getServiceInfo(stackName, version, serviceName);
-    return service != null && service.getComponentByName(componentName) != null;
+    if (service == null) {
+      return false;
+    }
+    for (ComponentInfo compInfo : service.getComponents()) {
+      if (compInfo.getName().equals(componentName)) {
+        return true;
+      }
+    }
+    return false;
   }
 
   /**
@@ -428,12 +424,17 @@ public class AmbariMetaInfo {
         || services.isEmpty()) {
       return retService;
     }
+    boolean found = false;
     for (Map.Entry<String, ServiceInfo> entry : services.entrySet()) {
-      ComponentInfo vu = entry.getValue().getComponentByName(componentName);
-      if(vu != null){
-        retService = entry.getKey();
-        break;
+      for (ComponentInfo compInfo : entry.getValue().getComponents()) {
+        if (compInfo.getName().equals(componentName)) {
+          retService = entry.getKey();
+          found = true;
+          break;
+        }
       }
+      if (found)
+        break;
     }
     return retService;
   }
@@ -645,43 +646,17 @@ public class AmbariMetaInfo {
     return stackInfoResult;
   }
 
-  public List<String> getStackParentVersions(String stackName, String version) {
-    List<String> parents = new ArrayList<String>();
-    try {
-      StackInfo stackInfo = getStackInfo(stackName, version);
-      if (stackInfo != null) {
-        String parentVersion = stackInfo.getParentStackVersion();
-        if (parentVersion != null) {
-          parents.add(parentVersion);
-          parents.addAll(getStackParentVersions(stackName, parentVersion));
-        }
-      }
-    } catch (AmbariException e) {
-      // parent was not found. just returning empty list
-    } finally {
-      return parents;
-    }
-  }
-
   public Set<PropertyInfo> getProperties(String stackName, String version, String serviceName)
       throws AmbariException {
+
     ServiceInfo serviceInfo = getServiceInfo(stackName, version, serviceName);
     List<PropertyInfo> properties = serviceInfo.getProperties();
     Set<PropertyInfo> propertiesResult = new HashSet<PropertyInfo>(properties);
 
     return propertiesResult;
   }
-  
-  public Set<PropertyInfo> getStackProperties(String stackName, String version)
-      throws AmbariException {
-    StackInfo stackInfo = getStackInfo(stackName, version);
-    List<PropertyInfo> properties = stackInfo.getProperties();
-    Set<PropertyInfo> propertiesResult = new HashSet<PropertyInfo>(properties);
 
-    return propertiesResult;
-  }
-
-  public Set<PropertyInfo> getPropertiesByName(String stackName, String version, String serviceName, String propertyName)
+  public PropertyInfo getProperty(String stackName, String version, String serviceName, String propertyName)
       throws AmbariException {
     Set<PropertyInfo> properties = getProperties(stackName, version, serviceName);
 
@@ -691,14 +666,14 @@ public class AmbariMetaInfo {
           + ", serviceName=" + serviceName
           + ", propertyName=" + propertyName);
 
-    Set<PropertyInfo> propertyResult = new HashSet<PropertyInfo>();
+    PropertyInfo propertyResult = null;
 
     for (PropertyInfo property : properties) {
       if (property.getName().equals(propertyName))
-        propertyResult.add(property);
+        propertyResult = property;
     }
 
-    if (propertyResult.isEmpty())
+    if (propertyResult == null)
       throw new StackAccessException("stackName=" + stackName
           + ", stackVersion=" + version
           + ", serviceName=" + serviceName
@@ -706,30 +681,6 @@ public class AmbariMetaInfo {
 
     return propertyResult;
   }
-  
-  public Set<PropertyInfo> getStackPropertiesByName(String stackName, String version, String propertyName)
-      throws AmbariException {
-    Set<PropertyInfo> properties = getStackProperties(stackName, version);
-
-    if (properties.size() == 0)
-      throw new StackAccessException("stackName=" + stackName
-          + ", stackVersion=" + version
-          + ", propertyName=" + propertyName);
-
-    Set<PropertyInfo> propertyResult = new HashSet<PropertyInfo>();
-
-    for (PropertyInfo property : properties) {
-      if (property.getName().equals(propertyName))
-        propertyResult.add(property);
-    }
-
-    if (propertyResult.isEmpty())
-      throw new StackAccessException("stackName=" + stackName
-          + ", stackVersion=" + version
-          + ", propertyName=" + propertyName);
-
-    return propertyResult;
-  }
 
 
   /**
@@ -1098,74 +1049,5 @@ public class AmbariMetaInfo {
     }
     return requiredProperties;
   }
-  
-  /**
-   * @param stackName the stack name
-   * @param stackVersion the stack version
-   * @param serviceName the service name
-   * @return the alert definitions for a stack
-   * @throws AmbariException
-   */
-  public Set<AlertDefinition> getAlertDefinitions(String stackName, String stackVersion,
-      String serviceName) throws AmbariException {
-    
-    ServiceInfo svc = getService(stackName, stackVersion, serviceName);
-
-    if (null == svc.getAlertsFile() || !svc.getAlertsFile().exists()) {
-      LOG.debug("Alerts file for " + stackName + "/" + stackVersion + "/" + serviceName + " not found.");
-      return null;
-    }
-    
-    Map<String, List<AlertDefinition>> map = null;
-
-    GsonBuilder builder = new GsonBuilder().registerTypeAdapter(Source.class,
-        new JsonDeserializer<Source>() {
-          @Override
-          public Source deserialize(JsonElement json, Type typeOfT,
-              JsonDeserializationContext context) throws JsonParseException {
-            JsonObject jsonObj = (JsonObject) json;
-
-            SourceType type = SourceType.valueOf(jsonObj.get("type").getAsString());
-            Class<? extends Source> cls = null;
-            
-            switch (type) {
-              case METRIC:
-                cls = MetricSource.class;
-                break;
-              default:
-                break;
-            }
 
-            if (null != cls)
-              return context.deserialize(json, cls);
-            else
-              return null;
-          }
-        });
-    
-    Gson gson = builder.create();
-
-    try {
-      Type type = new TypeToken<Map<String, List<AlertDefinition>>>(){}.getType();
-      map = gson.fromJson(new FileReader(svc.getAlertsFile()), type);
-    } catch (Exception e) {
-      LOG.error ("Could not read the alert definition file", e);
-      throw new AmbariException("Could not read alert definition file", e);
-    }
-
-    Set<AlertDefinition> defs = new HashSet<AlertDefinition>();
-    
-    for (Entry<String, List<AlertDefinition>> entry : map.entrySet()) {
-      for (AlertDefinition ad : entry.getValue()) {
-        ad.setServiceName(serviceName);
-        if (!entry.getKey().equals("service")) {
-          ad.setComponentName(entry.getKey());
-        }
-      }
-      defs.addAll(entry.getValue());
-    }
-    
-    return defs;
-  }
-  
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariPrivilegeService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariPrivilegeService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariPrivilegeService.java
deleted file mode 100644
index db28f4f..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariPrivilegeService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing privileges and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.services;
-
-import org.apache.ambari.server.api.resources.ResourceInstance;
-import org.apache.ambari.server.controller.spi.Resource;
-
-import javax.ws.rs.Path;
-import java.util.Collections;
-
-/**
- *  Service responsible for Ambari privilege resource requests.
- */
-@Path("/privileges/")
-public class AmbariPrivilegeService extends PrivilegeService {
-
-  // ----- PrivilegeService --------------------------------------------------
-
-  @Override
-  protected ResourceInstance createPrivilegeResource(String privilegeId) {
-    return createResource(Resource.Type.AmbariPrivilege,
-        Collections.singletonMap(Resource.Type.AmbariPrivilege, privilegeId));
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
index 3afc23d..fa3b3ba 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
@@ -135,7 +135,7 @@ public abstract class BaseService {
    *
    * @return a newly created resource instance
    */
-  protected ResourceInstance createResource(Resource.Type type, Map<Resource.Type, String> mapIds) {
+  ResourceInstance createResource(Resource.Type type, Map<Resource.Type, String> mapIds) {
     return m_resourceFactory.createResource(type, mapIds);
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e28d1e3/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterPrivilegeService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterPrivilegeService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterPrivilegeService.java
deleted file mode 100644
index 11b4a46..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterPrivilegeService.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing privileges and
- * limitations under the License.
- */
-
-package org.apache.ambari.server.api.services;
-
-import org.apache.ambari.server.api.resources.ResourceInstance;
-import org.apache.ambari.server.controller.spi.Resource;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *  Service responsible for cluster privilege resource requests.
- */
-public class ClusterPrivilegeService extends PrivilegeService {
-
-  /**
-   * The cluster name.
-   */
-  private String clusterName;
-
-
-  // ----- Constructors ------------------------------------------------------
-
-  /**
-   * Construct a ClusterPrivilegeService.
-   *
-   * @param clusterName  the cluster name
-   */
-  public ClusterPrivilegeService(String clusterName) {
-    this.clusterName = clusterName;
-  }
-
-// ----- PrivilegeService --------------------------------------------------
-
-  @Override
-  protected ResourceInstance createPrivilegeResource(String privilegeId) {
-    Map<Resource.Type,String> mapIds = new HashMap<Resource.Type, String>();
-    mapIds.put(Resource.Type.Cluster, clusterName);
-    mapIds.put(Resource.Type.ClusterPrivilege, privilegeId);
-
-    return createResource(Resource.Type.ClusterPrivilege, mapIds);
-  }
-}
-


Mime
View raw message