Repository: stratos
Updated Branches:
  refs/heads/master 62f9c13a6 -> 05f868322


Formatting few classes


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

Branch: refs/heads/master
Commit: 05f868322bc53566a5c893d66702dd663f0b7e79
Parents: 62f9c13
Author: Lahiru Sandaruwan <[email protected]>
Authored: Sat Apr 25 22:13:28 2015 +0530
Committer: Lahiru Sandaruwan <[email protected]>
Committed: Sat Apr 25 22:13:28 2015 +0530

----------------------------------------------------------------------
 .../LoadBalancerStatisticsCollectorTest.java    |  2 +-
 .../rest/endpoint/api/StratosApiV41.java        | 43 ++++++++++----------
 .../rest/endpoint/api/StratosApiV41Utils.java   | 36 ++++++++--------
 3 files changed, 41 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/05f86832/components/org.apache.stratos.load.balancer/src/test/java/org/apache/stratos/load/balancer/test/LoadBalancerStatisticsCollectorTest.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.load.balancer/src/test/java/org/apache/stratos/load/balancer/test/LoadBalancerStatisticsCollectorTest.java
 
b/components/org.apache.stratos.load.balancer/src/test/java/org/apache/stratos/load/balancer/test/LoadBalancerStatisticsCollectorTest.java
index 92c6da8..0971326 100644
--- 
a/components/org.apache.stratos.load.balancer/src/test/java/org/apache/stratos/load/balancer/test/LoadBalancerStatisticsCollectorTest.java
+++ 
b/components/org.apache.stratos.load.balancer/src/test/java/org/apache/stratos/load/balancer/test/LoadBalancerStatisticsCollectorTest.java
@@ -37,7 +37,7 @@ import java.util.concurrent.FutureTask;
 @RunWith(JUnit4.class)
 public class LoadBalancerStatisticsCollectorTest {
 
-    /***
+    /**
      * Test in-flight request count calculation.
      */
     @Test

http://git-wip-us.apache.org/repos/asf/stratos/blob/05f86832/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 2610032..9f8c89b 100644
--- 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@ -204,7 +204,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getDeploymentPolicies()
             throws RestAPIException {
         DeploymentPolicyBean[] deploymentPolicies = 
StratosApiV41Utils.getDeployementPolicies();
-        if (deploymentPolicies == null || deploymentPolicies.length == 0){
+        if (deploymentPolicies == null || deploymentPolicies.length == 0) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -294,7 +294,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getCartridges()
             throws RestAPIException {
         List<CartridgeBean> cartridges = 
StratosApiV41Utils.getAvailableCartridges(null, null, getConfigContext());
-        if (cartridges == null ||  cartridges.isEmpty()) {
+        if (cartridges == null || cartridges.isEmpty()) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
         CartridgeBean[] cartridgeArray = cartridges.toArray(new 
CartridgeBean[cartridges.size()]);
@@ -303,6 +303,7 @@ public class StratosApiV41 extends AbstractApi {
 
     /**
      * Gets a single cartridge by type
+     *
      * @param cartridgeType Cartridge type
      * @return 200 if specified cartridge exists, 404 if not
      * @throws RestAPIException
@@ -326,7 +327,7 @@ public class StratosApiV41 extends AbstractApi {
     /**
      * Returns cartridges by category.
      *
-     * @param filter Filter
+     * @param filter   Filter
      * @param criteria Criteria
      * @return 200 if cartridges are found for specified filter, 404 if none 
found
      * @throws RestAPIException
@@ -352,7 +353,7 @@ public class StratosApiV41 extends AbstractApi {
     /**
      * Returns a specific cartridge by category.
      *
-     * @param filter Filter
+     * @param filter        Filter
      * @param cartridgeType Cartridge Type
      * @return 200 if a cartridge is found for specified filter, 404 if none 
found
      * @throws RestAPIException
@@ -543,7 +544,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getNetworkPartitions()
             throws RestAPIException {
         NetworkPartitionBean[] networkPartitions = 
StratosApiV41Utils.getNetworkPartitions();
-        if (networkPartitions == null || networkPartitions.length == 0){
+        if (networkPartitions == null || networkPartitions.length == 0) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -564,7 +565,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getNetworkPartition(
             @PathParam("networkPartitionId") String networkPartitionId) throws 
RestAPIException {
         NetworkPartitionBean networkPartition = 
StratosApiV41Utils.getNetworkPartition(networkPartitionId);
-        if (networkPartition == null){
+        if (networkPartition == null) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -666,7 +667,7 @@ public class StratosApiV41 extends AbstractApi {
     @AuthorizationAction("/permission/protected/manage/getApplications")
     public Response getApplications() throws RestAPIException {
         List<ApplicationBean> applicationDefinitions = 
StratosApiV41Utils.getApplications();
-        if (applicationDefinitions == null || 
applicationDefinitions.isEmpty()){
+        if (applicationDefinitions == null || 
applicationDefinitions.isEmpty()) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -699,7 +700,7 @@ public class StratosApiV41 extends AbstractApi {
     /**
      * Deploy application.
      *
-     * @param applicationId Application Id
+     * @param applicationId       Application Id
      * @param applicationPolicyId the application policy id
      * @return 202 after deployment process is started. Deployment is 
asynchronous
      * @throws RestAPIException the rest api exception
@@ -727,6 +728,7 @@ public class StratosApiV41 extends AbstractApi {
 
     /**
      * Adds an application policy
+     *
      * @param applicationPolicy Application Policy
      * @return 201 if the application policy is successfully added
      * @throws RestAPIException
@@ -768,7 +770,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getApplicationPolicy(
             @PathParam("applicationPolicyId") String applicationPolicyId) 
throws RestAPIException {
         ApplicationPolicyBean applicationPolicyBean = 
StratosApiV41Utils.getApplicationPolicy(applicationPolicyId);
-        if (applicationPolicyBean == null){
+        if (applicationPolicyBean == null) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -789,7 +791,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getApplicationPolicies()
             throws RestAPIException {
         ApplicationPolicyBean[] applicationPolicies = 
StratosApiV41Utils.getApplicationPolicies();
-        if (applicationPolicies == null || applicationPolicies.length == 0){
+        if (applicationPolicies == null || applicationPolicies.length == 0) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -855,7 +857,7 @@ public class StratosApiV41 extends AbstractApi {
                 .getApplicationNetworkPartitions(applicationId);
         if (appNetworkPartitionsBean == null ||
                 (appNetworkPartitionsBean.getNetworkPartitionIds().size() == 1 
&&
-                        
appNetworkPartitionsBean.getNetworkPartitionIds().get(0) == null)){
+                        
appNetworkPartitionsBean.getNetworkPartitionIds().get(0) == null)) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -931,7 +933,7 @@ public class StratosApiV41 extends AbstractApi {
     /**
      * Adds the domain mappings for an application.
      *
-     * @param applicationId       the application id
+     * @param applicationId      the application id
      * @param domainMappingsBean the domain mappings bean
      * @return 200
      * @throws RestAPIException the rest api exception
@@ -997,7 +999,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getDomainMappings(
             @PathParam("applicationId") String applicationId) throws 
RestAPIException {
         List<DomainMappingBean> domainMappingsBeanList = 
StratosApiV41Utils.getApplicationDomainMappings(applicationId);
-        if (domainMappingsBeanList == null || 
domainMappingsBeanList.isEmpty()){
+        if (domainMappingsBeanList == null || 
domainMappingsBeanList.isEmpty()) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -1107,7 +1109,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getAutoscalingPolicies()
             throws RestAPIException {
         AutoscalePolicyBean[] autoScalePolicies = 
StratosApiV41Utils.getAutoScalePolicies();
-        if (autoScalePolicies == null || autoScalePolicies.length == 0){
+        if (autoScalePolicies == null || autoScalePolicies.length == 0) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
@@ -1188,6 +1190,7 @@ public class StratosApiV41 extends AbstractApi {
 
     /**
      * Updates a network partition
+     *
      * @param networkPartition Network Partition
      * @return 200 if network partition is successfully updated
      * @throws RestAPIException
@@ -1308,7 +1311,6 @@ public class StratosApiV41 extends AbstractApi {
     }
 
 
-
     /**
      * Gets the tenant by domain.
      *
@@ -1327,7 +1329,7 @@ public class StratosApiV41 extends AbstractApi {
 
         try {
             TenantInfoBean tenantInfo = 
StratosApiV41Utils.getTenantByDomain(tenantDomain);
-            if (tenantInfo == null){
+            if (tenantInfo == null) {
                 return Response.status(Response.Status.NOT_FOUND).build();
             }
 
@@ -1375,7 +1377,7 @@ public class StratosApiV41 extends AbstractApi {
             throws RestAPIException {
         try {
             List<org.apache.stratos.common.beans.TenantInfoBean> tenantList = 
StratosApiV41Utils.getAllTenants();
-            if (tenantList == null || tenantList.isEmpty()){
+            if (tenantList == null || tenantList.isEmpty()) {
                 return Response.status(Response.Status.NOT_FOUND).build();
             }
 
@@ -1407,7 +1409,7 @@ public class StratosApiV41 extends AbstractApi {
 
         try {
             List<org.apache.stratos.common.beans.TenantInfoBean> tenantList = 
StratosApiV41Utils.searchPartialTenantsDomains(tenantDomain);
-            if (tenantList == null || tenantList.isEmpty()){
+            if (tenantList == null || tenantList.isEmpty()) {
                 return Response.status(Response.Status.NOT_FOUND).build();
             }
 
@@ -1420,7 +1422,6 @@ public class StratosApiV41 extends AbstractApi {
     }
 
 
-
     /**
      * Activate tenant.
      *
@@ -1467,6 +1468,7 @@ public class StratosApiV41 extends AbstractApi {
 
     /**
      * Notify artifact update event for specified repository
+     *
      * @param payload Git notification Payload
      * @return 204
      * @throws RestAPIException
@@ -1571,7 +1573,6 @@ public class StratosApiV41 extends AbstractApi {
     }
 
 
-
     // API methods for Kubernetes clusters
 
     /**
@@ -1686,7 +1687,7 @@ public class StratosApiV41 extends AbstractApi {
     public Response getKubernetesHostClusters()
             throws RestAPIException {
         KubernetesClusterBean[] availableKubernetesClusters = 
StratosApiV41Utils.getAvailableKubernetesClusters();
-        if (availableKubernetesClusters == null || 
availableKubernetesClusters.length == 0){
+        if (availableKubernetesClusters == null || 
availableKubernetesClusters.length == 0) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/05f86832/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
index 67a918b..0279759 100644
--- 
a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
+++ 
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
@@ -146,7 +146,7 @@ public class StratosApiV41Utils {
             log.error(msg, e);
             throw new RestAPIException(msg);
         } catch (Exception e) {
-            String msg = "Could not update cartridge "+e.getLocalizedMessage();
+            String msg = "Could not update cartridge " + 
e.getLocalizedMessage();
             log.error(msg, e);
             throw new RestAPIException(msg);
         }
@@ -193,7 +193,7 @@ public class StratosApiV41Utils {
                 log.info(String.format("Successfully removed cartridge: 
[cartridge-type] %s ", cartridgeType));
             }
         } catch (Exception e) {
-            String msg = "Could not remove cartridge "+e.getLocalizedMessage();
+            String msg = "Could not remove cartridge " + 
e.getLocalizedMessage();
             log.error(msg, e);
             throw new RestAPIException(e.getMessage(), e);
         }
@@ -1065,9 +1065,9 @@ public class StratosApiV41Utils {
      * Verify the existence of the application and add it.
      *
      * @param appDefinition Application definition
-     * @param ctxt Configuration context
-     * @param userName Username
-     * @param tenantDomain Tenant Domain
+     * @param ctxt          Configuration context
+     * @param userName      Username
+     * @param tenantDomain  Tenant Domain
      * @throws RestAPIException
      */
     public static void addApplication(ApplicationBean appDefinition, 
ConfigurationContext ctxt,
@@ -1134,13 +1134,13 @@ public class StratosApiV41Utils {
      * Update the existence of the application and update it.
      *
      * @param appDefinition Application definition
-     * @param ctxt Configuration context
-     * @param userName Username
-     * @param tenantDomain Tenant Domain
+     * @param ctxt          Configuration context
+     * @param userName      Username
+     * @param tenantDomain  Tenant Domain
      * @throws RestAPIException
      */
     public static void updateApplication(ApplicationBean appDefinition, 
ConfigurationContext ctxt,
-                                      String userName, String tenantDomain)
+                                         String userName, String tenantDomain)
             throws RestAPIException {
 
         if (StringUtils.isBlank(appDefinition.getApplicationId())) {
@@ -1245,7 +1245,7 @@ public class StratosApiV41Utils {
     /**
      * Deploy application with an application policy.
      *
-     * @param applicationId Application ID
+     * @param applicationId       Application ID
      * @param applicationPolicyId Application policy Id
      * @throws RestAPIException
      */
@@ -1879,7 +1879,7 @@ public class StratosApiV41Utils {
      * Encrypt artifact repository passwords.
      *
      * @param applicationSignUp Application Signup
-     * @param applicationKey Application Key
+     * @param applicationKey    Application Key
      */
     private static void encryptRepositoryPasswords(ApplicationSignUp 
applicationSignUp, String applicationKey) {
         if (applicationSignUp.getArtifactRepositories() != null) {
@@ -2220,7 +2220,7 @@ public class StratosApiV41Utils {
             log.error(msg, e);
             throw new RestAPIException(msg);
         }
-        
+
         return deploymentPolicyBean;
     }
 
@@ -2270,7 +2270,7 @@ public class StratosApiV41Utils {
             log.error(msg, e);
             throw new RestAPIException(msg);
         } catch (Exception e) {
-            String msg = "Could not update deployment policy 
"+e.getLocalizedMessage();
+            String msg = "Could not update deployment policy " + 
e.getLocalizedMessage();
             log.error(msg, e);
             throw new RestAPIException(msg);
         }
@@ -2287,7 +2287,7 @@ public class StratosApiV41Utils {
         try {
             
AutoscalerServiceClient.getInstance().removeDeploymentPolicy(deploymentPolicyID);
         } catch (Exception e) {
-            String msg = "Could not remove deployment policy 
"+e.getLocalizedMessage();
+            String msg = "Could not remove deployment policy " + 
e.getLocalizedMessage();
             log.error(msg, e);
             throw new RestAPIException(msg);
         }
@@ -2300,7 +2300,7 @@ public class StratosApiV41Utils {
         }
 
         Cluster cluster = TopologyManager.getTopology().getCluster(clusterId);
-        if (cluster == null){
+        if (cluster == null) {
             return null;
         }
 
@@ -2758,7 +2758,7 @@ public class StratosApiV41Utils {
      * @param userName
      * @throws RestAPIException
      */
-    public static void removeUser(String userName) throws RestAPIException{
+    public static void removeUser(String userName) throws RestAPIException {
         StratosUserManager stratosUserManager = new StratosUserManager();
 
         try {
@@ -2796,8 +2796,8 @@ public class StratosApiV41Utils {
         StratosUserManager stratosUserManager = new StratosUserManager();
         List<UserInfoBean> userList;
         try {
-           userList  = 
stratosUserManager.getAllUsers(getTenantUserStoreManager());
-        }catch (UserManagerException e){
+            userList = 
stratosUserManager.getAllUsers(getTenantUserStoreManager());
+        } catch (UserManagerException e) {
             throw new RestAPIException(e.getMessage());
         }
         return userList;

Reply via email to