You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by om...@apache.org on 2011/09/22 18:14:02 UTC

svn commit: r1174242 [3/9] - in /incubator/ambari/trunk: ./ agent/ agent/bin/ agent/conf/ agent/src/ agent/src/main/ agent/src/main/python/ agent/src/main/python/ambari_agent/ agent/src/main/python/ambari_torrent/ agent/src/main/python/ambari_torrent/h...

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Clusters.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Clusters.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Clusters.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Clusters.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,490 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+public class Clusters {
+
+	/*
+	 * Operational clusters include both active and inactive clusters
+	 */
+    protected ConcurrentHashMap<String, ClusterDefinition> operational_clusters = new ConcurrentHashMap<String, ClusterDefinition>();
+    
+    /* 
+     * Attic clusters are just definitions left around. When cluster is retired i.e. all its nodes 
+     * are released then the cluster entry is transferred to attic and deleted from active 
+     * clusters list.
+     * Cluster in attic list should be submitted as new cluster, if needs to be reactivated. 
+     */
+    protected ConcurrentHashMap<String, ClusterDefinition> attic_clusters = new ConcurrentHashMap<String, ClusterDefinition>();
+    
+    private static Clusters ClustersTypeRef=null;
+	
+    private Clusters() {}
+    
+    public static synchronized Clusters getInstance() {
+    	if(ClustersTypeRef == null) {
+    		ClustersTypeRef = new Clusters();
+    	}
+    	return ClustersTypeRef;
+    }
+
+    public Object clone() throws CloneNotSupportedException {
+    	throw new CloneNotSupportedException();
+    }
+
+
+    /* 
+     * Add new Cluster to cluster list 
+     * Validate the cluster definition
+     * Lock the cluster list
+     *   -- Check if cluster with given name already exits?
+     *   -- Set the cluster state and timestamps 
+     *   -- Reserve the nodes. i.e. add the cluster and role referenes to Node
+     *   -- Throw exception, if some nodes are already preallocated to other cluster.
+     *   -- Persist the cluster definition as revision 0 and list of node names against cluster & service:role 
+     *   -- Background daemon should trigger the agent installation on the new nodes (UNREGISTERED), if not done already. 
+     *      (daemon can keep track of which nodes agent is already installed or check it by ssh to nodes, if nodes added
+     *       are in UNREGISTERED state).  
+     */   
+    public ClusterDefinition addCluster(ClusterDefinition c) throws Exception {
+    	/*
+    	 * TODO: Validate the cluster definition
+    	 */
+    	if (c.getName() == null ||  c.getName().equals("")) {
+    		Exception e = new Exception("Cluster Name must be specified and must be non-empty string");
+    		throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
+    	}
+    	
+    	synchronized (operational_clusters) {
+    		/* 
+    		 * Check if cluster already exists
+    		 */
+    		if (operational_clusters.containsKey(c.getName())) {
+    			Exception e = new Exception("Cluster ["+c.getName()+"] already exists");
+    			throw new WebApplicationException(e, Response.Status.CONFLICT);
+    		}
+    		
+    		/*
+    		 * Add new cluster to cluster list
+    		 */
+    		Date requestTime = new Date();
+    		Cluster cls = new Cluster();
+    		ClusterState clsState = new ClusterState();
+    		clsState.setCreationTime(requestTime);
+    		clsState.setLastUpdateTime(requestTime);
+    		clsState.setDeployTime((Date)null);
+    		clsState.setRepresentativeState(ClusterState.CLUSTER_STATE_INACTIVE);
+    		
+    		cls.setID(UUID.randomUUID().toString());
+    		cls.setClusterDefinition(c);
+    		cls.setClusterState(clsState);
+    		
+			/*
+			 * Update cluster nodes reservation.
+			 * TODO: REST API should allow roleToNodesMap separately based on the node attributes 
+			 */
+			if (c.getNodeRangeExpressions() != null) {
+				updateClusterNodesReservation (cls, c.getNodeRangeExpressions());
+			}
+			
+			/*
+			 * Update the Node to Roles association if specified
+			 */
+			if (c.getRoleToNodesMap() != null) {
+				updateNodeToRolesAssociation(c.getName(), c.getRoleToNodesMap());
+			}
+			
+    		/*
+    		 * TODO: Persist the cluster definition to data store as a initial version r0. 
+    		 * 		 Persist reserved nodes against the cluster & service/role
+    		 */
+    			
+    		// Add the cluster to list, when definition is persisted
+    		operational_clusters.put(c.getName(), c);
+    	}
+    	return null;
+    } 
+    
+    
+    /*
+     * Update the nodes associated with cluster
+     */
+    private synchronized void updateClusterNodesReservation (Cluster cls, List<String> nodeRangeExpressions) throws Exception {
+    	
+    	/*
+		 * Reserve the nodes as specified in the node range expressions
+		 * -- throw exception if any nodes are pre-associated with other cluster
+		 */
+    	ConcurrentHashMap<String, Node> all_nodes = Nodes.getInstance().getNodes();
+    	List<String> specified_node_range = new ArrayList<String>();
+    	for (String nodeRangeExpression : nodeRangeExpressions) {
+    		specified_node_range.addAll(getHostnamesFromRangeExpression(nodeRangeExpression));
+    	}
+    	List<String> nodes_currently_allocated = new ArrayList<String>();
+    	for (Node n : Nodes.getInstance().getNodes().values()) {
+    		if (n.getNodeState().getClusterName().equals(cls.getClusterDefinition().getName())) {
+    			nodes_currently_allocated.add(n.getName());
+    		}
+    	}
+    	
+    	List<String> nodes_to_allocate = new ArrayList<String>(specified_node_range);
+    	nodes_to_allocate.removeAll(nodes_currently_allocated);
+    	List<String> nodes_to_deallocate = new ArrayList<String>(nodes_currently_allocated);
+    	nodes_to_deallocate.removeAll(specified_node_range);
+    	
+		/*
+		 * Check for any nodes that are allocated to other cluster
+		 */
+    	List<String> preallocatedhosts = new ArrayList<String>();
+    	for (String n : nodes_to_allocate) {
+    		if (all_nodes.containsKey(n) && all_nodes.get(n).getNodeState().getClusterName() != null) {
+    			preallocatedhosts.add(n);
+    		}
+    	}
+    	
+    	/* 
+		 * Throw exception, if some of the hosts are already allocated to other cluster
+		 */
+		if (!preallocatedhosts.isEmpty()) {
+			/*
+			 * TODO: Return invalid request code and return list of preallocated nodes as a part of
+			 *       response element
+			 */
+			Exception e = new Exception("Some of the nodes specified for the cluster roles are allocated to other cluster: ["+preallocatedhosts+"]");
+    		throw new WebApplicationException(e, Response.Status.CONFLICT);
+		}
+		
+		/*
+		 * Allocate nodes to given cluster
+		 */
+		for (String node_name : nodes_to_allocate) {
+			if (all_nodes.containsKey(node_name)) { 
+				synchronized (all_nodes.get(node_name)) {
+					all_nodes.get(node_name).getNodeState().setClusterName(cls.getClusterDefinition().getName());
+				}
+			} else {
+				Node node = new Node(node_name);
+				node.reserveNodeForCluster(cls.getClusterDefinition().getName(), true);
+				Nodes.getInstance().getNodes().put(node_name, node);
+			}
+		}
+		
+		/*
+		 * deallocate nodes from a given cluster
+		 * TODO: Node agent would check its been deallocated from the cluster and then shutdown any role/servers running it
+		 *       then update the deployment state to be FREE 
+		 */
+		for (String node_name : nodes_to_deallocate) {
+			if (all_nodes.containsKey(node_name)) {
+				synchronized (all_nodes.get(node_name)) {
+					all_nodes.get(node_name).releaseNodeFromCluster();
+				}
+			}
+		}
+		
+    }
+    
+	private synchronized void updateNodeToRolesAssociation (String clusterName, RoleToNodesMap roleToNodesMap) throws Exception {
+		/*
+		 * Associate roles with node
+		 */
+		if (roleToNodesMap != null) {
+			/*
+			 * Generate node to roles hash map 
+			 
+			HashMap<String, List<String>> nodeToRolesHashMap = new HashMap<String, List<String>>();
+			for (RoleToNodesMapEntryType e : roleToNodesMap.getRoleToNodesMapEntry()) {
+				List<String> hosts = getHostnamesFromRangeExpression(e.getNodeRangeExpression());
+				for (String host : hosts) {
+					if (!nodeToRolesHashMap.containsKey(host)) {
+						List<String> x = new ArrayList<String>();
+						x.add(e.getServiceName()+":"+e.getRoleName());
+						nodeToRolesHashMap.put(host, x);
+					} else {
+						nodeToRolesHashMap.get(host).add(e.getServiceName()+":"+e.getRoleName());
+					}
+				}
+			} */
+				
+			/*
+			 * Replace the roles list in for each node
+			 
+			HashMap<String, NodeType> all_nodes = NodesType.getInstance().getNodes();
+			for (String host : nodeToRolesHashMap.keySet()) {
+				if (all_nodes.containsKey(host) && all_nodes.get(host).getClusterName().equals(clusterName)) { 
+					synchronized (all_nodes.get(host)) {
+						all_nodes.get(host).setNodeRoles(nodeToRolesHashMap.get(host));
+					}
+				}
+			} */
+		}
+	}
+    
+    /*
+     * TODO: Implement proper range expression
+     */
+    public List<String> getHostnamesFromRangeExpression (String nodeRangeExpression) throws Exception {
+  
+    	List<String> list = new ArrayList<String>();
+    	StringTokenizer st = new StringTokenizer(nodeRangeExpression);
+    	while (st.hasMoreTokens()) {
+    		list.add(st.nextToken());
+    	}
+    	return list;
+    }
+    
+    /* 
+     * Update cluster 
+    */
+    public void updateCluster(String clusterName, ClusterDefinition c) throws Exception {
+    	/*
+    	 * Update the cluster definition. 
+    	 * Always latest version of cluster definition is kept in memory 
+    	 * Revisions for cluster definition is mainly need for agents to know
+    	 * that something is changed in cluster definition?
+    	 * TODO: 
+    	 * 		Make update atomic? i.e. persist the new revision first and then update the 
+    	 * 		definition in memory? make sure get cluster does not get partial definition.. 
+    	 */
+    	int i;
+    	ClusterDefinition cls = null;
+    	for (i=0; i<operational_clusters.size(); i++) {
+    		if (operational_clusters.get(i).equals(clusterName)) {
+    			cls = operational_clusters.get(i);
+    			break;
+    		}
+    	}
+    	
+    	// Throw exception if cluster is not found
+    	if (i == operational_clusters.size()) {
+    		throw new Exception("Specified cluster ["+clusterName+"] does not exists");
+    	}
+    	
+    	synchronized (cls) {
+    		if (c.getDescription() != null) cls.setDescription(c.getDescription());
+    		// Update the last update time
+    		//cls.setLastUpdateTime(new Date());
+    		//cls.setRevision(cls.getRevision()+1);
+    		/*
+    		 * TODO: Persist the latest cluster definition under new revision
+    		*/
+    	}
+    	return;
+    }
+    
+    /*
+     * Update role to Nodes Map
+    
+    private void updateClusterRoleToNodesMap (RoleToNodesMapType s, RoleToNodesMapType t) throws Exception {
+    	for (RoleToNodesMapEntryType se : s.getRoleToNodesMapEntry()) {
+    		for (RoleToNodesMapEntryType te : t.getRoleToNodesMapEntry()) {
+    			if (se.getServiceName().equals(te.getServiceName()) && se.getRoleName().equals(te.getRoleName())) {
+    				te.setNodeRangeExpression(se.getNodeRangeExpression());
+    			} else {
+    				t.getRoleToNodesMapEntry().add(se);
+    			}
+    		}
+    	}
+    } */
+    
+    /*
+     * Delete ClusterType from the list
+     * Delete operation will only remove the entry from the controller 
+     * Cluster must be in ATTIC state to be deleted from controller
+     
+    public void deleteCluster(ClusterType c) throws Exception { 
+    	synchronized (operational_clusters) {
+    		for (int i=0;i<operational_clusters.size();i++) {
+    			if (operational_clusters.get(i).getName().equals(c.getName())) {
+    				synchronized (operational_clusters.get(i)) {
+    					if (operational_clusters.get(i).getCurrentState().equals(ClusterState.CLUSTER_STATE_ATTIC)) {
+    						// TODO: remove the persistent entry from data store
+    						
+    						 // Remove the entry from the in-memory clsuter list
+    						 
+    						operational_clusters.remove(i);
+    					} else {
+    						throw new Exception ("Cluster ["+operational_clusters.get(i).getName()+"] not in ATTIC state");
+    					}
+    				}
+    			}
+    		} 
+    	}
+    	return;
+    } */  
+    
+    
+    /*
+     * Get Cluster definition snapshot (whenever it is to be serialized over wire)
+     * TODO: CHECK_IT
+     
+    public ClusterType getClusterSnapshot(String clusterName) throws Exception {
+    	for (ClusterType cls : operational_clusters) {
+    		ClusterType cls1 = null;
+			if (cls.getName().equals(clusterName)) {
+				synchronized (cls) {
+					//cls1 = cls.clone();
+				}
+			}
+			return cls1;
+		}
+    	throw new Exception ("Cluster:["+clusterName+"] does not exists");
+    } */
+    
+    /* 
+     * Get the cluster definition 
+    */
+    public ClusterDefinition getCluster(String clusterName) throws Exception {
+    	/*for (ClusterDefinition cls : operational_clusters) {
+			if (cls.getName().equals(clusterName)) {
+				return cls;
+			}
+		}*/
+    	throw new Exception ("Cluster:["+clusterName+"] does not exists");
+    }
+    
+    /*
+     * Get the list of deployed clusters
+     * TODO: return the synchronized snapshot of the deployed cluster list
+     */
+    public List<ClusterDefinition> getDeployedClusterList(String type) {
+    	List<ClusterDefinition> list = new ArrayList<ClusterDefinition>();
+    	if (type.equals("ALL")) {
+    		//list.addAll(this.operational_clusters);
+    		return list;
+    	} else {
+    		//for (ClusterDefinition cls : operational_clusters) {
+    			//if (cls.gcurrentState.equals(type)) {
+    			//	list.add(cls);
+    			//}
+    		//}
+    	}
+        return list;
+    } 
+    
+    /*
+     * Get the list of retired cluster definitions
+     * TODO: return synchronized snapshot of the retired cluster list
+     */
+    public List<ClusterDefinition> getRetiredClusterList() {
+    	List<ClusterDefinition> list = new ArrayList<ClusterDefinition>();
+    	//list.addAll(this.attic_clusters);
+        return list;
+    }
+    
+    /*
+     * Get the list of clusters
+     * TODO: Get the synchronized snapshot of each cluster definition? 
+     
+    public List<ClusterType> getClusterList(String type) {
+    	List<ClusterType> list = new ArrayList<ClusterType>();
+    	if (type.equals("ALL")) {
+    		list.addAll(getRetiredClusterList());
+    		list.addAll(getDeployedClusterList("ALL"));
+    	} else if (type.equals("ATTIC")) {
+    		list.addAll(getRetiredClusterList());
+    	} else {
+    		for (ClusterType cls : operational_clusters ) {
+    			if (cls.currentState.equals(type)) {
+    				list.add(cls);
+    			}
+    		}
+    	}
+    	return list;
+    } */
+    
+    /*
+     * Change the cluster goal state
+     * TODO: Change the argument goalState from string to enum
+     * TODO: Use state machine to trigger the state change events  
+     */
+    public void changeClusterGoalState (String clusterName, String goalState, Date requestTime) throws Exception {
+    	int i;
+    	ClusterDefinition cls = null;
+    	for (i=0; i<operational_clusters.size(); i++) {
+    		if (operational_clusters.get(i).equals(clusterName)) {
+    			cls = operational_clusters.get(i);
+    			break;
+    		}
+    	}
+    	
+    	// Throw exception if cluster is not found
+    	if (i == operational_clusters.size()) {
+    		throw new Exception("Specified cluster ["+clusterName+"] does not exists");
+    	}
+    	
+    	synchronized (cls) {
+    		// Set the goal state
+    		//cls.setLastRequestedGoalState(goalState);
+			//cls.setTimeOflastRequestedGoalState(requestTime);
+    		
+    		/*
+    		 * TODO: Persist the latest cluster definition under new revision
+    		*/
+    	}
+    	
+    	/*
+    	 * send state change event to cluster state machine 
+    	 */
+    	//changeClusterState(this.getName());
+    }
+    
+    /*
+     * Cluster state change event Handler
+     * 
+	 * TODO: 
+	 * 		 -- Make sure cluster definition is complete else throw exception 
+	 * 			-- Check all ClusterType fields have valid values
+	 * 			-- Check if roles have required number of nodes associated with it.
+	 * 		 -- Add the nodes to NodesType list w/ name, cluster name, deployment state etc.
+	 * 		 -- Trigger agent installation on the nodes, if not already done 
+	 * 
+	 * 		 -- Once agent is installed it should register itself w/ controller, get the 
+	 * 			associated latest cluster definition and deploy the stack. If goal state is active
+	 * 			it should get the associated services up. Once sync-ed, it should
+	 * 			update its state w/ controller through heartbeat.
+	 * 
+	 *   	-- Once required number of service nodes are up cluster state should be changed accordingly
+	*/
+    public void stateChangeEventHandler (String currentState, String goalState) {
+    	synchronized(this) {
+    		/*
+    		 * ATTIC to ACTIVE or INACTIVE
+    		 */
+			if (currentState.equals(ClusterState.CLUSTER_STATE_ATTIC) && goalState.equals(ClusterState.CLUSTER_STATE_ACTIVE)) {
+				
+			}
+    	}
+    }
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Component.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Component.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Component.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Component.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,88 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CategoryType complex type.
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CategoryType", propOrder = {
+    "name",
+    "property"
+})
+public class Component {
+
+    @XmlElement(name = "Name", required = true)
+    protected String name;
+    @XmlElement(name = "Property", required = true)
+    protected List<Property> property;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the property property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the property property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getProperty().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Property }
+     * 
+     * 
+     */
+    public List<Property> getProperty() {
+        if (property == null) {
+            property = new ArrayList<Property>();
+        }
+        return this.property;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ConfigPropertiesCategory.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ConfigPropertiesCategory.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ConfigPropertiesCategory.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ConfigPropertiesCategory.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,88 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for CategoryType complex type.
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "CategoryType", propOrder = {
+    "name",
+    "property"
+})
+public class ConfigPropertiesCategory {
+
+    @XmlElement(name = "Name", required = true)
+    protected String name;
+    @XmlElement(name = "Property", required = true)
+    protected List<Property> property;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the property property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the property property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getProperty().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Property }
+     * 
+     * 
+     */
+    public List<Property> getProperty() {
+        if (property == null) {
+            property = new ArrayList<Property>();
+        }
+        return this.property;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Configuration.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Configuration.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Configuration.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,61 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ConfigurationType complex type.
+ *  
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ConfigurationType", propOrder = {
+    "category"
+})
+public class Configuration {
+
+    @XmlElement(name = "Category", required = true)
+    protected List<ConfigPropertiesCategory> category;
+
+    /**
+     * Gets the value of the category property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the category property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getCategory().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ConfigPropertiesCategory }
+     * 
+     * 
+     */
+    public List<ConfigPropertiesCategory> getCategory() {
+        if (category == null) {
+            category = new ArrayList<ConfigPropertiesCategory>();
+        }
+        return this.category;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/DiagnosticLog.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/DiagnosticLog.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/DiagnosticLog.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/DiagnosticLog.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,63 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for DiagnosticLogType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class. 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "DiagnosticLogType", propOrder = {
+    "line"
+})
+public class DiagnosticLog {
+
+    @XmlElement(required = true)
+    protected List<String> line;
+
+    /**
+     * Gets the value of the line property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the line property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getLine().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * 
+     * 
+     */
+    public List<String> getLine() {
+        if (line == null) {
+            line = new ArrayList<String>();
+        }
+        return this.line;
+    }
+
+}
\ No newline at end of file

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Node.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Node.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Node.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Node.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,115 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+/**
+ * <p>Java class for NodeType complex type.
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "NodeType", propOrder = {
+    "name",
+    "nodeAttributes",
+    "nodeState",
+    "agentDeploymentState"
+})
+public class Node {
+    
+    @XmlElement(name = "Name", required = true)
+    protected String name;
+    @XmlElement(name = "NodeAttributes", required = true)
+    protected NodeAttributes nodeAttributes;
+    @XmlElement(name = "NodeState", required = true)
+    protected NodeState nodeState;
+   
+	public Node () {}
+
+	public Node (String name) {
+		this.name = name;
+	}
+	
+	/*
+	 * 
+	 */
+	public void releaseNodeFromCluster() {
+		this.nodeState.setClusterName(null);
+		this.getNodeState().setNodeServers(null);
+	}
+	
+	/*
+	 * Reserving node for cluster is done by associating cluster name w/ node
+	 */
+	public void reserveNodeForCluster (String clusterName, Boolean agentInstalled) {
+		this.getNodeState().setClusterName(clusterName);
+		this.getNodeState().setAgentInstalled(agentInstalled);
+	}
+	
+	/*
+	 * 
+	 */
+	public List<String> getAssociatedRoleNames() throws Exception {
+		List<String> list = new ArrayList<String>();
+		if (this.getNodeState().getClusterName() != null) {
+			for (RoleToNodesMapEntry rnme : Clusters.getInstance().getCluster(this.getNodeState().getClusterName()).getRoleToNodesMap().getRoleToNodesMapEntry()) {
+				list.add(rnme.getRoleName());
+			}
+		}
+		return list;
+	}
+	
+    /**
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+	/**
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	/**
+	 * @return the nodeMetrics
+	 */
+	public NodeAttributes getNodeAttributes() {
+		return nodeAttributes;
+	}
+	/**
+	 * @param nodeMetrics the nodeMetrics to set
+	 */
+	public void setNodeAttributes(NodeAttributes nodeAttributes) {
+		this.nodeAttributes = nodeAttributes;
+	}
+	/**
+	 * @return the nodeState
+	 */
+	public NodeState getNodeState() {
+		return nodeState;
+	}
+	
+	/**
+	 * @param nodeState the nodeState to set
+	 */
+	public void setNodeState(NodeState nodeState) {
+		this.nodeState = nodeState;
+	}
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeAttributes.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeAttributes.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeAttributes.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeAttributes.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,149 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for NodeMetricsType complex type. 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "NodeMetricsType", propOrder = {
+    "cpuType",
+    "cpuUnits",
+    "cpuCores",
+    "ramInGB",
+    "diskSizeInGB",
+    "diskUnits"
+})
+public class NodeAttributes {
+
+    @XmlElement(name = "CPU_Type", required = true)
+    protected String cpuType;
+    @XmlElement(name = "CPU_Units")
+    protected short cpuUnits;
+    @XmlElement(name = "CPU_Cores")
+    protected short cpuCores;
+    @XmlElement(name = "RAM_InGB")
+    protected long ramInGB;
+    @XmlElement(name = "DISK_SizeInGB")
+    protected long diskSizeInGB;
+    @XmlElement(name = "DISK_Units")
+    protected short diskUnits;
+
+    /**
+     * Gets the value of the cpuType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCPUType() {
+        return cpuType;
+    }
+
+    /**
+     * Sets the value of the cpuType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCPUType(String value) {
+        this.cpuType = value;
+    }
+
+    /**
+     * Gets the value of the cpuUnits property.
+     * 
+     */
+    public short getCPUUnits() {
+        return cpuUnits;
+    }
+
+    /**
+     * Sets the value of the cpuUnits property.
+     * 
+     */
+    public void setCPUUnits(short value) {
+        this.cpuUnits = value;
+    }
+
+    /**
+     * Gets the value of the cpuCores property.
+     * 
+     */
+    public short getCPUCores() {
+        return cpuCores;
+    }
+
+    /**
+     * Sets the value of the cpuCores property.
+     * 
+     */
+    public void setCPUCores(short value) {
+        this.cpuCores = value;
+    }
+
+    /**
+     * Gets the value of the ramInGB property.
+     * 
+     */
+    public long getRAMInGB() {
+        return ramInGB;
+    }
+
+    /**
+     * Sets the value of the ramInGB property.
+     * 
+     */
+    public void setRAMInGB(long value) {
+        this.ramInGB = value;
+    }
+
+    /**
+     * Gets the value of the diskSizeInGB property.
+     * 
+     */
+    public long getDISKSizeInGB() {
+        return diskSizeInGB;
+    }
+
+    /**
+     * Sets the value of the diskSizeInGB property.
+     * 
+     */
+    public void setDISKSizeInGB(long value) {
+        this.diskSizeInGB = value;
+    }
+
+    /**
+     * Gets the value of the diskUnits property.
+     * 
+     */
+    public short getDISKUnits() {
+        return diskUnits;
+    }
+
+    /**
+     * Sets the value of the diskUnits property.
+     * 
+     */
+    public void setDISKUnits(short value) {
+        this.diskUnits = value;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeServer.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeServer.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeServer.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeServer.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,100 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "NodeServer", propOrder = {
+    "name",
+	"state",
+	"lastStateUpdateTime"
+})
+public class NodeServer {
+
+	public static final String NODE_SERVER_STATE_UP = "UP";
+	public static final String NODE_SERVER_STATE_DOWN = "DOWN";
+	
+	/*
+	 * name should be component/service name : role name
+	 */
+	@XmlElement(name = "Name", required = true)
+	protected String name;
+	
+	@XmlElement(name = "State", required = true)
+	protected String state;  // UP/DOWN
+	
+	@XmlElement(name = "LastStateUpdateTime", required = true)
+    @XmlSchemaType(name = "dateTime")
+    protected XMLGregorianCalendar lastStateUpdateTime;
+	
+	/**
+	 * @return the name
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the state
+	 */
+	public String getState() {
+		return state;
+	}
+
+	/**
+	 * @param state the state to set
+	 */
+	public void setState(String state) {
+		this.state = state;
+	}
+
+
+	/**
+	 * @return the lastStateUpdateTime
+	 */
+	public XMLGregorianCalendar getLastStateUpdateTime() {
+		return lastStateUpdateTime;
+	}
+
+	/**
+	 * @param lastStateUpdateTime the lastStateUpdateTime to set
+	 */
+	public void setLastStateUpdateTime(XMLGregorianCalendar lastStateUpdateTime) {
+		this.lastStateUpdateTime = lastStateUpdateTime;
+	}
+
+	/**
+	 * @param creationTime the creationTime to set
+	 */
+	protected void setLastUpdateTime(Date lastStateUpdateTime) throws Exception {
+		GregorianCalendar cal = new GregorianCalendar();
+		cal.setTime(lastStateUpdateTime);
+		this.lastStateUpdateTime = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
+	}
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeState.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeState.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeState.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/NodeState.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "NodeState", propOrder = {
+    "lastHeartbeatTime",
+    "clusterName",
+    "allocatedToCluster",
+    "agentInstalled",
+	"nodeServers"
+})
+public class NodeState {
+
+	@XmlElement(name = "lastHeartbeatTime", required = true)
+    @XmlSchemaType(name = "dateTime")
+    protected XMLGregorianCalendar lastHeartbeatTime;
+	
+	/*
+     * Associating the cluster name would reserve the node for a given cluster
+     * 
+     */
+	@XmlElement(name = "ClusterName", required = true)
+    protected String clusterName;
+
+	/*
+	 * Actual allocation of the node in terms of having components installed on it is reflected 
+     * through this AllocatedToCluster boolean variable. This is updated through hearbeat message
+     * sent by Node.
+	 */
+	@XmlElement(name = "AllocatedToCluster", required = true)
+    protected Boolean allocatedToCluster = false;
+
+	@XmlElement(name = "AgentInstalled", required = true)
+    protected Boolean agentInstalled = true;
+	
+	@XmlElement(name = "NodeServers", required = true)
+    protected List<NodeServer> nodeServers = new ArrayList<NodeServer>();
+
+	/**
+	 * @return the allocatedToCluster
+	 */
+	public Boolean getAllocatedToCluster() {
+		return allocatedToCluster;
+	}
+
+	/**
+	 * @param allocatedToCluster the allocatedToCluster to set
+	 */
+	public void setAllocatedToCluster(Boolean allocatedToCluster) {
+		this.allocatedToCluster = allocatedToCluster;
+	}
+
+	/**
+	 * @return the agentInstalled
+	 */
+	public Boolean getAgentInstalled() {
+		return agentInstalled;
+	}
+
+	/**
+	 * @param agentInstalled the agentInstalled to set
+	 */
+	public void setAgentInstalled(Boolean agentInstalled) {
+		this.agentInstalled = agentInstalled;
+	}
+	
+	/**
+	 * @return the clusterName
+	 */
+	public String getClusterName() {
+		return clusterName;
+	}
+
+	/**
+	 * @param clusterName the clusterName to set
+	 */
+	public void setClusterName(String clusterName) {
+		this.clusterName = clusterName;
+	}
+	
+	/**
+	 * @return the lastHeartbeatTime
+	 */
+	public XMLGregorianCalendar getLastHeartbeatTime() {
+		return lastHeartbeatTime;
+	}
+
+	/**
+	 * @param lastHeartbeatTime the lastHeartbeatTime to set
+	 */
+	public void setLastHeartbeatTime(XMLGregorianCalendar lastHeartbeatTime) {
+		this.lastHeartbeatTime = lastHeartbeatTime;
+	}
+
+	/**
+	 * @return the nodeServers
+	 */
+	public List<NodeServer> getNodeServers() {
+		return nodeServers;
+	}
+
+	/**
+	 * @param nodeServers the nodeServers to set
+	 */
+	public void setNodeServers(List<NodeServer> nodeServers) {
+		this.nodeServers = nodeServers;
+	}
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Nodes.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Nodes.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Nodes.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Nodes.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,66 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+public class Nodes {
+	
+	public static final String AGENT_DEPLOYMENT_STATE_TOBE_INSTALLED = "AGENT_TOBE_INSTALLED";
+	public static final String AGENT_DEPLOYMENT_STATE_INSTALLED = "AGENT_INSTALLED";
+	
+	
+	public static final short NODE_HEARTBEAT_INTERVAL_IN_MINUTES = 5;
+	public static final short NODE_MAX_MISSING_HEARBEAT_INTERVALS = 3;
+	
+	// One node name to Node hashmap
+	protected ConcurrentHashMap<String, Node> nodes = new ConcurrentHashMap<String, Node>();
+	
+	// Cluster name to Node names hash map
+	protected ConcurrentHashMap<String, ConcurrentHashMap<String, String>> cluster_to_nodes = new ConcurrentHashMap<String, ConcurrentHashMap<String, String>>();
+	
+	private static Nodes NodesTypeRef=null;
+	
+	private Nodes() {}
+	    
+	public static synchronized Nodes getInstance() {
+		if(NodesTypeRef == null) {
+			NodesTypeRef = new Nodes();
+		}
+	    return NodesTypeRef;
+	}
+
+	public Object clone() throws CloneNotSupportedException {
+		throw new CloneNotSupportedException();
+	}
+	   
+	public ConcurrentHashMap<String, Node> getNodes () {
+		return nodes;
+	}
+	
+	public List<Node> getNodes (String clusterName, String roleName) {
+		
+		return null;
+	}
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ObjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ObjectFactory.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ObjectFactory.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/ObjectFactory.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,214 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.apache.hms.common.rest.entities package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _Clusters_QNAME = new QName("", "Clusters");
+    private final static QName _Nodes_QNAME = new QName("", "Nodes");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.hms.common.rest.entities
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link Node }
+     * 
+     */
+    public Node createNodeType() {
+        return new Node();
+    }
+
+    /**
+     * Create an instance of {@link User }
+     * 
+     */
+    public User createUserType() {
+        return new User();
+    }
+
+    /**
+     * Create an instance of {@link Roles }
+     * 
+     */
+    public Roles createRolesType() {
+        return new Roles();
+    }
+
+    /**
+     * Create an instance of {@link RoleToNodesMap }
+     * 
+     */
+    public RoleToNodesMap createRoleToNodesMapType() {
+        return new RoleToNodesMap();
+    }
+
+    /**
+     * Create an instance of {@link Role }
+     * 
+     */
+    public Role createRoleType() {
+        return new Role();
+    }
+
+    /**
+     * Create an instance of {@link Nodes }
+     * 
+     */
+    public Nodes createNodesType() {
+        return Nodes.getInstance();
+    }
+
+    /**
+     * Create an instance of {@link RoleToNodesMapEntry }
+     * 
+     */
+    public RoleToNodesMapEntry createRoleToNodesMapEntryType() {
+        return new RoleToNodesMapEntry();
+    }
+
+    /**
+     * Create an instance of {@link ConfigPropertiesCategory }
+     * 
+     */
+    public ConfigPropertiesCategory createCategoryType() {
+        return new ConfigPropertiesCategory();
+    }
+
+    /**
+     * Create an instance of {@link PackageRepository }
+     * 
+     */
+    public PackageRepository createPackageType() {
+        return new PackageRepository();
+    }
+
+    /**
+     * Create an instance of {@link NodeAttributes }
+     * 
+     */
+    public NodeAttributes createNodeMetricsType() {
+        return new NodeAttributes();
+    }
+
+    /**
+     * Create an instance of {@link ClusterDefinition }
+     * 
+     */
+    public ClusterDefinition createClusterType() {
+        return new ClusterDefinition();
+    }
+
+    /**
+     * Create an instance of {@link Clusters }
+     * 
+     */
+    public Clusters createClustersType() {
+        return Clusters.getInstance();
+    }
+
+    /**
+     * Create an instance of {@link Services }
+     * 
+     */
+    public Services createServicesType() {
+        return new Services();
+    }
+
+    /**
+     * Create an instance of {@link Blueprint }
+     * 
+     */
+    public Blueprint createBlueprintType() {
+        return new Blueprint();
+    }
+
+    /**
+     * Create an instance of {@link Property }
+     * 
+     */
+    public Property createPropertyType() {
+        return new Property();
+    }
+
+    /**
+     * Create an instance of {@link Configuration }
+     * 
+     */
+    public Configuration createConfigurationType() {
+        return new Configuration();
+    }
+
+    /**
+     * Create an instance of {@link Service }
+     * 
+     */
+    public Service createServiceType() {
+        return new Service();
+    }
+
+    /**
+     * Create an instance of {@link NodeState }
+     * 
+     */
+    public NodeState createNodeToRolesMapType() {
+        return new NodeState();
+    }
+
+    /**
+     * Create an instance of {@link DiagnosticLog }
+     * 
+     */
+    public DiagnosticLog createDiagnosticLogType() {
+        return new DiagnosticLog();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Clusters }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "", name = "Clusters")
+    public JAXBElement<Clusters> createClusters(Clusters value) {
+        return new JAXBElement<Clusters>(_Clusters_QNAME, Clusters.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Nodes }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "", name = "Nodes")
+    public JAXBElement<Nodes> createNodes(Nodes value) {
+        return new JAXBElement<Nodes>(_Nodes_QNAME, Nodes.class, null, value);
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/PackageRepository.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/PackageRepository.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/PackageRepository.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/PackageRepository.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PackageType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="PackageType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="LocationURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="Type" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PackageType", propOrder = {
+    "locationURL",
+    "type"
+})
+public class PackageRepository {
+
+    @XmlElement(name = "LocationURL", required = true)
+    protected String locationURL;
+    @XmlElement(name = "Type", required = true)
+    protected String type;
+
+    /**
+     * Gets the value of the locationURL property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getLocationURL() {
+        return locationURL;
+    }
+
+    /**
+     * Sets the value of the locationURL property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setLocationURL(String value) {
+        this.locationURL = value;
+    }
+
+    /**
+     * Gets the value of the type property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * Sets the value of the type property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setType(String value) {
+        this.type = value;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Property.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Property.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Property.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Property.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for PropertyType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="PropertyType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="final" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "PropertyType", propOrder = {
+    "name",
+    "value",
+    "_final"
+})
+public class Property {
+
+    @XmlElement(required = true)
+    protected String name;
+    @XmlElement(required = true)
+    protected String value;
+    @XmlElement(name = "final")
+    protected String _final;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the value property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value of the final property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getFinal() {
+        return _final;
+    }
+
+    /**
+     * Sets the value of the final property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setFinal(String value) {
+        this._final = value;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Response.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Response.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Response.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Response.java Thu Sep 22 16:13:55 2011
@@ -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.common.rest.entities;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Response {
+  @XmlElement(name="exit_code")
+  public int code;
+  @XmlElement
+  public String output;
+  @XmlElement
+  public String error;
+  
+  public int getCode() {
+    return code;
+  }
+  
+  public String getOutput() {
+    return output;
+  }
+  
+  public String getError() {
+    return error;
+  }
+  
+  public void setCode(int code) {
+    this.code = code;  
+  }
+  
+  public void setOutput(String output) {
+    this.output = output;
+  }
+  
+  public void setError(String error) {
+    this.error = error;
+  }
+  
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("exit code:");
+    sb.append(code);
+    sb.append("\nstdout:\n");
+    sb.append(output);
+    sb.append("\nstderr:\n");
+    sb.append(error);
+    sb.append("\n");
+    return sb.toString();
+  }
+}

Propchange: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Response.java
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Role.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Role.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Role.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Role.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RoleType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="RoleType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="Configuration" type="{}ConfigurationType"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RoleType", propOrder = {
+    "name",
+    "configuration"
+})
+public class Role {
+
+    @XmlElement(name = "Name", required = true)
+    protected String name;
+    @XmlElement(name = "Configuration", required = true)
+    protected Configuration configuration;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the configuration property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Configuration }
+     *     
+     */
+    public Configuration getConfiguration() {
+        return configuration;
+    }
+
+    /**
+     * Sets the value of the configuration property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Configuration }
+     *     
+     */
+    public void setConfiguration(Configuration value) {
+        this.configuration = value;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMap.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMap.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMap.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMap.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RoleToNodesMapType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="RoleToNodesMapType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="RoleToNodesMapEntry" type="{}RoleToNodesMapEntryType" maxOccurs="unbounded"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RoleToNodesMapType", propOrder = {
+    "roleToNodesMapEntry"
+})
+public class RoleToNodesMap {
+
+    @XmlElement(name = "RoleToNodesMapEntry", required = true)
+    protected List<RoleToNodesMapEntry> roleToNodesMapEntry;
+
+    /**
+     * Gets the value of the roleToNodesMapEntry property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the roleToNodesMapEntry property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getRoleToNodesMapEntry().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link RoleToNodesMapEntry }
+     * 
+     * 
+     */
+    public List<RoleToNodesMapEntry> getRoleToNodesMapEntry() {
+        if (roleToNodesMapEntry == null) {
+            roleToNodesMapEntry = new ArrayList<RoleToNodesMapEntry>();
+        }
+        return this.roleToNodesMapEntry;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMapEntry.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMapEntry.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMapEntry.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/RoleToNodesMapEntry.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,77 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RoleToNodesMapEntryType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="RoleToNodesMapEntryType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="ServiceName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="RoleName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="NodeRangeExpression" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RoleToNodesMapEntry", propOrder = {
+    "roleName",
+    "nodeRangeExpressions"
+})
+public class RoleToNodesMapEntry {
+
+    @XmlElement(name = "RoleName", required = true)
+    protected String roleName;
+    @XmlElement(name = "Nodes", required = true)
+    protected List<String> nodeRangeExpressions;
+    
+	/**
+	 * @return the roleName
+	 */
+	public String getRoleName() {
+		return roleName;
+	}
+	/**
+	 * @param roleName the roleName to set
+	 */
+	public void setRoleName(String roleName) {
+		this.roleName = roleName;
+	}
+	/**
+	 * @return the nodeRangeExpressions
+	 */
+	public List<String> getNodeRangeExpressions() {
+		return nodeRangeExpressions;
+	}
+	/**
+	 * @param nodeRangeExpressions the nodeRangeExpressions to set
+	 */
+	public void setNodeRangeExpressions(List<String> nodeRangeExpressions) {
+		this.nodeRangeExpressions = nodeRangeExpressions;
+	}
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Roles.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Roles.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Roles.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Roles.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for RolesType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="RolesType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Role" type="{}RoleType" maxOccurs="unbounded"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "RolesType", propOrder = {
+    "role"
+})
+public class Roles {
+
+    @XmlElement(name = "Role", required = true)
+    protected List<Role> role;
+
+    /**
+     * Gets the value of the role property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the role property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getRole().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Role }
+     * 
+     * 
+     */
+    public List<Role> getRole() {
+        if (role == null) {
+            role = new ArrayList<Role>();
+        }
+        return this.role;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Service.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Service.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Service.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Service.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,173 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ServiceType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="ServiceType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="IsEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         &lt;element name="Version" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="User" type="{}UserType"/>
+ *         &lt;element name="Roles" type="{}RolesType"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ServiceType", propOrder = {
+    "name",
+    "isEnabled",
+    "version",
+    "user",
+    "roles"
+})
+public class Service {
+
+    @XmlElement(name = "Name", required = true)
+    protected String name;
+    @XmlElement(name = "IsEnabled")
+    protected boolean isEnabled;
+    @XmlElement(name = "Version", required = true)
+    protected String version;
+    @XmlElement(name = "User", required = true)
+    protected User user;
+    @XmlElement(name = "Roles", required = true)
+    protected Roles roles;
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the value of the name property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setName(String value) {
+        this.name = value;
+    }
+
+    /**
+     * Gets the value of the isEnabled property.
+     * 
+     */
+    public boolean isIsEnabled() {
+        return isEnabled;
+    }
+
+    /**
+     * Sets the value of the isEnabled property.
+     * 
+     */
+    public void setIsEnabled(boolean value) {
+        this.isEnabled = value;
+    }
+
+    /**
+     * Gets the value of the version property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * Sets the value of the version property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setVersion(String value) {
+        this.version = value;
+    }
+
+    /**
+     * Gets the value of the user property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link User }
+     *     
+     */
+    public User getUser() {
+        return user;
+    }
+
+    /**
+     * Sets the value of the user property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link User }
+     *     
+     */
+    public void setUser(User value) {
+        this.user = value;
+    }
+
+    /**
+     * Gets the value of the roles property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Roles }
+     *     
+     */
+    public Roles getRoles() {
+        return roles;
+    }
+
+    /**
+     * Sets the value of the roles property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Roles }
+     *     
+     */
+    public void setRoles(Roles value) {
+        this.roles = value;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Services.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Services.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Services.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Services.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for ServicesType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="ServicesType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Service" type="{}ServiceType" maxOccurs="unbounded"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ServicesType", propOrder = {
+    "service"
+})
+public class Services {
+
+    @XmlElement(name = "Service", required = true)
+    protected List<Service> service;
+
+    /**
+     * Gets the value of the service property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the service property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getService().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Service }
+     * 
+     * 
+     */
+    public List<Service> getService() {
+        if (service == null) {
+            service = new ArrayList<Service>();
+        }
+        return this.service;
+    }
+
+}

Added: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Stack.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Stack.java?rev=1174242&view=auto
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Stack.java (added)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/Stack.java Thu Sep 22 16:13:55 2011
@@ -0,0 +1,150 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.08.30 at 04:53:46 PM PDT 
+//
+
+
+package org.apache.ambari.common.rest.entities;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for StackType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="StackType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="Description" type="{http://www.w3.org/2001/XMLSchema}string"/> 
+ *         &lt;element name="DefaultBluePrint" type="{}BlueprintType"/>
+ *         &lt;element name="Revision" type="{}String"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "StackType", propOrder = {
+    "name",
+    "description",
+    "locationURL"
+})
+@XmlRootElement(name = "Stack")
+public class Stack {
+	
+    @XmlElement(name = "Name", required = true)
+    protected String name;
+	@XmlElement(name = "Description", required = true)
+    protected String description;
+    @XmlElement(name = "LocationURL", required = true)
+    protected String locationURL;
+    
+    private HashMap<String, List<Blueprint>> blueprints = new HashMap<String, List<Blueprint>>();
+   
+    /*
+     * Get blueprint
+     */
+    public Blueprint getBlueprint(String blueprintName, int revision) throws Exception {
+    	if (!blueprints.containsKey(blueprintName) || revision < 0 || revision >= blueprints.get(blueprintName).size()
+    		|| blueprints.get(blueprintName).get(revision) == null) {
+    		throw new Exception ("Specified revision ["+revision+"] of ["+blueprintName+"] blueprint does not exists");
+    	}
+    	return blueprints.get(blueprintName).get(revision);  	
+    }
+    
+    
+    /*
+     * Add or update the blueprint
+     */
+    public void putBlueprint(String blueprintName, Blueprint blueprint) {
+    	if (!blueprints.containsKey(blueprintName)) {
+    		blueprints.put(blueprintName, new ArrayList<Blueprint>());
+    	}
+    	blueprints.get(blueprintName).add(blueprint);    
+    }
+    
+    /*
+     * Delete the specified version of blueprint
+     */
+    public void deleteBlueprint(String blueprintName, int revision) throws Exception {
+    	if (!blueprints.containsKey(blueprintName) || revision < 0 || revision >= blueprints.get(blueprintName).size()) {
+    		throw new Exception ("Specified revision ["+revision+"] of ["+blueprintName+"] blueprint does not exists");
+    	}
+    	// This would change 
+    	blueprints.get(blueprintName).set(revision, null);  	
+    }
+    
+    /**
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+    /**
+     * Gets the value of the name property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Gets the value of the description property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Sets the value of the description property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setDescription(String value) {
+        this.description = value;
+    }
+
+	/**
+	 * @return the defaultBlueprintDownloadURI
+	 */
+	public String getLocationURL() {
+		return locationURL;
+	}
+
+
+	/**
+	 * @param locationURL the locationURL to set
+	 */
+	public void setLocationURL(String locationURL) {
+		this.locationURL = locationURL;
+	}
+}