Refactor describe-service-group command in CLI

Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d8d29b45
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d8d29b45
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d8d29b45

Branch: refs/heads/master
Commit: d8d29b45cc3af5de7b424b975a29a491e55d54f6
Parents: d374775
Author: Manula Thantriwatte <[email protected]>
Authored: Sat Nov 8 07:05:16 2014 +0000
Committer: Manula Thantriwatte <[email protected]>
Committed: Sat Nov 8 07:05:16 2014 +0000

----------------------------------------------------------------------
 .../stratos/cli/RestCommandLineService.java     |  5 +-
 .../grouping/definitions/Dependencies.java      | 46 -------------
 .../definitions/ServiceGroupDefinition.java     | 70 --------------------
 .../grouping/definitions/ServiceGroupList.java  | 33 ---------
 .../grouping/serviceGroups/Dependencies.java    | 46 +++++++++++++
 .../serviceGroups/ServiceGroupDefinition.java   | 70 ++++++++++++++++++++
 .../serviceGroups/ServiceGroupList.java         | 33 +++++++++
 7 files changed, 152 insertions(+), 151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/d8d29b45/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
index a4cde9b..bc92157 100644
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java
@@ -50,8 +50,7 @@ import org.apache.stratos.cli.beans.cartridge.Cartridge;
 import org.apache.stratos.cli.beans.cartridge.CartridgeInfoBean;
 import org.apache.stratos.cli.beans.cartridge.PortMapping;
 import org.apache.stratos.cli.beans.cartridge.ServiceDefinitionBean;
-import 
org.apache.stratos.cli.beans.grouping.definitions.ServiceGroupDefinition;
-import org.apache.stratos.cli.beans.grouping.definitions.ServiceGroupList;
+import org.apache.stratos.cli.beans.grouping.serviceGroups.ServiceGroupList;
 import org.apache.stratos.cli.beans.kubernetes.KubernetesGroup;
 import org.apache.stratos.cli.beans.kubernetes.KubernetesGroupList;
 import org.apache.stratos.cli.beans.kubernetes.KubernetesHost;
