incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject svn commit: r1452457 [1/3] - in /incubator/ambari/trunk: ./ ambari-server/src/main/java/org/apache/ambari/server/ ambari-server/src/main/java/org/apache/ambari/server/api/resources/ ambari-server/src/main/java/org/apache/ambari/server/api/services/ amb...
Date Mon, 04 Mar 2013 19:16:30 GMT
Author: swagle
Date: Mon Mar  4 19:16:28 2013
New Revision: 1452457

URL: http://svn.apache.org/r1452457
Log:
AMBARI-1548. Implement Stacks API using the consistent API framework in Ambari Server with all the get/predicates working. (swagle)

Added:
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/StackAccessException.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/OperatingSystemResourceDefinition.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RepositoryResourceDefinition.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackConfigurationResourceDefinition.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackResourceDefinition.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceComponentResourceDefinition.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceResourceDefinition.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemRequest.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemResponse.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationRequest.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackRequest.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackResponse.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentRequest.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceRequest.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionRequest.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReadOnlyResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceComponentResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackServiceResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/OperatingSystemInfo.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/Stack.java
    incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/api/services/StacksServiceTest.java
Removed:
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/StackNotFoundException.java
Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/PropertyInfo.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryInfo.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentImpl.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java
    incubator/ambari/trunk/ambari-server/src/main/resources/key_properties.json
    incubator/ambari/trunk/ambari-server/src/main/resources/properties.json
    incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
    incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1452457&r1=1452456&r2=1452457&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon Mar  4 19:16:28 2013
