Fixing STRATOS-1647 - Application deployment fails due to a bug in Axis2 level. Making service interface void type methods to non-void as a workaround
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b063eb42 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b063eb42 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b063eb42 Branch: refs/heads/master Commit: b063eb42772bd633979c03719d297377d6b35c70 Parents: f1e0045 Author: Akila Perera <[email protected]> Authored: Fri Jun 17 13:09:26 2016 +0530 Committer: Akila Perera <[email protected]> Committed: Fri Jun 17 13:09:26 2016 +0530 ---------------------------------------------------------------------- .../client/AutoscalerCloudControllerClient.java | 37 +- .../common/client/AutoscalerServiceClient.java | 32 +- .../client/CloudControllerServiceClient.java | 49 +- .../client/StratosManagerServiceClient.java | 95 +- .../common/constants/StratosConstants.java | 48 +- .../manager/services/StratosManagerService.java | 6 +- .../impl/StratosManagerServiceImpl.java | 10 +- .../src/main/resources/AutoscalerService.wsdl | 624 ++++++------ .../main/resources/CloudControllerService.wsdl | 942 +++++++++---------- .../main/resources/StratosManagerService.wsdl | 259 ++--- 10 files changed, 1132 insertions(+), 970 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/b063eb42/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java index 9f380d0..6c8a589 100644 --- a/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java +++ b/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/client/AutoscalerCloudControllerClient.java @@ -19,8 +19,14 @@ package org.apache.stratos.autoscaler.client; +import org.apache.axis2.Constants; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.context.ConfigurationContextFactory; import org.apache.axis2.transport.http.HTTPConstants; import org.apache.commons.configuration.XMLConfiguration; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; +import org.apache.commons.httpclient.params.HttpConnectionManagerParams; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.autoscaler.applications.pojo.ApplicationClusterContext; @@ -47,23 +53,43 @@ import java.util.List; * This class will call cloud controller web service to take the action decided by Autoscaler */ public class AutoscalerCloudControllerClient { - private static final Log log = LogFactory.getLog(AutoscalerCloudControllerClient.class); - + private static final String AS_CC_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY = + "autoscaler.cloud.controller.client.max.connections.per.host"; + private static final String AS_CC_CLIENT_MAX_TOTAL_CONNECTIONS_KEY = + "autoscaler.cloud.controller.client.max.total.connections"; + private static final int AS_CC_CLIENT_MAX_CONNECTIONS_PER_HOST = Integer.getInteger + (AS_CC_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY, 25); + private static final int AS_CC_CLIENT_MAX_TOTAL_CONNECTIONS = Integer.getInteger + (AS_CC_CLIENT_MAX_TOTAL_CONNECTIONS_KEY, 30); private static CloudControllerServiceStub stub; private AutoscalerCloudControllerClient() { + MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new + MultiThreadedHttpConnectionManager(); + HttpConnectionManagerParams params = new HttpConnectionManagerParams(); + params.setDefaultMaxConnectionsPerHost(AS_CC_CLIENT_MAX_CONNECTIONS_PER_HOST); + params.setMaxTotalConnections(AS_CC_CLIENT_MAX_TOTAL_CONNECTIONS); + multiThreadedHttpConnectionManager.setParams(params); + HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager); + try { + ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); + ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); XMLConfiguration conf = ConfUtil.getInstance(null).getConfiguration(); - int port = conf.getInt("autoscaler.cloudController.port", AutoscalerConstants.CLOUD_CONTROLLER_DEFAULT_PORT); + int port = conf.getInt("autoscaler.cloudController.port", AutoscalerConstants + .CLOUD_CONTROLLER_DEFAULT_PORT); String hostname = conf.getString("autoscaler.cloudController.hostname", "localhost"); String epr = "https://" + hostname + ":" + port + "/" + AutoscalerConstants.CLOUD_CONTROLLER_SERVICE_SFX; int cloudControllerClientTimeout = conf.getInt("autoscaler.cloudController.clientTimeout", 180000); - stub = new CloudControllerServiceStub(epr); + stub = new CloudControllerServiceStub(ctx, epr); stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, cloudControllerClientTimeout); stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, cloudControllerClientTimeout); + stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE); + stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean + .TRUE); } catch (Exception e) { log.error("Could not initialize cloud controller client", e); } @@ -217,7 +243,8 @@ public class AutoscalerCloudControllerClient { public void terminateAllInstances(String clusterId) throws RemoteException, CloudControllerServiceInvalidClusterExceptionException { if (log.isInfoEnabled()) { - log.info(String.format("Terminating all instances of cluster via cloud controller: [cluster] %s", clusterId)); + log.info(String.format("Terminating all instances of cluster via cloud controller: [cluster] %s", + clusterId)); } long startTime = System.currentTimeMillis(); stub.terminateInstances(clusterId); http://git-wip-us.apache.org/repos/asf/stratos/blob/b063eb42/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java index 31d08e0..06b740b 100644 --- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java +++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/AutoscalerServiceClient.java @@ -20,7 +20,13 @@ package org.apache.stratos.common.client; import org.apache.axis2.AxisFault; +import org.apache.axis2.Constants; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.context.ConfigurationContextFactory; import org.apache.axis2.transport.http.HTTPConstants; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; +import org.apache.commons.httpclient.params.HttpConnectionManagerParams; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.stratos.autoscaler.stub.*; @@ -34,13 +40,20 @@ import org.apache.stratos.common.constants.StratosConstants; import java.rmi.RemoteException; public class AutoscalerServiceClient { - - private AutoscalerServiceStub stub; - private static final Log log = LogFactory.getLog(AutoscalerServiceClient.class); private static volatile AutoscalerServiceClient instance; + private AutoscalerServiceStub stub; private AutoscalerServiceClient(String epr) throws AxisFault { + MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new + MultiThreadedHttpConnectionManager(); + HttpConnectionManagerParams params = new HttpConnectionManagerParams(); + params.setDefaultMaxConnectionsPerHost(StratosConstants.AUTOSCALER_CLIENT_MAX_CONNECTIONS_PER_HOST); + params.setMaxTotalConnections(StratosConstants.AUTOSCALER_CLIENT_MAX_TOTAL_CONNECTIONS); + multiThreadedHttpConnectionManager.setParams(params); + HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager); + ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); + ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); String autosclaerSocketTimeout = System.getProperty(StratosConstants.AUTOSCALER_CLIENT_SOCKET_TIMEOUT) == null ? StratosConstants.DEFAULT_CLIENT_SOCKET_TIMEOUT : @@ -49,14 +62,15 @@ public class AutoscalerServiceClient { String autosclaerConnectionTimeout = System.getProperty(StratosConstants.AUTOSCALER_CLIENT_CONNECTION_TIMEOUT) == null ? StratosConstants.DEFAULT_CLIENT_CONNECTION_TIMEOUT : System.getProperty(StratosConstants.AUTOSCALER_CLIENT_CONNECTION_TIMEOUT); - try { - stub = new AutoscalerServiceStub(epr); + stub = new AutoscalerServiceStub(ctx, epr); stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, Integer.valueOf(autosclaerSocketTimeout)); stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, Integer.valueOf(autosclaerConnectionTimeout)); - + stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE); + stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean + .TRUE); } catch (AxisFault axisFault) { String msg = "Could not initialize autoscaler service client"; log.error(msg, axisFault); @@ -176,7 +190,8 @@ public class AutoscalerServiceClient { } public boolean removeAutoscalingPolicy(String autoScalePolicyId) throws RemoteException, - AutoscalerServicePolicyDoesNotExistExceptionException, AutoscalerServiceUnremovablePolicyExceptionException { + AutoscalerServicePolicyDoesNotExistExceptionException, + AutoscalerServiceUnremovablePolicyExceptionException { return stub.removeAutoScalingPolicy(autoScalePolicyId); } @@ -188,7 +203,8 @@ public class AutoscalerServiceClient { return stub.getServiceGroups(); } - public void addServiceGroup(ServiceGroup serviceGroup) throws AutoscalerServiceInvalidServiceGroupExceptionException, + public void addServiceGroup(ServiceGroup serviceGroup) throws + AutoscalerServiceInvalidServiceGroupExceptionException, RemoteException { stub.addServiceGroup(serviceGroup); } http://git-wip-us.apache.org/repos/asf/stratos/blob/b063eb42/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/CloudControllerServiceClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/CloudControllerServiceClient.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/CloudControllerServiceClient.java index 368cfdf..7ca0afe 100644 --- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/CloudControllerServiceClient.java +++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/CloudControllerServiceClient.java @@ -20,7 +20,13 @@ package org.apache.stratos.common.client; import org.apache.axis2.AxisFault; +import org.apache.axis2.Constants; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.context.ConfigurationContextFactory; import org.apache.axis2.transport.http.HTTPConstants; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; +import org.apache.commons.httpclient.params.HttpConnectionManagerParams; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -35,12 +41,20 @@ import java.rmi.RemoteException; public class CloudControllerServiceClient { - private CloudControllerServiceStub stub; - private static final Log log = LogFactory.getLog(CloudControllerServiceClient.class); private static volatile CloudControllerServiceClient instance; + private CloudControllerServiceStub stub; private CloudControllerServiceClient(String epr) throws AxisFault { + MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new + MultiThreadedHttpConnectionManager(); + HttpConnectionManagerParams params = new HttpConnectionManagerParams(); + params.setDefaultMaxConnectionsPerHost(StratosConstants.CLOUD_CONTROLLER_CLIENT_MAX_CONNECTIONS_PER_HOST); + params.setMaxTotalConnections(StratosConstants.CLOUD_CONTROLLER_CLIENT_MAX_TOTAL_CONNECTIONS); + multiThreadedHttpConnectionManager.setParams(params); + HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager); + ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); + ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); String ccSocketTimeout = System.getProperty(StratosConstants.CLOUD_CONTROLLER_CLIENT_SOCKET_TIMEOUT) == null ? StratosConstants.DEFAULT_CLIENT_SOCKET_TIMEOUT : @@ -50,14 +64,15 @@ public class CloudControllerServiceClient { System.getProperty(StratosConstants.CLOUD_CONTROLLER_CLIENT_CONNECTION_TIMEOUT) == null ? StratosConstants.DEFAULT_CLIENT_CONNECTION_TIMEOUT : System.getProperty(StratosConstants.CLOUD_CONTROLLER_CLIENT_CONNECTION_TIMEOUT); - try { - stub = new CloudControllerServiceStub(epr); + stub = new CloudControllerServiceStub(ctx, epr); stub._getServiceClient().getOptions() .setProperty(HTTPConstants.SO_TIMEOUT, Integer.valueOf(ccSocketTimeout)); stub._getServiceClient().getOptions() .setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(ccConnectionTimeout)); - + stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE); + stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean + .TRUE); } catch (AxisFault axisFault) { String msg = "Could not initialize cloud controller service client"; log.error(msg, axisFault); @@ -84,15 +99,15 @@ public class CloudControllerServiceClient { public void addCartridge(Cartridge cartridgeConfig) throws RemoteException, CloudControllerServiceCartridgeAlreadyExistsExceptionException, - CloudControllerServiceInvalidCartridgeDefinitionExceptionException, - CloudControllerServiceInvalidIaasProviderExceptionException { + CloudControllerServiceInvalidCartridgeDefinitionExceptionException, + CloudControllerServiceInvalidIaasProviderExceptionException { stub.addCartridge(cartridgeConfig); } public void updateCartridge(Cartridge cartridgeConfig) throws RemoteException, CloudControllerServiceInvalidCartridgeDefinitionExceptionException, - CloudControllerServiceInvalidIaasProviderExceptionException, - CloudControllerServiceCartridgeDefinitionNotExistsExceptionException { + CloudControllerServiceInvalidIaasProviderExceptionException, + CloudControllerServiceCartridgeDefinitionNotExistsExceptionException { stub.updateCartridge(cartridgeConfig); } @@ -142,20 +157,20 @@ public class CloudControllerServiceClient { public boolean deployKubernetesCluster(KubernetesCluster kubernetesCluster) throws RemoteException, CloudControllerServiceInvalidKubernetesClusterExceptionException, - CloudControllerServiceKubernetesClusterAlreadyExistsExceptionException { + CloudControllerServiceKubernetesClusterAlreadyExistsExceptionException { return stub.addKubernetesCluster(kubernetesCluster); } public boolean addKubernetesHost(String kubernetesClusterId, KubernetesHost kubernetesHost) throws RemoteException, CloudControllerServiceInvalidKubernetesHostExceptionException, - CloudControllerServiceNonExistingKubernetesClusterExceptionException { + CloudControllerServiceNonExistingKubernetesClusterExceptionException { return stub.addKubernetesHost(kubernetesClusterId, kubernetesHost); } public boolean updateKubernetesMaster(KubernetesMaster kubernetesMaster) throws RemoteException, CloudControllerServiceInvalidKubernetesMasterExceptionException, - CloudControllerServiceNonExistingKubernetesMasterExceptionException { + CloudControllerServiceNonExistingKubernetesMasterExceptionException { return stub.updateKubernetesMaster(kubernetesMaster); } @@ -170,7 +185,7 @@ public class CloudControllerServiceClient { public void undeployKubernetesCluster(String kubernetesClusterId) throws RemoteException, CloudControllerServiceNonExistingKubernetesClusterExceptionException, - CloudControllerServiceKubernetesClusterAlreadyUsedExceptionException { + CloudControllerServiceKubernetesClusterAlreadyUsedExceptionException { stub.removeKubernetesCluster(kubernetesClusterId); } @@ -191,19 +206,19 @@ public class CloudControllerServiceClient { public boolean updateKubernetesHost(KubernetesHost kubernetesHost) throws RemoteException, CloudControllerServiceInvalidKubernetesHostExceptionException, - CloudControllerServiceNonExistingKubernetesHostExceptionException { + CloudControllerServiceNonExistingKubernetesHostExceptionException { return stub.updateKubernetesHost(kubernetesHost); } public void validateNetworkPartitionOfDeploymentPolicy(String cartridgeType, String networkPartitionId) throws RemoteException, CloudControllerServiceInvalidPartitionExceptionException, - CloudControllerServiceInvalidCartridgeTypeExceptionException { + CloudControllerServiceInvalidCartridgeTypeExceptionException { stub.validateDeploymentPolicyNetworkPartition(cartridgeType, networkPartitionId); } public void addNetworkPartition(NetworkPartition networkPartition) throws RemoteException, CloudControllerServiceNetworkPartitionAlreadyExistsExceptionException, - CloudControllerServiceInvalidNetworkPartitionExceptionException { + CloudControllerServiceInvalidNetworkPartitionExceptionException { stub.addNetworkPartition(networkPartition); } @@ -226,7 +241,7 @@ public class CloudControllerServiceClient { } public void createClusterInstance(String serviceType, String clusterId, String alias, String instanceId, - String partitionId, String networkPartitionId) throws RemoteException { + String partitionId, String networkPartitionId) throws RemoteException { try { stub.createClusterInstance(serviceType, clusterId, alias, instanceId, partitionId, networkPartitionId); http://git-wip-us.apache.org/repos/asf/stratos/blob/b063eb42/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/StratosManagerServiceClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/StratosManagerServiceClient.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/StratosManagerServiceClient.java index a7dd9ad..e034c54 100644 --- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/StratosManagerServiceClient.java +++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/client/StratosManagerServiceClient.java @@ -20,7 +20,13 @@ package org.apache.stratos.common.client; import org.apache.axis2.AxisFault; +import org.apache.axis2.Constants; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.context.ConfigurationContextFactory; import org.apache.axis2.transport.http.HTTPConstants; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; +import org.apache.commons.httpclient.params.HttpConnectionManagerParams; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -38,27 +44,39 @@ import java.rmi.RemoteException; * Stratos manager service client. */ public class StratosManagerServiceClient { - - private StratosManagerServiceStub stub; - private static final Log log = LogFactory.getLog(StratosManagerServiceClient.class); private static volatile StratosManagerServiceClient instance; + private StratosManagerServiceStub stub; + private StratosManagerServiceClient(String epr) throws AxisFault { + MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new + MultiThreadedHttpConnectionManager(); + HttpConnectionManagerParams params = new HttpConnectionManagerParams(); + params.setDefaultMaxConnectionsPerHost(StratosConstants.STRATOS_MANAGER_CLIENT_MAX_CONNECTIONS_PER_HOST); + params.setMaxTotalConnections(StratosConstants.STRATOS_MANAGER_CLIENT_MAX_TOTAL_CONNECTIONS); + multiThreadedHttpConnectionManager.setParams(params); + HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager); + ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); + ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); String ccSocketTimeout = System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_SOCKET_TIMEOUT) == null ? StratosConstants.DEFAULT_CLIENT_SOCKET_TIMEOUT : System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_SOCKET_TIMEOUT); - String ccConnectionTimeout = System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT) == null ? + String ccConnectionTimeout = System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT) + == null ? StratosConstants.DEFAULT_CLIENT_CONNECTION_TIMEOUT : System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT); - try { - stub = new StratosManagerServiceStub(epr); - stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, Integer.valueOf(ccSocketTimeout)); - stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, Integer.valueOf(ccConnectionTimeout)); - + stub = new StratosManagerServiceStub(ctx, epr); + stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, Integer.valueOf + (ccSocketTimeout)); + stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, Integer.valueOf + (ccConnectionTimeout)); + stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE); + stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean + .TRUE); } catch (AxisFault axisFault) { String msg = "Could not initialize stratos manager service client"; log.error(msg, axisFault); @@ -87,7 +105,8 @@ public class StratosManagerServiceClient { * * @param applicationSignUp */ - public void addApplicationSignUp(ApplicationSignUp applicationSignUp) throws StratosManagerServiceApplicationSignUpExceptionException, RemoteException { + public void addApplicationSignUp(ApplicationSignUp applicationSignUp) throws + StratosManagerServiceApplicationSignUpExceptionException, RemoteException { stub.addApplicationSignUp(applicationSignUp); } @@ -97,7 +116,8 @@ public class StratosManagerServiceClient { * @param applicationId * @param tenantId */ - public void removeApplicationSignUp(String applicationId, int tenantId) throws StratosManagerServiceApplicationSignUpExceptionException, RemoteException { + public void removeApplicationSignUp(String applicationId, int tenantId) throws + StratosManagerServiceApplicationSignUpExceptionException, RemoteException { stub.removeApplicationSignUp(applicationId, tenantId); } @@ -108,30 +128,35 @@ public class StratosManagerServiceClient { * @param tenantId * @return */ - public ApplicationSignUp getApplicationSignUp(String applicationId, int tenantId) throws StratosManagerServiceApplicationSignUpExceptionException, RemoteException { + public ApplicationSignUp getApplicationSignUp(String applicationId, int tenantId) throws + StratosManagerServiceApplicationSignUpExceptionException, RemoteException { return stub.getApplicationSignUp(applicationId, tenantId); } /** * Check application signup availability + * * @param applicationId * @param tenantId * @return * @throws StratosManagerServiceApplicationSignUpExceptionException * @throws RemoteException */ - public boolean applicationSignUpExist(String applicationId, int tenantId) throws StratosManagerServiceApplicationSignUpExceptionException, RemoteException { + public boolean applicationSignUpExist(String applicationId, int tenantId) throws + StratosManagerServiceApplicationSignUpExceptionException, RemoteException { return stub.applicationSignUpExist(applicationId, tenantId); } /** * Check application signup availability + * * @param applicationId * @return * @throws StratosManagerServiceApplicationSignUpExceptionException * @throws RemoteException */ - public boolean applicationSignUpsExist(String applicationId) throws StratosManagerServiceApplicationSignUpExceptionException, RemoteException { + public boolean applicationSignUpsExist(String applicationId) throws + StratosManagerServiceApplicationSignUpExceptionException, RemoteException { return stub.applicationSignUpsExist(applicationId); } @@ -140,7 +165,8 @@ public class StratosManagerServiceClient { * * @return */ - public ApplicationSignUp[] getApplicationSignUps(String applicationId) throws StratosManagerServiceApplicationSignUpExceptionException, RemoteException { + public ApplicationSignUp[] getApplicationSignUps(String applicationId) throws + StratosManagerServiceApplicationSignUpExceptionException, RemoteException { return stub.getApplicationSignUps(applicationId); } @@ -152,7 +178,8 @@ public class StratosManagerServiceClient { * @throws StratosManagerServiceArtifactDistributionCoordinatorExceptionException * @throws RemoteException */ - public void notifyArtifactUpdatedEventForSignUp(String applicationId, int tenantId) throws StratosManagerServiceArtifactDistributionCoordinatorExceptionException, RemoteException { + public void notifyArtifactUpdatedEventForSignUp(String applicationId, int tenantId) throws + StratosManagerServiceArtifactDistributionCoordinatorExceptionException, RemoteException { stub.notifyArtifactUpdatedEventForSignUp(applicationId, tenantId); } @@ -163,19 +190,23 @@ public class StratosManagerServiceClient { * @throws StratosManagerServiceArtifactDistributionCoordinatorExceptionException * @throws RemoteException */ - public void notifyArtifactUpdatedEventForRepository(String repoUrl) throws StratosManagerServiceArtifactDistributionCoordinatorExceptionException, RemoteException { + public void notifyArtifactUpdatedEventForRepository(String repoUrl) throws + StratosManagerServiceArtifactDistributionCoordinatorExceptionException, RemoteException { stub.notifyArtifactUpdatedEventForRepository(repoUrl); } - public void addDomainMapping(DomainMapping domainMapping) throws RemoteException, StratosManagerServiceDomainMappingExceptionException { + public void addDomainMapping(DomainMapping domainMapping) throws RemoteException, + StratosManagerServiceDomainMappingExceptionException { stub.addDomainMapping(domainMapping); } - public void removeDomainMapping(String applicationId, int tenantId, String domainName) throws RemoteException, StratosManagerServiceDomainMappingExceptionException { + public void removeDomainMapping(String applicationId, int tenantId, String domainName) throws RemoteException, + StratosManagerServiceDomainMappingExceptionException { stub.removeDomainMapping(applicationId, tenantId, domainName); } - public DomainMapping[] getDomainMappings(String applicationId, int tenantId) throws RemoteException, StratosManagerServiceDomainMappingExceptionException { + public DomainMapping[] getDomainMappings(String applicationId, int tenantId) throws RemoteException, + StratosManagerServiceDomainMappingExceptionException { return stub.getDomainMappings(applicationId, tenantId); } @@ -186,7 +217,8 @@ public class StratosManagerServiceClient { * @param cartridgeNames the cartridge names * @throws RemoteException the remote exception */ - public void addUsedCartridgesInCartridgeGroups(String cartridgeGroupName, String[] cartridgeNames) throws RemoteException { + public void addUsedCartridgesInCartridgeGroups(String cartridgeGroupName, String[] cartridgeNames) throws + RemoteException { stub.addUsedCartridgesInCartridgeGroups(cartridgeGroupName, cartridgeNames); } @@ -197,7 +229,8 @@ public class StratosManagerServiceClient { * @param cartridgeNames the cartridge names * @throws RemoteException the remote exception */ - public void removeUsedCartridgesInCartridgeGroups(String cartridgeGroupName, String[] cartridgeNames) throws RemoteException { + public void removeUsedCartridgesInCartridgeGroups(String cartridgeGroupName, String[] cartridgeNames) throws + RemoteException { stub.removeUsedCartridgesInCartridgeGroups(cartridgeGroupName, cartridgeNames); } @@ -208,7 +241,8 @@ public class StratosManagerServiceClient { * @param cartridgeNames the cartridge names * @throws RemoteException the remote exception */ - public void addUsedCartridgesInApplications(String applicationName, String[] cartridgeNames) throws RemoteException { + public void addUsedCartridgesInApplications(String applicationName, String[] cartridgeNames) throws + RemoteException { stub.addUsedCartridgesInApplications(applicationName, cartridgeNames); } @@ -219,7 +253,8 @@ public class StratosManagerServiceClient { * @param cartridgeNames the cartridge names * @throws RemoteException the remote exception */ - public void removeUsedCartridgesInApplications(String applicationName, String[] cartridgeNames) throws RemoteException { + public void removeUsedCartridgesInApplications(String applicationName, String[] cartridgeNames) throws + RemoteException { stub.removeUsedCartridgesInApplications(applicationName, cartridgeNames); } @@ -241,7 +276,8 @@ public class StratosManagerServiceClient { * @param cartridgeGroupNames the cartridge group names * @throws RemoteException the remote exception */ - public void addUsedCartridgeGroupsInCartridgeSubGroups(String cartridgeSubGroupName, String[] cartridgeGroupNames) throws RemoteException { + public void addUsedCartridgeGroupsInCartridgeSubGroups(String cartridgeSubGroupName, String[] + cartridgeGroupNames) throws RemoteException { stub.addUsedCartridgeGroupsInCartridgeSubGroups(cartridgeSubGroupName, cartridgeGroupNames); } @@ -252,7 +288,8 @@ public class StratosManagerServiceClient { * @param cartridgeGroupNames the cartridge group names * @throws RemoteException the remote exception */ - public void removeUsedCartridgeGroupsInCartridgeSubGroups(String cartridgeSubGroupName, String[] cartridgeGroupNames) throws RemoteException { + public void removeUsedCartridgeGroupsInCartridgeSubGroups(String cartridgeSubGroupName, String[] + cartridgeGroupNames) throws RemoteException { stub.removeUsedCartridgeGroupsInCartridgeSubGroups(cartridgeSubGroupName, cartridgeGroupNames); } @@ -263,7 +300,8 @@ public class StratosManagerServiceClient { * @param cartridgeGroupNames the cartridge group names * @throws RemoteException the remote exception */ - public void addUsedCartridgeGroupsInApplications(String applicationName, String[] cartridgeGroupNames) throws RemoteException { + public void addUsedCartridgeGroupsInApplications(String applicationName, String[] cartridgeGroupNames) throws + RemoteException { stub.addUsedCartridgeGroupsInApplications(applicationName, cartridgeGroupNames); } @@ -274,7 +312,8 @@ public class StratosManagerServiceClient { * @param cartridgeGroupNames the cartridge group names * @throws RemoteException the remote exception */ - public void removeUsedCartridgeGroupsInApplications(String applicationName, String[] cartridgeGroupNames) throws RemoteException { + public void removeUsedCartridgeGroupsInApplications(String applicationName, String[] cartridgeGroupNames) throws + RemoteException { stub.removeUsedCartridgeGroupsInApplications(applicationName, cartridgeGroupNames); } http://git-wip-us.apache.org/repos/asf/stratos/blob/b063eb42/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java index 143de54..4af5656 100644 --- a/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java +++ b/components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/constants/StratosConstants.java @@ -91,7 +91,8 @@ public class StratosConstants { // metering constants public static final String THROTTLING_ALL_ACTION = "all_actions"; - public static final String THROTTLING_IN_DATA_ACTION = "in_data_action"; //this covers registry capacity + registry bandwidth + public static final String THROTTLING_IN_DATA_ACTION = "in_data_action"; //this covers registry capacity + + // registry bandwidth public static final String THROTTLING_OUT_DATA_ACTION = "out_data_action"; //this covers registry bandwidth public static final String THROTTLING_ADD_USER_ACTION = "add_user_action"; public static final String THROTTLING_SERVICE_IN_BANDWIDTH_ACTION = "service_in_bandwith_action"; @@ -121,18 +122,16 @@ public class StratosConstants { // EULA location public static final String STRATOS_EULA = "eula.xml"; - - // EULA default text. - public static final String STRATOS_EULA_DEFAULT_TEXT = - "Please refer to: " + StratosConstants.STRATOS_TERMS_OF_USAGE + - " for terms and usage and " + StratosConstants.STRATOS_PRIVACY_POLICY + - " for privacy policy of WSO2 Stratos."; - // Web location of Terms of Usage and privacy policy public static final String STRATOS_TERMS_OF_USAGE = "http://wso2.com/cloud/services/terms-of-use/"; public static final String STRATOS_PRIVACY_POLICY = "http://wso2.com/cloud/services/privacy-policy/"; + // EULA default text. + public static final String STRATOS_EULA_DEFAULT_TEXT = + "Please refer to: " + StratosConstants.STRATOS_TERMS_OF_USAGE + + " for terms and usage and " + StratosConstants.STRATOS_PRIVACY_POLICY + + " for privacy policy of WSO2 Stratos."; public static final String MULTITENANCY_FREE_PLAN = "Demo"; public static final String MULTITENANCY_SMALL_PLAN = "SMB"; public static final String MULTITENANCY_MEDIUM_PLAN = "Professional"; @@ -167,7 +166,8 @@ public class StratosConstants { public static final String PENDING_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.pendingMemberExpiryTimeout"; public static final String SPIN_TERMINATE_PARALLEL = "autoscaler.member.spinAfterTerminate"; public static final String OBSOLETED_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.obsoletedMemberExpiryTimeout"; - public static final String PENDING_TERMINATION_MEMBER_EXPIRY_TIMEOUT = "autoscaler.member.pendingTerminationMemberExpiryTimeout"; + public static final String PENDING_TERMINATION_MEMBER_EXPIRY_TIMEOUT = + "autoscaler.member.pendingTerminationMemberExpiryTimeout"; public static final String FILTER_VALUE_SEPARATOR = ","; public static final String TOPOLOGY_APPLICATION_FILTER = "stratos.topology.application.filter"; @@ -196,6 +196,36 @@ public class StratosConstants { public static final String STRATOS_MANAGER_CLIENT_SOCKET_TIMEOUT = "stratos.manager.socket.timeout"; public static final String STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT = "stratos.manager.connection.timeout"; + // Axis2 HTTP client max connections per host + public static final String STRATOS_MANAGER_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY = + "stratos.manager.client.max.connections.per.host"; + public static final String AUTOSCALER_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY = + "autoscaler.client.max.connections.per.host"; + public static final String CLOUD_CONTROLLER_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY = + "cloud.controller.client.max.connections.per.host"; + + public static final int STRATOS_MANAGER_CLIENT_MAX_CONNECTIONS_PER_HOST = Integer.getInteger + (STRATOS_MANAGER_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY, 20); + public static final int AUTOSCALER_CLIENT_MAX_CONNECTIONS_PER_HOST = Integer.getInteger + (AUTOSCALER_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY, 20); + public static final int CLOUD_CONTROLLER_CLIENT_MAX_CONNECTIONS_PER_HOST = Integer.getInteger + (CLOUD_CONTROLLER_CLIENT_MAX_CONNECTIONS_PER_HOST_KEY, 25); + + // Axis2 HTTP client max total connections + public static final String STRATOS_MANAGER_CLIENT_MAX_TOTAL_CONNECTIONS_KEY = + "stratos.manager.client.max.total.connections"; + public static final String AUTOSCALER_CLIENT_MAX_TOTAL_CONNECTIONS_KEY = "autoscaler.client.max.total.connections"; + public static final String CLOUD_CONTROLLER_CLIENT_MAX_TOTAL_CONNECTIONS_KEY = + "cloud.controller.client.max.total.connections"; + + public static final int STRATOS_MANAGER_CLIENT_MAX_TOTAL_CONNECTIONS = Integer.getInteger + (STRATOS_MANAGER_CLIENT_MAX_TOTAL_CONNECTIONS_KEY, 30); + public static final int AUTOSCALER_CLIENT_MAX_TOTAL_CONNECTIONS = Integer.getInteger + (AUTOSCALER_CLIENT_MAX_TOTAL_CONNECTIONS_KEY, 30); + public static final int CLOUD_CONTROLLER_CLIENT_MAX_TOTAL_CONNECTIONS = Integer.getInteger + (CLOUD_CONTROLLER_CLIENT_MAX_TOTAL_CONNECTIONS_KEY, 30); + + // service clients default socket timeout public static final String DEFAULT_CLIENT_SOCKET_TIMEOUT = "300000"; public static final String DEFAULT_CLIENT_CONNECTION_TIMEOUT = "300000"; http://git-wip-us.apache.org/repos/asf/stratos/blob/b063eb42/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java index 4c4237a..79f633b 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/StratosManagerService.java @@ -36,7 +36,7 @@ public interface StratosManagerService { * @param applicationSignUp * @throws ApplicationSignUpException */ - public void addApplicationSignUp(ApplicationSignUp applicationSignUp) throws ApplicationSignUpException; + public boolean addApplicationSignUp(ApplicationSignUp applicationSignUp) throws ApplicationSignUpException; /** * Remove application signup. @@ -44,7 +44,7 @@ public interface StratosManagerService { * @param applicationId * @param tenantId */ - public void removeApplicationSignUp(String applicationId, int tenantId) throws ApplicationSignUpException; + public boolean removeApplicationSignUp(String applicationId, int tenantId) throws ApplicationSignUpException; /** * Get application signup. @@ -96,7 +96,7 @@ public interface StratosManagerService { * @param repoUrl * @throws ArtifactDistributionCoordinatorException */ - public void notifyArtifactUpdatedEventForRepository(String repoUrl) throws ArtifactDistributionCoordinatorException; + public boolean notifyArtifactUpdatedEventForRepository(String repoUrl) throws ArtifactDistributionCoordinatorException; /** * Add domain mapping http://git-wip-us.apache.org/repos/asf/stratos/blob/b063eb42/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java index c164e1c..2bccfa8 100644 --- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java +++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/services/impl/StratosManagerServiceImpl.java @@ -48,13 +48,15 @@ public class StratosManagerServiceImpl implements StratosManagerService { } @Override - public void addApplicationSignUp(ApplicationSignUp applicationSignUp) throws ApplicationSignUpException { + public boolean addApplicationSignUp(ApplicationSignUp applicationSignUp) throws ApplicationSignUpException { signUpHandler.addApplicationSignUp(applicationSignUp); + return true; } @Override - public void removeApplicationSignUp(String applicationId, int tenantId) throws ApplicationSignUpException { + public boolean removeApplicationSignUp(String applicationId, int tenantId) throws ApplicationSignUpException { signUpHandler.removeApplicationSignUp(applicationId, tenantId); + return true; } @Override @@ -83,8 +85,10 @@ public class StratosManagerServiceImpl implements StratosManagerService { } @Override - public void notifyArtifactUpdatedEventForRepository(String repoUrl) throws ArtifactDistributionCoordinatorException { + public boolean notifyArtifactUpdatedEventForRepository(String repoUrl) throws + ArtifactDistributionCoordinatorException { artifactDistributionCoordinator.notifyArtifactUpdatedEventForRepository(repoUrl); + return true; } @Override