@@ -1824,6 +1823,7 @@ public class RestCommandLineService {
         restClient.undeployEntity(ENDPOINT_UNDEPLOY_SERVICE_GROUP, "service 
group", groupDefinitionName);
     }
 
+    // This method helps to describe service group definition
     public void describeServiceGroup (String groupDefinitionName) {
         try {
             ServiceGroupList list = (ServiceGroupList) 
restClient.listEntity(ENDPOINT_LIST_SERVICE_GROUP.replace("{groupDefinitionName}",
 groupDefinitionName),
@@ -1842,6 +1842,7 @@ public class RestCommandLineService {
             log.error(message, e);
         }
     }
+
     // This method helps to deploy applications
     public void deployApplication (String entityBody) {
         restClient.deployEntity(ENDPOINT_DEPLOY_APPLICATION, entityBody, 
"application");

http://git-wip-us.apache.org/repos/asf/stratos/blob/d8d29b45/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/Dependencies.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/Dependencies.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/Dependencies.java
deleted file mode 100644
index f093a51..0000000
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/Dependencies.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.cli.beans.grouping.definitions;
-
-public class Dependencies
-{
-    private String terminationBehaviour;
-
-    private String[] startupOrders;
-
-    public String getTerminationBehaviour ()
-    {
-        return terminationBehaviour;
-    }
-
-    public void setTerminationBehaviour (String terminationBehaviour)
-    {
-        this.terminationBehaviour = terminationBehaviour;
-    }
-
-    public String[] getStartupOrders ()
-    {
-        return startupOrders;
-    }
-
-    public void setStartupOrders (String[] startupOrders)
-    {
-        this.startupOrders = startupOrders;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d8d29b45/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupDefinition.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupDefinition.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupDefinition.java
deleted file mode 100644
index e27d728..0000000
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupDefinition.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.cli.beans.grouping.definitions;
-
-public class ServiceGroupDefinition
-{
-    private Dependencies dependencies;
-
-    private String name;
-
-    private String[] subGroups;
-
-    private String[] cartridges;
-
-    public Dependencies getDependencies ()
-    {
-        return dependencies;
-    }
-
-    public void setDependencies (Dependencies dependencies)
-    {
-        this.dependencies = dependencies;
-    }
-
-    public String getName ()
-    {
-        return name;
-    }
-
-    public void setName (String name)
-    {
-        this.name = name;
-    }
-
-    public String[] getSubGroups ()
-    {
-        return subGroups;
-    }
-
-    public void setSubGroups (String[] subGroups)
-    {
-        this.subGroups = subGroups;
-    }
-
-    public String[] getCartridges ()
-    {
-        return cartridges;
-    }
-
-    public void setCartridges (String[] cartridges)
-    {
-        this.cartridges = cartridges;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d8d29b45/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupList.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupList.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupList.java
deleted file mode 100644
index 7a9fae6..0000000
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/definitions/ServiceGroupList.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.stratos.cli.beans.grouping.definitions;
-
-public class ServiceGroupList {
-    private ServiceGroupDefinition serviceGroup;
-
-    public ServiceGroupDefinition getServiceGroupDefinition ()
-    {
-        return serviceGroup;
-    }
-
-    public void setServiceGroupDefinition (ServiceGroupDefinition 
serviceGroupDefinition)
-    {
-        this.serviceGroup = serviceGroupDefinition;
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d8d29b45/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java
new file mode 100644
index 0000000..6364e4b
--- /dev/null
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/Dependencies.java
@@ -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.stratos.cli.beans.grouping.serviceGroups;
+
+public class Dependencies
+{
+    private String terminationBehaviour;
+
+    private String[] startupOrders;
+
+    public String getTerminationBehaviour ()
+    {
+        return terminationBehaviour;
+    }
+
+    public void setTerminationBehaviour (String terminationBehaviour)
+    {
+        this.terminationBehaviour = terminationBehaviour;
+    }
+
+    public String[] getStartupOrders ()
+    {
+        return startupOrders;
+    }
+
+    public void setStartupOrders (String[] startupOrders)
+    {
+        this.startupOrders = startupOrders;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d8d29b45/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java
new file mode 100644
index 0000000..71eb544
--- /dev/null
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupDefinition.java
@@ -0,0 +1,70 @@
+/*
+ * 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.stratos.cli.beans.grouping.serviceGroups;
+
+public class ServiceGroupDefinition
+{
+    private Dependencies dependencies;
+
+    private String name;
+
+    private String[] subGroups;
+
+    private String[] cartridges;
+
+    public Dependencies getDependencies ()
+    {
+        return dependencies;
+    }
+
+    public void setDependencies (Dependencies dependencies)
+    {
+        this.dependencies = dependencies;
+    }
+
+    public String getName ()
+    {
+        return name;
+    }
+
+    public void setName (String name)
+    {
+        this.name = name;
+    }
+
+    public String[] getSubGroups ()
+    {
+        return subGroups;
+    }
+
+    public void setSubGroups (String[] subGroups)
+    {
+        this.subGroups = subGroups;
+    }
+
+    public String[] getCartridges ()
+    {
+        return cartridges;
+    }
+
+    public void setCartridges (String[] cartridges)
+    {
+        this.cartridges = cartridges;
+    }
+}

http://git-wip-us.apache.org/repos/asf/stratos/blob/d8d29b45/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupList.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupList.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupList.java
new file mode 100644
index 0000000..f8a20b3
--- /dev/null
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/beans/grouping/serviceGroups/ServiceGroupList.java
@@ -0,0 +1,33 @@
+/*
+ * 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.stratos.cli.beans.grouping.serviceGroups;
+
+public class ServiceGroupList {
+    private ServiceGroupDefinition serviceGroup;
+
+    public ServiceGroupDefinition getServiceGroupDefinition ()
+    {
+        return serviceGroup;
+    }
+
+    public void setServiceGroupDefinition (ServiceGroupDefinition 
serviceGroupDefinition)
+    {
+        this.serviceGroup = serviceGroupDefinition;
+    }
+}

Reply via email to