Author: adietish
Date: 2010-11-02 09:32:55 -0400 (Tue, 02 Nov 2010)
New Revision: 26185
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
Log:
[JBIDE-7484] split method #buildInstance
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-11-02
12:49:16 UTC (rev 26184)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2010-11-02
13:32:55 UTC (rev 26185)
@@ -46,6 +46,7 @@
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.Path;
+import org.jboss.tools.deltacloud.core.client.Instance.Action;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -437,12 +438,7 @@
instance.setState(getElementText(document, "state").get(0)); //$NON-NLS-1$
getAuthentication(document, instance);
- ArrayList<Instance.Action> actions = new ArrayList<Instance.Action>();
- for (String s : getAttributeValues(document, "link", "rel"))
//$NON-NLS-1$ //$NON-NLS-2$
- {
- actions.add(Instance.Action.valueOf(s.toUpperCase()));
- }
- instance.setActions(actions);
+ instance.setActions(createActions(instance, document));
return instance;
// } catch (DeltaCloudClientException e) {
@@ -453,6 +449,15 @@
}
}
+ private List<Action> createActions(Instance instance, Document document) {
+ ArrayList<Instance.Action> actions = new ArrayList<Instance.Action>();
+ for (String s : getAttributeValues(document, "link", "rel"))
//$NON-NLS-1$ //$NON-NLS-2$
+ {
+ actions.add(Instance.Action.valueOf(s.toUpperCase()));
+ }
+ return actions;
+ }
+
private HardwareProfile buildHardwareProfile(String xml) throws
DeltaCloudClientException {
try {
HardwareProfile profile = JAXB.unmarshal(new StringReader(xml),
HardwareProfile.class);
Show replies by date