@@ -403,6 +403,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1548. Implement Stacks API using the consistent API framework in 
+ Ambari Server with all the get/predicates working. (swagle)
+
  AMBARI-1544. AmbariManagementControllerTest has extra import that cannot 
  be resolved. (swagle)
 

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/StackAccessException.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/StackAccessException.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/StackAccessException.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/StackAccessException.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,27 @@
+/**
+ * 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;
+
+@SuppressWarnings("serial")
+public class StackAccessException extends ObjectNotFoundException {
+
+  public StackAccessException(String message) {
+    super("Stack data, " + message);
+  }
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/OperatingSystemResourceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/OperatingSystemResourceDefinition.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/OperatingSystemResourceDefinition.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/OperatingSystemResourceDefinition.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,52 @@
+/**
+ * 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.Collections;
+import java.util.Set;
+
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.Resource.Type;
+
+public class OperatingSystemResourceDefinition extends BaseResourceDefinition {
+
+  public OperatingSystemResourceDefinition(Type resourceType) {
+    super(resourceType);
+  }
+
+  public OperatingSystemResourceDefinition() {
+    super(Resource.Type.OperatingSystem);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "operatingSystems";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "operatingSystem";
+  }
+  
+  @Override
+  public Set<SubResourceDefinition> getSubResourceDefinitions() {
+    return Collections.singleton(new SubResourceDefinition(Resource.Type.Repository));
+  }
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RepositoryResourceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RepositoryResourceDefinition.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RepositoryResourceDefinition.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/RepositoryResourceDefinition.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,43 @@
+/**
+ * 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 org.apache.ambari.server.controller.spi.Resource.Type;
+
+public class RepositoryResourceDefinition extends BaseResourceDefinition {
+
+  public RepositoryResourceDefinition(Type resourceType) {
+    super(Resource.Type.Repository);
+  }
+
+  public RepositoryResourceDefinition() {
+    super(Resource.Type.Repository);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "repositories";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "repository";
+  }
+
+}

Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java?rev=1452457&r1=1452456&r2=1452457&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java (original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java Mon Mar  4 19:16:28 2013
@@ -79,6 +79,34 @@ public class ResourceInstanceFactoryImpl
         resourceDefinition = new RequestResourceDefinition();
         break;
 
+      case Stack:
+        resourceDefinition = new StackResourceDefinition();
+        break;
+        
+      case StackVersion:
+        resourceDefinition = new StackVersionResourceDefinition();
+        break;
+        
+      case StackService:
+        resourceDefinition = new StackServiceResourceDefinition();
+        break;
+        
+      case StackServiceComponent:
+        resourceDefinition = new StackServiceComponentResourceDefinition();
+        break;
+        
+      case StackConfiguration:
+        resourceDefinition = new StackConfigurationResourceDefinition();
+        break;
+        
+      case OperatingSystem:
+        resourceDefinition = new OperatingSystemResourceDefinition();
+        break;
+        
+      case Repository:
+        resourceDefinition = new RepositoryResourceDefinition();
+        break;
+
       default:
         throw new IllegalArgumentException("Unsupported resource type: " + type);
     }

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackConfigurationResourceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackConfigurationResourceDefinition.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackConfigurationResourceDefinition.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackConfigurationResourceDefinition.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,46 @@
+/**
+ * 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 org.apache.ambari.server.controller.spi.Resource.Type;
+
+public class StackConfigurationResourceDefinition extends
+    BaseResourceDefinition {
+
+  public StackConfigurationResourceDefinition(Type resourceType) {
+    super(resourceType);
+  }
+
+  public StackConfigurationResourceDefinition() {
+    super(Resource.Type.StackConfiguration);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "configurations";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "configuration";
+  }
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackResourceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackResourceDefinition.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackResourceDefinition.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackResourceDefinition.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,54 @@
+/**
+ * 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 StackResourceDefinition extends BaseResourceDefinition {
+
+  public StackResourceDefinition(Type resourceType) {
+    super(Resource.Type.Stack);
+  }
+
+  public StackResourceDefinition() {
+    super(Resource.Type.Stack);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "stacks";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "stack";
+  }
+
+  @Override
+  public Set<SubResourceDefinition> getSubResourceDefinitions() {
+    Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>();
+    setChildren.add(new SubResourceDefinition(Resource.Type.StackVersion));
+    return setChildren;
+  }
+
+}
\ No newline at end of file

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceComponentResourceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceComponentResourceDefinition.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceComponentResourceDefinition.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceComponentResourceDefinition.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,45 @@
+/**
+ * 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 org.apache.ambari.server.controller.spi.Resource.Type;
+
+public class StackServiceComponentResourceDefinition extends
+    BaseResourceDefinition {
+
+  public StackServiceComponentResourceDefinition(Type resourceType) {
+    super(resourceType);
+  }
+
+  public StackServiceComponentResourceDefinition() {
+    super(Resource.Type.StackServiceComponent);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "serviceComponents";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "serviceComponent";
+  }
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceResourceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceResourceDefinition.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceResourceDefinition.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackServiceResourceDefinition.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,58 @@
+/**
+ * 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 StackServiceResourceDefinition extends BaseResourceDefinition {
+
+  public StackServiceResourceDefinition(Type resourceType) {
+    super(resourceType);
+  }
+
+  public StackServiceResourceDefinition() {
+    super(Resource.Type.StackService);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "stackServices";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "stackService";
+  }
+
+  @Override
+  public Set<SubResourceDefinition> getSubResourceDefinitions() {
+
+    Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>();
+    setChildren.add(new SubResourceDefinition(Resource.Type.StackConfiguration));
+    setChildren.add(new SubResourceDefinition(Resource.Type.StackServiceComponent));
+
+    return setChildren;
+
+  }
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/resources/StackVersionResourceDefinition.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,58 @@
+/**
+ * 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 StackVersionResourceDefinition extends BaseResourceDefinition {
+
+  public StackVersionResourceDefinition(Type resourceType) {
+    super(Resource.Type.StackVersion);
+  }
+
+  public StackVersionResourceDefinition() {
+    super(Resource.Type.StackVersion);
+  }
+
+  @Override
+  public String getPluralName() {
+    return "versions";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "version";
+  }
+
+  @Override
+  public Set<SubResourceDefinition> getSubResourceDefinitions() {
+
+    Set<SubResourceDefinition> setChildren = new HashSet<SubResourceDefinition>();
+    
+    setChildren.add(new SubResourceDefinition(Resource.Type.OperatingSystem));
+    setChildren.add(new SubResourceDefinition(Resource.Type.StackService));
+
+    return setChildren;
+
+  }
+}

Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java?rev=1452457&r1=1452456&r2=1452457&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java (original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java Mon Mar  4 19:16:28 2013
@@ -20,6 +20,10 @@ package org.apache.ambari.server.api.ser
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.ObjectNotFoundException;
+import org.apache.ambari.server.StackAccessException;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.state.*;
 import org.slf4j.Logger;
@@ -35,8 +39,10 @@ import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * ServiceInfo responsible getting information about cluster.
@@ -122,9 +128,10 @@ public class AmbariMetaInfo {
      * @param serviceName
      * @param componentName
      * @return component component Info
+     * @throws AmbariException 
      */
     public ComponentInfo getComponentCategory(String stackName, String version,
-                                              String serviceName, String componentName) {
+                                              String serviceName, String componentName) throws AmbariException {
         ComponentInfo component = null;
         List<ComponentInfo> components = getComponentsByService(stackName, version,
                 serviceName);
@@ -146,9 +153,10 @@ public class AmbariMetaInfo {
      * @param version
      * @param serviceName
      * @return
+     * @throws AmbariException 
      */
     public List<ComponentInfo> getComponentsByService(String stackName,
-                                                      String version, String serviceName) {
+                                                      String version, String serviceName) throws AmbariException {
         List<ComponentInfo> componentsResult = null;
         ServiceInfo service = getServiceInfo(stackName, version, serviceName);
         if (service != null)
@@ -156,9 +164,36 @@ public class AmbariMetaInfo {
 
         return componentsResult;
     }
+    
+    public ComponentInfo getComponent(String stackName, String version, String serviceName,
+        String componentName) throws AmbariException {
+      
+      List<ComponentInfo> componentsByService = getComponentsByService(stackName, version, serviceName);
+      
+      if (componentsByService.size() == 0)
+        throw new StackAccessException("stackName=" + stackName 
+                                     + ", stackVersion=" + version 
+                                     + ", stackVersion=" + serviceName 
+                                     + ", componentName=" + componentName);
+      
+      ComponentInfo componentResult = null;
+      
+      for (ComponentInfo component: componentsByService) {
+        if (component.getName().equals(componentName))
+          componentResult = component;
+      }
+      
+      if (componentResult == null)
+        throw new StackAccessException("stackName=" + stackName 
+                                     + ", stackVersion=" + version 
+                                     + ", stackVersion=" + serviceName 
+                                     + ", componentName=" + componentName);
+      
+      return componentResult; 
+    }
 
     public Map<String, List<RepositoryInfo>> getRepository(String stackName,
-                                                           String version) {
+                                                           String version) throws AmbariException {
         Map<String, List<RepositoryInfo>> reposResult = null;
         StackInfo stack = getStackInfo(stackName, version);
         if (stack != null) {
@@ -174,15 +209,57 @@ public class AmbariMetaInfo {
         }
         return reposResult;
     }
+    
+    
+    public List<RepositoryInfo> getRepositories(String stackName,
+        String version, String osType) throws AmbariException {
+      
+      StackInfo stack = getStackInfo(stackName, version);
+      List<RepositoryInfo> repositories = stack.getRepositories();
+      
+      List<RepositoryInfo> repositoriesResult = new ArrayList<RepositoryInfo>();
+      for (RepositoryInfo repository : repositories) {
+        if (repository.getOsType().equals(osType))
+          repositoriesResult.add(repository);
+      }
+      return repositoriesResult;
+    }
+    
+    
+    public RepositoryInfo getRepository(String stackName,
+        String version, String osType, String repoId) throws AmbariException {
+      
+      List<RepositoryInfo> repositories = getRepositories(stackName, version, osType);
+      
+      if (repositories.size() == 0)
+        throw new StackAccessException("stackName=" + stackName 
+                                     + ", stackVersion=" + version 
+                                     + ", osType=" + osType
+                                     + ", repoId=" + repoId);
+
+      RepositoryInfo repoResult = null;
+      for (RepositoryInfo repository : repositories) {
+        if (repository.getRepoId().equals(repoId))
+          repoResult = repository;
+      }
+      if (repoResult == null )
+        throw new StackAccessException("stackName=" + stackName 
+                                       + ", stackName= " + version
+                                       + ", osType=" + osType 
+                                       + ", repoId= " + repoId);
+      return repoResult;
+    }
+    
 
     /*
      * function for given a stack name and version, is it a supported stack
      */
-    public boolean isSupportedStack(String stackName, String version) {
+    public boolean isSupportedStack(String stackName, String version) throws AmbariException {
         boolean exist = false;
-        StackInfo stack = getStackInfo(stackName, version);
-        if (stack == null)
-            exist = true;
+        try {
+          getStackInfo(stackName, version);
+          exist = true;
+        } catch (ObjectNotFoundException e) { }
         return exist;
     }
 
@@ -190,16 +267,21 @@ public class AmbariMetaInfo {
      * support isValidService(), isValidComponent for a given stack/version
      */
     public boolean isValidService(String stackName, String version,
-                                  String serviceName) {
-        ServiceInfo service = getServiceInfo(stackName, version, serviceName);
-        return (service != null);
+                                  String serviceName) throws AmbariException {
+      
+      boolean exist = false;
+      try {
+        getServiceInfo(stackName, version, serviceName);
+        exist = true;
+      } catch (ObjectNotFoundException e) { }
+      return exist;
     }
 
     /*
      * support isValidService(), isValidComponent for a given stack/version
      */
     public boolean isValidServiceComponent(String stackName, String version,
-                                           String serviceName, String componentName) {
+                                           String serviceName, String componentName) throws AmbariException {
         ServiceInfo service = getServiceInfo(stackName, version, serviceName);
         if (service == null) {
             return false;
@@ -220,9 +302,10 @@ public class AmbariMetaInfo {
      * @param version       the stack version
      * @param componentName the component name
      * @return the service name
+     * @throws AmbariException 
      */
     public String getComponentToService(String stackName, String version,
-                                        String componentName) {
+                                        String componentName) throws AmbariException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("Looking for service for component"
                     + ", stackName=" + stackName
@@ -257,9 +340,10 @@ public class AmbariMetaInfo {
      * @param version     the version of the stack
      * @param serviceName the name of the service in the stack
      * @return the config knobs supported for the service
+     * @throws AmbariException 
      */
     public Map<String, Map<String, String>> getSupportedConfigs(String stackName,
-                                                                String version, String serviceName) {
+                                                                String version, String serviceName) throws AmbariException {
         Map<String, Map<String, String>> propertiesResult = new HashMap<String, Map<String, String>>();
 
         ServiceInfo service = getServiceInfo(stackName, version, serviceName);
@@ -294,8 +378,9 @@ public class AmbariMetaInfo {
      * @param version   the version of the stack
      * @return the information of abt varios services that are supported in the
      *         stack
+     * @throws AmbariException 
      */
-    public Map<String, ServiceInfo> getServices(String stackName, String version) {
+    public Map<String, ServiceInfo> getServices(String stackName, String version) throws AmbariException {
 
         Map<String, ServiceInfo> servicesInfoResult = new HashMap<String, ServiceInfo>();
 
@@ -310,9 +395,27 @@ public class AmbariMetaInfo {
             }
         return servicesInfoResult;
     }
-
+    
+    
+    public ServiceInfo getService(String stackName, String version, String serviceName) throws AmbariException {
+
+      Map<String, ServiceInfo> services = getServices(stackName, version);
+      
+      if (services.size() == 0)
+        throw new StackAccessException("stackName=" + stackName +", stackVersion=" + version + ", serviceName=" + serviceName);
+      
+      ServiceInfo serviceInfo = services.get(serviceName);
+      
+      if (serviceInfo == null)
+        throw new StackAccessException("stackName=" + stackName +", stackVersion=" + version + ", serviceName=" + serviceName);
+      
+      return serviceInfo;
+        
+  }
+    
+    
     public ServiceInfo getServiceInfo(String stackName, String version,
-                                      String serviceName) {
+                                      String serviceName) throws AmbariException {
         ServiceInfo serviceInfoResult = null;
         List<ServiceInfo> services = null;
         StackInfo stack = getStackInfo(stackName, version);
@@ -329,7 +432,7 @@ public class AmbariMetaInfo {
         return serviceInfoResult;
     }
 
-    public List<ServiceInfo> getSupportedServices(String stackName, String version) {
+    public List<ServiceInfo> getSupportedServices(String stackName, String version) throws AmbariException {
         List<ServiceInfo> servicesResulr = null;
         StackInfo stack = getStackInfo(stackName, version);
         if (stack != null)
@@ -340,21 +443,147 @@ public class AmbariMetaInfo {
     public List<StackInfo> getSupportedStacks() {
         return stacksResult;
     }
+    
+    public Set<Stack> getStackNames() {
+      
+      Set<Stack> stacks = new HashSet<Stack>();
+      List<StackInfo> supportedStacks = getSupportedStacks();
+      
+      for(StackInfo stackInfo : supportedStacks) {
+        Stack stack = new Stack(stackInfo.getName());
+        stacks.add(stack);
+      }
+      
+      return stacks;
+  }
+    
+    
+    public Stack getStack(String stackName) throws AmbariException {
+      
+      Set<Stack> supportedStackNames = getStackNames();   
+      
+      if (supportedStackNames.size()==0)
+        throw new StackAccessException("stackName=" + stackName);
+
+      Stack stackResult = null;
+      
+      for (Stack stack: supportedStackNames) {
+        if (stack.getStackName().equals(stackName))
+          stackResult = stack;
+      }
+      
+      if (stackResult == null)
+        throw new StackAccessException("stackName=" + stackName);
+
+      return stackResult;
+  }
+    
+
+    
+    public Set<StackInfo> getStackInfos(String stackName) {
+      
+      Set<StackInfo> stackVersions = new HashSet<StackInfo>();
+      for (StackInfo stackInfo : stacksResult ) {
+        if (stackName.equals(stackInfo.getName()))
+          stackVersions.add(stackInfo);
+      }
+      return stackVersions;
 
-    public StackInfo getStackInfo(String stackName, String version) {
-        StackInfo stackInfoResult = null;
-
-        for (StackInfo stack : stacksResult) {
-            if (stackName.equals(stack.getName())
-                    && version.equals(stack.getVersion())) {
-                stackInfoResult = stack;
-                break;
-            }
-        }
-        return stackInfoResult;
     }
+    
+    public StackInfo getStackInfo(String stackName, String version) throws AmbariException {
+      StackInfo stackInfoResult = null;
+
+      for (StackInfo stack : stacksResult) {
+          if (stackName.equals(stack.getName())
+                  && version.equals(stack.getVersion())) {
+              stackInfoResult = stack;
+              break;
+          }
+      }
+      
+      if (stackInfoResult == null)
+        throw new StackAccessException("stackName=" + stackName
+                                     + ", stackVersion=" + version);
+      
+      return stackInfoResult;
+  }
+    
+    
+    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 PropertyInfo getProperty(String stackName, String version, String serviceName, String propertyName) throws AmbariException {
+      Set<PropertyInfo> properties = getProperties(stackName, version, serviceName);
+      
+      if (properties.size() == 0)
+        throw new StackAccessException("stackName=" + stackName 
+                                     + ", stackVersion=" + version
+                                     + ", serviceName=" + serviceName
+                                     + ", propertyName=" +  propertyName);
+
+      PropertyInfo propertyResult = null;
+
+      for (PropertyInfo property : properties) {
+        if (property.getName().equals(propertyName))
+          propertyResult = property;
+      }
+      
+      if (propertyResult == null)
+        throw new StackAccessException("stackName=" + stackName 
+            + ", stackVersion=" + version
+            + ", serviceName=" + serviceName
+            + ", propertyName=" +  propertyName);
+      
+      return propertyResult;  
+  }
+
+
+    public Set<OperatingSystemInfo> getOperatingSystems(String stackName, String version) throws AmbariException {
+      
+      Set<OperatingSystemInfo> operatingSystems = new HashSet<OperatingSystemInfo>();;
+      StackInfo stack = getStackInfo(stackName, version);
+      List<RepositoryInfo> repositories = stack.getRepositories();
+      for (RepositoryInfo repository: repositories ) {
+        operatingSystems.add(new OperatingSystemInfo(repository.getOsType()));
+      }
+      
+      return operatingSystems;
+  }
+    
+    public OperatingSystemInfo getOperatingSystem(String stackName, String version, String osType) throws AmbariException {
+      
+      Set<OperatingSystemInfo> operatingSystems = getOperatingSystems(stackName, version);
+      
+      if (operatingSystems.size() == 0)
+        throw new StackAccessException("stackName=" + stackName
+                                     + ", stackVersion=" + version
+                                     + ", osType=" + osType);
+      
+      OperatingSystemInfo resultOperatingSystem = null;
+      
+      for (OperatingSystemInfo operatingSystem : operatingSystems) {
+        if (operatingSystem.getOsType().equals(osType))
+          resultOperatingSystem = operatingSystem;
+      }
+      
+      if (resultOperatingSystem==null)
+        throw new StackAccessException("stackName=" + stackName
+                                     + ", stackVersion=" + version
+                                     + ", osType=" + osType);
+      
+      return resultOperatingSystem;
+  }
 
-
+   
+    
     private void getConfigurationInformation(File stackRoot) throws Exception {
 
         if (LOG.isDebugEnabled()) {
@@ -654,4 +883,6 @@ public class AmbariMetaInfo {
         return false;
     }
 
+
+
 }

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,280 @@
+/**
+ * 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.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.GET;
+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;
+
+/**
+ * Service for stacks management.
+ */
+@Path("/stacks2/")
+public class StacksService extends BaseService {
+
+  @GET
+  @Produces("text/plain")
+  public Response getStacks(@Context HttpHeaders headers, @Context UriInfo ui) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackResource(null));
+  }
+
+  @GET
+  @Path("{stackName}")
+  @Produces("text/plain")
+  public Response getStack(@Context HttpHeaders headers, @Context UriInfo ui,
+      @PathParam("stackName") String stackName) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackResource(stackName));
+  }
+
+  @GET
+  @Path("{stackName}/versions")
+  @Produces("text/plain")
+  public Response getStackVersions(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackVersionResource(stackName, null));
+  }
+
+  @GET
+  @Path("{stackName}/versions/{stackVersion}")
+  @Produces("text/plain")
+  public Response getStackVersion(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackVersionResource(stackName, stackVersion));
+  }
+
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/operatingSystems/{osType}/repositories")
+  @Produces("text/plain")
+  public Response getRepositories(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("osType") String osType) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createRepositoryResource(stackName, stackVersion, osType, null));
+  }
+
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/operatingSystems/{osType}/repositories/{repoId}")
+  @Produces("text/plain")
+  public Response getRepository(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("osType") String osType,
+      @PathParam("repoId") String repoId) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createRepositoryResource(stackName, stackVersion, osType, repoId));
+  }
+
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/stackServices")
+  @Produces("text/plain")
+  public Response getStackServices(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackServiceResource(stackName, stackVersion, null));
+  }
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/stackServices/{serviceName}")
+  @Produces("text/plain")
+  public Response getStackService(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("serviceName") String serviceName) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackServiceResource(stackName, stackVersion, serviceName));
+  }
+  
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/stackServices/{serviceName}/configurations")
+  @Produces("text/plain")
+  public Response getStackConfigurations(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("serviceName") String serviceName) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackConfigurationResource(stackName, stackVersion, serviceName, null));
+  }
+  
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/stackServices/{serviceName}/configurations/{propertyName}")
+  @Produces("text/plain")
+  public Response getStackConfiguration(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("serviceName") String serviceName,
+      @PathParam("propertyName") String propertyName) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackConfigurationResource(stackName, stackVersion, serviceName, propertyName));
+  }
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/stackServices/{serviceName}/serviceComponents")
+  @Produces("text/plain")
+  public Response getServiceComponents(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("serviceName") String serviceName) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackServiceComponentResource(stackName, stackVersion, serviceName, null));
+  }
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/stackServices/{serviceName}/serviceComponents/{componentName}")
+  @Produces("text/plain")
+  public Response getServiceComponent(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("serviceName") String serviceName,
+      @PathParam("componentName") String componentName) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createStackServiceComponentResource(stackName, stackVersion, serviceName, componentName));
+  }
+  
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/operatingSystems")
+  @Produces("text/plain")
+  public Response getOperatingSystems(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createOperatingSystemResource(stackName, stackVersion, null));
+  }
+  
+  @GET
+  @Path("{stackName}/versions/{stackVersion}/operatingSystems/{osType}")
+  @Produces("text/plain")
+  public Response getOperatingSystem(@Context HttpHeaders headers,
+      @Context UriInfo ui, @PathParam("stackName") String stackName,
+      @PathParam("stackVersion") String stackVersion,
+      @PathParam("osType") String osType) {
+
+    return handleRequest(headers, null, ui, Request.Type.GET,
+        createOperatingSystemResource(stackName, stackVersion, osType));
+  }
+  
+  
+  ResourceInstance createOperatingSystemResource(String stackName,
+      String stackVersion, String osType) {
+    
+    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
+    mapIds.put(Resource.Type.Stack, stackName);
+    mapIds.put(Resource.Type.StackVersion, stackVersion);
+    mapIds.put(Resource.Type.OperatingSystem, osType);
+
+    return createResource(Resource.Type.OperatingSystem, mapIds);
+  }
+
+  ResourceInstance createStackServiceComponentResource(
+      String stackName, String stackVersion, String serviceName, String componentName) {
+
+    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
+    mapIds.put(Resource.Type.Stack, stackName);
+    mapIds.put(Resource.Type.StackVersion, stackVersion);
+    mapIds.put(Resource.Type.StackService, serviceName);
+    mapIds.put(Resource.Type.StackServiceComponent, componentName);
+
+    return createResource(Resource.Type.StackServiceComponent, mapIds);
+  }
+
+  ResourceInstance createStackConfigurationResource(String stackName,
+      String stackVersion, String serviceName, String propertyName) {
+    
+    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
+    mapIds.put(Resource.Type.Stack, stackName);
+    mapIds.put(Resource.Type.StackVersion, stackVersion);
+    mapIds.put(Resource.Type.StackService, serviceName);
+    mapIds.put(Resource.Type.StackConfiguration, propertyName);
+
+    return createResource(Resource.Type.StackConfiguration, mapIds);
+  }
+
+  ResourceInstance createStackServiceResource(String stackName,
+      String stackVersion, String serviceName) {
+    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
+    mapIds.put(Resource.Type.Stack, stackName);
+    mapIds.put(Resource.Type.StackVersion, stackVersion);
+    mapIds.put(Resource.Type.StackService, serviceName);
+
+    return createResource(Resource.Type.StackService, mapIds);
+  }
+
+  ResourceInstance createRepositoryResource(String stackName,
+      String stackVersion, String osType, String repoId) {
+
+    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
+    mapIds.put(Resource.Type.Stack, stackName);
+    mapIds.put(Resource.Type.StackVersion, stackVersion);
+    mapIds.put(Resource.Type.OperatingSystem, osType);
+    mapIds.put(Resource.Type.Repository, repoId);
+
+    return createResource(Resource.Type.Repository, mapIds);
+  }
+
+  ResourceInstance createStackVersionResource(String stackName,
+      String stackVersion) {
+    Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>();
+    mapIds.put(Resource.Type.Stack, stackName);
+    mapIds.put(Resource.Type.StackVersion, stackVersion);
+
+    return createResource(Resource.Type.StackVersion, mapIds);
+  }
+
+  ResourceInstance createStackResource(String stackName) {
+
+    return createResource(Resource.Type.Stack,
+        Collections.singletonMap(Resource.Type.Stack, stackName));
+
+  }
+}

Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java?rev=1452457&r1=1452456&r2=1452457&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java (original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java Mon Mar  4 19:16:28 2013
@@ -19,7 +19,6 @@
 package org.apache.ambari.server.controller;
 
 import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.ObjectNotFoundException;
 import org.apache.ambari.server.ParentObjectNotFoundException;
 
 import java.util.Map;
@@ -371,11 +370,111 @@ public interface AmbariManagementControl
    * 
    * @throws  AmbariException if the resources cannot be deleted
    */
-  public void deleteUsers(Set<UserRequest> requests) throws AmbariException;  
-
+  public void deleteUsers(Set<UserRequest> requests) throws AmbariException;
+  
+  /**
+   * Create the action defined by the attributes in the given request object.
+   *
+   * @param request the request object which defines the action to be created
+   *
+   * @throws AmbariException thrown if the action cannot be created
+   */
   public RequestStatusResponse createActions(Set<ActionRequest> request)
       throws AmbariException;
-
+  
+  /**
+   * Get the actions identified by the given request objects.
+   *
+   * @param requests  the request objects which identify the actions to be returned
+   *
+   * @return a set of actions responses
+   *
+   * @throws AmbariException thrown if the resource cannot be read
+   */
   public Set<ActionResponse> getActions(Set<ActionRequest> request)
       throws AmbariException;
+
+
+  /**
+   * Get supported stacks.
+   * 
+   * @param requests the stacks
+   * 
+   * @return a set of stacks responses
+   * 
+   * @throws  AmbariException if the resources cannot be read
+   */
+  public Set<StackResponse> getStacks(Set<StackRequest> requests) throws AmbariException;
+  
+  
+  /**
+   * Get supported stacks versions.
+   * 
+   * @param requests the stacks versions
+   * 
+   * @return a set of stacks versions responses
+   * 
+   * @throws  AmbariException if the resources cannot be read
+   */
+  public Set<StackVersionResponse> getStackVersions(Set<StackVersionRequest> requests) throws AmbariException;
+
+  
+  /**
+   * Get repositories by stack name, version and operating system.
+   * 
+   * @param requests the repositories 
+   * 
+   * @return a set of repositories
+   * 
+   * @throws  AmbariException if the resources cannot be read
+   */
+  public Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests) throws AmbariException;
+
+  
+  /**
+   * Get repositories by stack name, version.
+   * 
+   * @param requests the services 
+   * 
+   * @return a set of services
+   * 
+   * @throws  AmbariException if the resources cannot be read
+   */
+  public Set<StackServiceResponse> getStackServices(Set<StackServiceRequest> requests) throws AmbariException;
+
+  
+  /**
+   * Get configurations by stack name, version and service.
+   * 
+   * @param requests the configurations 
+   * 
+   * @return a set of configurations
+   * 
+   * @throws  AmbariException if the resources cannot be read
+   */
+  public Set<StackConfigurationResponse> getStackConfigurations(Set<StackConfigurationRequest> requests) throws AmbariException;
+  
+  
+  /**
+   * Get components by stack name, version and service.
+   * 
+   * @param requests the components 
+   * 
+   * @return a set of components
+   * 
+   * @throws  AmbariException if the resources cannot be read
+   */
+  public Set<StackServiceComponentResponse> getStackComponents(Set<StackServiceComponentRequest> requests) throws AmbariException;
+  
+  
+  /**
+   * Get operating systems by stack name, version.
+   * 
+   * @param requests the operating systems 
+   * 
+   * @return a set of operating systems 
+   * 
+   * @throws  AmbariException if the resources cannot be read
+   */
+  public Set<OperatingSystemResponse> getStackOperatingSystems(Set<OperatingSystemRequest> requests) throws AmbariException;
 }

Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java?rev=1452457&r1=1452456&r2=1452457&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java (original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java Mon Mar  4 19:16:28 2013
@@ -30,19 +30,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
-
-import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.ClusterNotFoundException;
-import org.apache.ambari.server.DuplicateResourceException;
-import org.apache.ambari.server.HostNotFoundException;
-import org.apache.ambari.server.ObjectNotFoundException;
-import org.apache.ambari.server.ParentObjectNotFoundException;
-import org.apache.ambari.server.Role;
-import org.apache.ambari.server.RoleCommand;
-import org.apache.ambari.server.ServiceComponentHostNotFoundException;
-import org.apache.ambari.server.ServiceComponentNotFoundException;
-import org.apache.ambari.server.ServiceNotFoundException;
-import org.apache.ambari.server.StackNotFoundException;
+import org.apache.ambari.server.*;
 import org.apache.ambari.server.actionmanager.ActionManager;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.RequestStatus;
@@ -62,6 +50,8 @@ import org.apache.ambari.server.state.Co
 import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.ConfigFactory;
 import org.apache.ambari.server.state.Host;
+import org.apache.ambari.server.state.OperatingSystemInfo;
+import org.apache.ambari.server.state.PropertyInfo;
 import org.apache.ambari.server.state.RepositoryInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
@@ -70,6 +60,7 @@ import org.apache.ambari.server.state.Se
 import org.apache.ambari.server.state.ServiceComponentHostEvent;
 import org.apache.ambari.server.state.ServiceComponentHostFactory;
 import org.apache.ambari.server.state.ServiceFactory;
+import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.StackInfo;
 import org.apache.ambari.server.state.State;
@@ -186,8 +177,7 @@ public class AmbariManagementControllerI
     StackInfo stackInfo = ambariMetaInfo.getStackInfo(stackId.getStackName(),
         stackId.getStackVersion());
     if (stackInfo == null) {
-      throw new StackNotFoundException(stackId.getStackName(),
-          stackId.getStackVersion());
+      throw new StackAccessException("stackName=" + stackId.getStackName() + ", stackVersion=" + stackId.getStackVersion());
     }
 
     // FIXME add support for desired configs at cluster level
@@ -3534,4 +3524,288 @@ public class AmbariManagementControllerI
       throw new AmbariException("Stage was not created");
     }
   }
+  
+  
+  @Override
+  public Set<StackResponse> getStacks(Set<StackRequest> requests)
+      throws AmbariException {
+    Set<StackResponse> response = new HashSet<StackResponse>();
+    for (StackRequest request : requests) {
+      try {
+        response.addAll(getStacks(request));
+      } catch (StackAccessException e) {
+        if (requests.size() == 1) {
+          // only throw exception if 1 request.
+          // there will be > 1 request in case of OR predicate
+          throw e;
+        }
+      }
+    }
+    return response;
+
+  }
+
+  private Set<StackResponse> getStacks(StackRequest request)
+      throws AmbariException {
+    Set<StackResponse> response;
+    
+    String stackName = request.getStackName();
+
+    if (stackName != null) {
+      org.apache.ambari.server.state.Stack stack = this.ambariMetaInfo.getStack(stackName);
+      response = Collections.singleton(stack.convertToResponse());
+    } else {
+      Set<org.apache.ambari.server.state.Stack> supportedStackNames = this.ambariMetaInfo.getStackNames();
+      response = new HashSet<StackResponse>();
+      for (org.apache.ambari.server.state.Stack stack: supportedStackNames) {
+        response.add(stack.convertToResponse());
+      }
+    }
+    return response;
+  }
+
+  @Override
+  public Set<RepositoryResponse> getRepositories(Set<RepositoryRequest> requests)
+      throws AmbariException {
+    Set<RepositoryResponse> response = new HashSet<RepositoryResponse>();
+    for (RepositoryRequest request : requests) {
+      try {
+        response.addAll(getRepositories(request));
+      } catch (StackAccessException e) {
+        if (requests.size() == 1) {
+          // only throw exception if 1 request.
+          // there will be > 1 request in case of OR predicate
+          throw e;
+        }
+      }
+    }
+    return response;
+  }
+
+  private Set<RepositoryResponse> getRepositories(RepositoryRequest request) throws AmbariException {
+    
+    String stackName = request.getStackName();
+    String stackVersion = request.getStackVersion();
+    String osType = request.getOsType();
+    String repoId = request.getRepoId();
+    
+    Set<RepositoryResponse> response;
+    
+    if (repoId == null) {
+      List<RepositoryInfo> repositories = this.ambariMetaInfo.getRepositories(stackName, stackVersion, osType);
+      response = new HashSet<RepositoryResponse>();
+      
+      for (RepositoryInfo repository: repositories) {
+        response.add(repository.convertToResponse());
+      }
+      
+    } else {
+      RepositoryInfo repository = this.ambariMetaInfo.getRepository(stackName, stackVersion, osType, repoId);
+      response = Collections.singleton(repository.convertToResponse());
+    }
+
+    return response;
+  }
+
+  @Override
+  public Set<StackVersionResponse> getStackVersions(
+      Set<StackVersionRequest> requests) throws AmbariException {
+    Set<StackVersionResponse> response = new HashSet<StackVersionResponse>();
+    for (StackVersionRequest request : requests) {
+      try {
+        response.addAll(getStackVersions(request));
+      } catch (StackAccessException e) {
+        if (requests.size() == 1) {
+          // only throw exception if 1 request.
+          // there will be > 1 request in case of OR predicate
+          throw e;
+        }
+      }
+    }
+
+    return response;
+
+  }
+
+  private Set<StackVersionResponse> getStackVersions(StackVersionRequest request) throws AmbariException {
+    Set<StackVersionResponse> response = null;
+
+    String stackName = request.getStackName();
+    String stackVersion = request.getStackVersion();
+    
+    if (stackVersion != null) {
+      StackInfo stackInfo = this.ambariMetaInfo.getStackInfo(stackName, stackVersion);
+      response = Collections.singleton(stackInfo.convertToResponse());
+    } else {
+      Set<StackInfo> stackInfos = this.ambariMetaInfo.getStackInfos(stackName);
+      response = new HashSet<StackVersionResponse>();
+      for (StackInfo stackInfo: stackInfos) {
+        response.add(stackInfo.convertToResponse()); 
+      }
+    }
+
+    return response;
+  }
+
+  @Override
+  public Set<StackServiceResponse> getStackServices(
+      Set<StackServiceRequest> requests) throws AmbariException {
+
+    Set<StackServiceResponse> response = new HashSet<StackServiceResponse>();
+    
+    for (StackServiceRequest request : requests) {
+      try {
+        response.addAll(getStackServices(request));
+      } catch (StackAccessException e) {
+        if (requests.size() == 1) {
+          // only throw exception if 1 request.
+          // there will be > 1 request in case of OR predicate
+          throw e;
+        }
+      }
+    }
+
+    return response;
+  }
+
+  private Set<StackServiceResponse> getStackServices(StackServiceRequest request) throws AmbariException {
+    Set<StackServiceResponse> response = null;
+
+    String stackName = request.getStackName();
+    String stackVersion = request.getStackVersion();
+    String serviceName = request.getServiceName();
+
+    if (serviceName != null) {
+      ServiceInfo service = this.ambariMetaInfo.getService(stackName, stackVersion, serviceName);
+      response = Collections.singleton(service.convertToResponse());
+    } else {
+      Map<String, ServiceInfo> services = this.ambariMetaInfo.getServices(stackName, stackVersion);
+      response = new HashSet<StackServiceResponse>();
+      for (ServiceInfo service : services.values()) {
+        response.add(service.convertToResponse());
+      }
+    }
+    return response;
+  }
+
+  @Override
+  public Set<StackConfigurationResponse> getStackConfigurations(
+      Set<StackConfigurationRequest> requests) throws AmbariException {
+    Set<StackConfigurationResponse> response = new HashSet<StackConfigurationResponse>();
+    for (StackConfigurationRequest request : requests) {
+      response.addAll(getStackConfigurations(request));
+    }
+
+    return response;
+  }
+
+  private Set<StackConfigurationResponse> getStackConfigurations(
+      StackConfigurationRequest request) throws AmbariException {
+    
+    Set<StackConfigurationResponse> response = null;
+    
+    String stackName = request.getStackName();
+    String stackVersion = request.getStackVersion();
+    String serviceName = request.getServiceName();
+    String propertyName = request.getPropertyName();
+    
+    if (propertyName != null) {
+      PropertyInfo property = this.ambariMetaInfo.getProperty(stackName, stackVersion, serviceName, propertyName);
+      response = Collections.singleton(property.convertToResponse());
+    } else {
+      
+      Set<PropertyInfo> properties = this.ambariMetaInfo.getProperties(stackName, stackVersion, serviceName);
+      response = new HashSet<StackConfigurationResponse>();
+ 
+      for (PropertyInfo property: properties) {
+        response.add(property.convertToResponse());  
+      }
+    }
+
+    return response;
+  }
+
+  @Override
+  public Set<StackServiceComponentResponse> getStackComponents(
+      Set<StackServiceComponentRequest> requests) throws AmbariException {
+    Set<StackServiceComponentResponse> response = new HashSet<StackServiceComponentResponse>();
+    for (StackServiceComponentRequest request : requests) {
+      try {
+        response.addAll(getStackComponents(request));
+      } catch (StackAccessException e) {
+        if (requests.size() == 1) {
+          // only throw exception if 1 request.
+          // there will be > 1 request in case of OR predicate
+          throw e;
+        }
+      }
+    }
+
+    return response;
+  }
+
+  private Set<StackServiceComponentResponse> getStackComponents(
+      StackServiceComponentRequest request) throws AmbariException {
+    Set<StackServiceComponentResponse> response = null;
+
+    String stackName = request.getStackName();
+    String stackVersion = request.getStackVersion();
+    String serviceName = request.getServiceName();
+    String componentName = request.getComponentName();
+    
+    
+    if (componentName != null) {
+      ComponentInfo component = this.ambariMetaInfo.getComponent(stackName, stackVersion, serviceName, componentName);
+      response = Collections.singleton(component.convertToResponse());
+      
+    } else {
+      List<ComponentInfo> components = this.ambariMetaInfo.getComponentsByService(stackName, stackVersion, serviceName);
+      response = new HashSet<StackServiceComponentResponse>();
+      
+      for (ComponentInfo component: components) {
+        response.add(component.convertToResponse());
+      }
+    }
+    return response;
+  }
+
+  @Override
+  public Set<OperatingSystemResponse> getStackOperatingSystems(
+      Set<OperatingSystemRequest> requests) throws AmbariException {
+    Set<OperatingSystemResponse> response = new HashSet<OperatingSystemResponse>();
+    for (OperatingSystemRequest request : requests) {
+      try {
+        response.addAll(getStackOperatingSystems(request));
+      } catch (StackAccessException e) {
+        if (requests.size() == 1) {
+          // only throw exception if 1 request.
+          // there will be > 1 request in case of OR predicate
+          throw e;
+        }
+      }
+    }
+    return response;
+  }
+
+  private Set<OperatingSystemResponse> getStackOperatingSystems(
+      OperatingSystemRequest request) throws AmbariException {
+    
+    Set<OperatingSystemResponse> response = null;
+
+    String stackName = request.getStackName();
+    String stackVersion = request.getStackVersion();
+    String osType = request.getOsType();
+    
+    if (osType != null) {
+      OperatingSystemInfo operatingSystem = this.ambariMetaInfo.getOperatingSystem(stackName, stackVersion, osType);
+      response = Collections.singleton(operatingSystem.convertToResponse());
+    } else {
+      Set<OperatingSystemInfo> operatingSystems = this.ambariMetaInfo.getOperatingSystems(stackName, stackVersion);
+      response = new HashSet<OperatingSystemResponse>();
+      for (OperatingSystemInfo operatingSystem : operatingSystems)
+        response.add(operatingSystem.convertToResponse());
+    }
+
+    return response;
+  }
 }

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemRequest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemRequest.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemRequest.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemRequest.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,40 @@
+/**
+ * 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.controller;
+
+public class OperatingSystemRequest extends StackVersionRequest {
+
+  private String osType;
+
+  public OperatingSystemRequest(String stackName, String stackVersion,
+      String osType) {
+    super(stackName, stackVersion);
+    setOsType(osType);
+  }
+
+  public String getOsType() {
+    return osType;
+  }
+
+  public void setOsType(String osType) {
+    this.osType = osType;
+  }
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemResponse.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemResponse.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemResponse.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/OperatingSystemResponse.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,38 @@
+/**
+ * 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.controller;
+
+public class OperatingSystemResponse {
+  
+  private String osType;
+
+  public OperatingSystemResponse(String osType) {
+    setOsType(osType);
+  }
+
+  public String getOsType() {
+    return osType;
+  }
+
+  public void setOsType(String osType) {
+    this.osType = osType;
+  }
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryRequest.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,40 @@
+/**
+ * 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.controller;
+
+public class RepositoryRequest extends OperatingSystemRequest{
+
+  public RepositoryRequest(String stackName, String stackVersion, String osType, String repoId) {
+    super(stackName, stackVersion, osType);
+    setRepoId(repoId);
+  }
+
+  
+  public String getRepoId() {
+    return repoId;
+  }
+
+
+  public void setRepoId(String repoId) {
+    this.repoId = repoId;
+  }
+
+  private String repoId;
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/RepositoryResponse.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,90 @@
+/**
+ * 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.controller;
+
+public class RepositoryResponse {
+  
+  private String baseUrl;
+  private String osType;
+  private String repoId;
+  private String repoName;
+  private String mirrorsList;
+  
+  
+  public RepositoryResponse(String baseUrl, String osType, String repoId, String repoName, String mirrorsList) {
+    setBaseUrl(baseUrl);
+    setOsType(osType);
+    setRepoId(repoId);
+    setRepoName(repoName);
+    setMirrorsList(mirrorsList);
+  }
+
+
+  public String getBaseUrl() {
+    return baseUrl;
+  }
+
+
+  public void setBaseUrl(String baseUrl) {
+    this.baseUrl = baseUrl;
+  }
+
+
+  public String getOsType() {
+    return osType;
+  }
+
+
+  public void setOsType(String osType) {
+    this.osType = osType;
+  }
+
+
+  public String getRepoId() {
+    return repoId;
+  }
+
+
+  public void setRepoId(String repoId) {
+    this.repoId = repoId;
+  }
+
+
+  public String getRepoName() {
+    return repoName;
+  }
+
+
+  public void setRepoName(String repoName) {
+    this.repoName = repoName;
+  }
+
+
+  public String getMirrorsList() {
+    return mirrorsList;
+  }
+
+
+  public void setMirrorsList(String mirrorsList) {
+    this.mirrorsList = mirrorsList;
+  }
+
+
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationRequest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationRequest.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationRequest.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationRequest.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,43 @@
+/**
+ * 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.controller;
+
+
+public class StackConfigurationRequest extends StackServiceRequest {
+  
+  private String propertyName;
+
+  public StackConfigurationRequest(String stackName, String stackVersion,
+      String serviceName, String propertyName) {
+    super(stackName, stackVersion, serviceName);
+    
+    setPropertyName(propertyName);
+
+  }
+
+  public String getPropertyName() {
+    return propertyName;
+  }
+
+  public void setPropertyName(String propertyName) {
+    this.propertyName = propertyName;
+  }
+
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,68 @@
+/**
+ * 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.controller;
+
+
+public class StackConfigurationResponse {
+
+  
+  public StackConfigurationResponse(String propertyName, String propertyValue, String propertyDescription, String fileName) {
+    setPropertyName(propertyName);
+    setPropertyValue(propertyValue);
+    setPropertyDescription(propertyDescription);
+    setFileName(fileName);
+  }
+  
+  private String propertyName;
+  private String propertyValue;
+  private String propertyDescription;
+  private String fileName;
+
+  public String getPropertyName() {
+    return propertyName;
+  }
+
+  public void setPropertyName(String propertyName) {
+    this.propertyName = propertyName;
+  }
+
+  public String getPropertyValue() {
+    return propertyValue;
+  }
+
+  public void setPropertyValue(String propertyValue) {
+    this.propertyValue = propertyValue;
+  }
+
+  public String getPropertyDescription() {
+    return propertyDescription;
+  }
+
+  public void setPropertyDescription(String propertyDescription) {
+    this.propertyDescription = propertyDescription;
+  }
+
+  public String getFileName() {
+    return fileName;
+  }
+
+  public void setFileName(String fileName) {
+    this.fileName = fileName;
+  }
+}

Added: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackRequest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackRequest.java?rev=1452457&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackRequest.java (added)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/StackRequest.java Mon Mar  4 19:16:28 2013
@@ -0,0 +1,38 @@
+/**
+ * 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.controller;
+
+public class StackRequest {
+
+  public StackRequest(String stackName) {
+    this.setStackName(stackName);
+
+  }
+
+  public String getStackName() {
+    return stackName;
+  }
+
+  public void setStackName(String stackName) {
+    this.stackName = stackName;
+  }
+
+  private String stackName;
+
+}



Mime
View raw message