You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2013/10/17 07:17:48 UTC
[1/2] git commit: Messaging component added to components pom.xml
Updated Branches:
refs/heads/master bff992916 -> 1d112b4a8
Messaging component added to components pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/6f1b760e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/6f1b760e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/6f1b760e
Branch: refs/heads/master
Commit: 6f1b760ed9cf97601e35f44c1de417b1f362342a
Parents: bff9929
Author: Imesh Gunaratne <im...@apache.org>
Authored: Thu Oct 17 10:34:20 2013 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Oct 17 10:34:20 2013 +0530
----------------------------------------------------------------------
components/pom.xml | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6f1b760e/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index 0b5632b..ff6c6f9 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -35,13 +35,13 @@
<name>Apache Stratos - Components - Parent Module</name>
<url>http://apache.org</url>
- <modules>
- <!-- COMMON -->
- <module>org.apache.stratos.common</module>
-
+ <modules>
+ <!-- Common -->
+ <module>org.apache.stratos.common</module>
+ <!-- Messaging -->
+ <module>org.apache.stratos.messaging</module>
<!-- Autoscaler -->
- <module>org.apache.stratos.autoscaler</module>
-
+ <module>org.apache.stratos.autoscaler</module>
<!-- CC -->
<module>org.apache.stratos.cloud.controller</module>
<module>org.apache.stratos.cartridge.messages</module>
@@ -53,10 +53,7 @@
<!-- CLI -->
<module>org.apache.stratos.cli</module>
<!-- ELB -->
- <module>org.apache.stratos.lb.common</module>
<module>org.apache.stratos.lb.endpoint</module>
- <module>org.apache.stratos.lb.agent</module>
- <module>org.apache.stratos.mediator.autoscale</module>
<!-- Tenant Mgt -->
<module>org.apache.stratos.register.ui</module>
<module>org.apache.stratos.tenant.mgt.core</module>
[2/2] git commit: Removed un-used files from lb endpoint
Posted by im...@apache.org.
Removed un-used files from lb endpoint
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/1d112b4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/1d112b4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/1d112b4a
Branch: refs/heads/master
Commit: 1d112b4a89e5b659a23a731c97a16094ed9ba6bf
Parents: 6f1b760
Author: Imesh Gunaratne <im...@apache.org>
Authored: Thu Oct 17 10:47:27 2013 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Thu Oct 17 10:47:27 2013 +0530
----------------------------------------------------------------------
.../stratos/lb/endpoint/EndpointConstants.java | 31 ---
.../TenantLoadBalanceMembershipHandler.java | 208 -----------------
.../lb/endpoint/builder/TopologySyncher.java | 151 ------------
.../manager/ClusterDomainManagerImpl.java | 228 -------------------
.../group/mgt/GroupMgtAgentBuilder.java | 82 -------
.../lb/endpoint/internal/RegistryManager.java | 54 -----
.../endpoint/subscriber/TopologyListener.java | 47 ----
.../topology/TopologyEventMessageProcessor.java | 3 -
.../stratos/lb/endpoint/util/ConfigHolder.java | 192 ----------------
.../lb/endpoint/util/TopologyConstants.java | 29 ---
.../stratos/lb/endpoint/util/Transformer.java | 41 ----
11 files changed, 1066 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java
deleted file mode 100644
index d3c2303..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/EndpointConstants.java
+++ /dev/null
@@ -1,31 +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.lb.endpoint;
-
-/**
- * The <code>EndpointConstants</code> class defined the endpoint constants.
- */
-public class EndpointConstants {
-
- public static final String ADDRESS_ENDPOINT = "Address Endpoint";
- public static final String WSDL_ENDPOINT = "WSDL Endpoint";
- public static final String FAILOVER_ENDPOINT = "Failover Group";
- public static final String LOADBALANCE_ENDPOINT = "Loadbalance Endpoint";
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/TenantLoadBalanceMembershipHandler.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/TenantLoadBalanceMembershipHandler.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/TenantLoadBalanceMembershipHandler.java
deleted file mode 100644
index 07208cb..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/TenantLoadBalanceMembershipHandler.java
+++ /dev/null
@@ -1,208 +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.lb.endpoint;
-
-
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.axis2.clustering.Member;
-import org.apache.axis2.clustering.management.GroupManagementAgent;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.stratos.lb.endpoint.util.ConfigHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
-import org.apache.synapse.core.LoadBalanceMembershipHandler;
-import org.apache.synapse.endpoints.algorithms.AlgorithmContext;
-import org.apache.synapse.endpoints.algorithms.LoadbalanceAlgorithm;
-import org.apache.stratos.lb.common.conf.util.HostContext;
-import org.wso2.carbon.user.api.UserStoreException;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Bridge between Axis2 membership notification and Synapse load balancing
- */
-public class TenantLoadBalanceMembershipHandler implements LoadBalanceMembershipHandler {
- private static final Log log = LogFactory.getLog(TenantLoadBalanceMembershipHandler.class);
-
- private ConfigurationContext configCtx;
-
- private LoadbalanceAlgorithm lbAlgo;
-
- /**
- * Key - Host, Value - HostContext
- */
- private static Map<String, HostContext> hostContextsMap =
- new HashMap<String, HostContext>();
-
- private ClusteringAgent clusteringAgent;
-
- private boolean isClusteringEnabled;
- private String endpointName;
-
- public TenantLoadBalanceMembershipHandler(Map<String, HostContext> hostContexts,
- LoadbalanceAlgorithm algorithm,
- ConfigurationContext configCtx,
- boolean isClusteringEnabled,
- String endpointName) {
-
- lbAlgo = algorithm;
- this.isClusteringEnabled = isClusteringEnabled;
- this.endpointName = endpointName;
- this.configCtx = configCtx;
-
- for (HostContext host : hostContexts.values()) {
-
- addHostContext(host);
-
- }
- }
-
- /**
- * This will be used to add new {@link HostContext}s.
- * @param host {@link HostContext}
- */
- public void addHostContext(HostContext host){
-
- String hostName = host.getHostName();
-
- AlgorithmContext algorithmContext =
- new AlgorithmContext(isClusteringEnabled,
- configCtx, endpointName + "." +
- hostName);
-
- host.setAlgorithm(lbAlgo.clone());
- host.setAlgorithmContext(algorithmContext);
-
- hostContextsMap.put(hostName, host);
-
- }
-
- /**
- * This will be used to remove an existing {@link HostContext}s.
- * @param host {@link HostContext}
- */
- public void removeHostContext(String host){
-
- hostContextsMap.remove(host);
-
- }
-
- public void init(Properties props, LoadbalanceAlgorithm algorithm) {
- // Nothing to do
- }
-
- public void setConfigurationContext(ConfigurationContext configCtx) {
- this.configCtx = configCtx;
-
- // The following code does the bridging between Axis2 and Synapse load balancing
- clusteringAgent = configCtx.getAxisConfiguration().getClusteringAgent();
- if (clusteringAgent == null) {
- String msg = "In order to enable load balancing across an Axis2 cluster, " +
- "the cluster entry should be enabled in the axis2.xml file";
- log.error(msg);
- throw new SynapseException(msg);
- }
- }
-
- public ConfigurationContext getConfigurationContext() {
- return configCtx;
- }
-
- /**
- * Getting the next member to which the request has to be sent in a round-robin fashion
- *
- * @param context The AlgorithmContext
- * @return The current member
- * @deprecated Use {@link #getNextApplicationMember(String, int)}
- */
- public Member getNextApplicationMember(AlgorithmContext context) {
- throw new UnsupportedOperationException("This operation is invalid. " +
- "Call getNextApplicationMember(String host)");
- }
-
- public boolean isAValidHostName(String host){
- if(getHostContext(host) != null){
- return true;
- }
- return false;
- }
-
- public Member getNextApplicationMember(String host, int tenantId) {
- HostContext hostContext = getHostContext(host);
-
- if(hostContext == null){
- String msg = "Invalid host name : " + host;
- log.error(msg);
- throw new SynapseException(msg);
- }
-
- // here we have to pass tenant id to get domain from hostContext
- String domain = hostContext.getDomainFromTenantId(tenantId);
- String subDomain = hostContext.getSubDomainFromTenantId(tenantId);
-
- LoadbalanceAlgorithm algorithm = hostContext.getAlgorithm();
- GroupManagementAgent groupMgtAgent = clusteringAgent.getGroupManagementAgent(domain, subDomain);
-
- if (groupMgtAgent == null) {
- String tenantDomain;
- try {
- tenantDomain = ConfigHolder.getInstance().getRealmService().getTenantManager().getDomain(tenantId);
- } catch (UserStoreException ignore) {
- tenantDomain = ""+tenantId;
- }
-
- String msg =
- "No Group Management Agent found for the domain: " + domain + ", subDomain: "
- + subDomain + ", host: " + host+ " and for tenant: "
- + tenantDomain;
- log.error(msg);
- throw new SynapseException(msg);
- }
- algorithm.setApplicationMembers(groupMgtAgent.getMembers());
- AlgorithmContext context = hostContext.getAlgorithmContext();
- return algorithm.getNextApplicationMember(context);
- }
-
- public HostContext getHostContext(String host) {
- HostContext hostContext = hostContextsMap.get(host);
- if (hostContext == null) {
- int indexOfDot;
- if ((indexOfDot = host.indexOf(".")) != -1) {
- hostContext = getHostContext(host.substring(indexOfDot + 1));
- }
- }
- return hostContext;
- }
-
- public LoadbalanceAlgorithm getLoadbalanceAlgorithm() {
- return lbAlgo;
- }
-
- public Properties getProperties() {
- return null;
- }
-
- public ClusteringAgent getClusteringAgent() {
- return clusteringAgent;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/builder/TopologySyncher.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/builder/TopologySyncher.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/builder/TopologySyncher.java
deleted file mode 100644
index a90d676..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/builder/TopologySyncher.java
+++ /dev/null
@@ -1,151 +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.lb.endpoint.builder;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.BlockingQueue;
-
-import org.apache.stratos.lb.endpoint.util.ConfigHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration;
-import org.apache.stratos.lb.common.conf.structure.Node;
-import org.apache.stratos.lb.common.conf.structure.NodeBuilder;
-import org.apache.stratos.lb.common.conf.util.HostContext;
-import org.apache.stratos.lb.common.conf.util.TenantDomainContext;
-import org.apache.stratos.lb.endpoint.TenantLoadBalanceMembershipHandler;
-import org.apache.stratos.lb.endpoint.group.mgt.GroupMgtAgentBuilder;
-
-/**
- * A Thread, which is responsible for making a sense out of a message received for
- * ELB via topology synchronization.
- */
-public class TopologySyncher implements Runnable {
-
- private static final Log log = LogFactory.getLog(TopologySyncher.class);
-
- /*
- * This is a reference to sharedTopologyQueue ConfigHolder.
- */
- private BlockingQueue<String> sharedQueue;
-
- public TopologySyncher(BlockingQueue<String> queue) {
-
- sharedQueue = queue;
-
- }
-
- @Override
- public void run() {
- // grab the lb configuration instance
- LoadBalancerConfiguration lbconfig = LoadBalancerConfiguration
- .getInstance();
-
- // FIXME Currently there has to be at least one dummy cluster defined in
- // the loadbalancer
- // conf
- // in order to proper initialization of TribesClusteringAgent.
- generateGroupMgtAgents(lbconfig);
-
- // this thread should run for ever, untill terminated.
- while (true) {
- try {
-
- // grabs a message or waits till the queue is non-empty
- String message = sharedQueue.take();
-
- // build the nginx format of this message, and get the Node
- // object
- Node topologyNode = NodeBuilder.buildNode(message);
-
- // create new service configurations
- List<ServiceConfiguration> currentServiceConfigs = lbconfig
- .createServicesConfig(topologyNode);
-
- generateGroupMgtAgents(lbconfig);
-
- removeGroupMgtAgents(lbconfig, currentServiceConfigs);
-
- } catch (InterruptedException ignore) {
- }
- }
-
- }
-
- private void removeGroupMgtAgents(LoadBalancerConfiguration lbConfig, List<ServiceConfiguration> currentServiceConfigs) {
-
- for (Iterator iterator = lbConfig.getServiceConfigurations().values().iterator(); iterator.hasNext();) {
- Map<String, ServiceConfiguration> valuesMap = (Map<String, ServiceConfiguration>) iterator.next();
-
- for (Iterator iterator2 = valuesMap.values().iterator(); iterator2.hasNext();) {
- ServiceConfiguration oldServiceConfig = (ServiceConfiguration) iterator2.next();
-
- if(!currentServiceConfigs.contains(oldServiceConfig)){
- // if the ServiceConfiguration is not there any more in the latest topology
- lbConfig.removeServiceConfiguration(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
- GroupMgtAgentBuilder.resetGroupMgtAgent(oldServiceConfig.getDomain(), oldServiceConfig.getSubDomain());
- }
- }
- }
- }
-
- /**
- * @param lbconfig
- */
- private void generateGroupMgtAgents(LoadBalancerConfiguration lbconfig) {
- TenantLoadBalanceMembershipHandler handler =
- ConfigHolder.getInstance()
- .getTenantLoadBalanceMembershipHandler();
-
- if (handler == null) {
- String msg =
- "TenantLoadBalanceMembershipHandler is null. Thus, We cannot proceed.";
- log.error(msg);
- throw new SynapseException(msg);
- }
-
- Map<String, HostContext> hostContexts = lbconfig.getHostContextMap();
-
- // Add the Axis2 GroupManagement agents
- if (hostContexts != null) {
- // iterate through each host context
- for (HostContext hostCtxt : hostContexts.values()) {
- // each host can has multiple Tenant Contexts, iterate through them
- for (TenantDomainContext tenantCtxt : hostCtxt
- .getTenantDomainContexts()) {
-
- String domain = tenantCtxt.getDomain();
- String subDomain = tenantCtxt.getSubDomain();
-
- // creates the group management agent
- GroupMgtAgentBuilder.createGroupMgtAgent(domain,
- subDomain);
- }
-
- // add to the handler
- handler.addHostContext(hostCtxt);
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/cluster/manager/ClusterDomainManagerImpl.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/cluster/manager/ClusterDomainManagerImpl.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/cluster/manager/ClusterDomainManagerImpl.java
deleted file mode 100644
index a0e1022..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/cluster/manager/ClusterDomainManagerImpl.java
+++ /dev/null
@@ -1,228 +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.lb.endpoint.cluster.manager;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.stratos.lb.endpoint.util.ConfigHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
-import org.apache.stratos.cartridge.messages.ClusterDomainManager;
-import org.apache.stratos.cartridge.messages.ClusterDomain;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration.ServiceConfiguration;
-import org.apache.stratos.lb.common.conf.util.Constants;
-import org.apache.stratos.lb.common.conf.util.HostContext;
-import org.apache.stratos.lb.common.conf.util.TenantDomainContext;
-import org.apache.stratos.lb.common.group.mgt.SubDomainAwareGroupManagementAgent;
-import org.apache.stratos.lb.endpoint.TenantLoadBalanceMembershipHandler;
-
-/**
- * Bridge between the ELB and the Stratos2 Agent.
- */
-public class ClusterDomainManagerImpl implements ClusterDomainManager {
-
- private static final Log log = LogFactory.getLog(ClusterDomainManagerImpl.class);
-
- @Override
- public void addClusterDomain(ClusterDomain cluster) {
-
- // create group management agent, if one doesn't exist already.
- HostContext hostCtxt = createGroupMgtAgentIfNotExists(cluster);
-
- // we should only update if the above step is successful.
- if (hostCtxt != null) {
- // create / update Service Configuration
- createOrUpdateServiceConfig(cluster, hostCtxt);
- }
-
- }
-
- @Override
- public void removeClusterDomain(String domain, String subDomain, String hostName) {
-
- TenantLoadBalanceMembershipHandler handler =
- ConfigHolder.getInstance()
- .getTenantLoadBalanceMembershipHandler();
-
- if (handler == null) {
- String msg = "TenantLoadBalanceMembershipHandler is null. Thus, We cannot proceed.";
- log.error(msg);
- throw new SynapseException(msg);
- }
-
- handler.removeHostContext(hostName);
-
- LoadBalancerConfiguration lbConfig = ConfigHolder.getInstance().getLbConfig();
-
- lbConfig.removeServiceConfiguration(domain, subDomain);
-
- }
-
- private void createOrUpdateServiceConfig(ClusterDomain cluster, HostContext ctxt) {
- LoadBalancerConfiguration lbConfig = ConfigHolder.getInstance().getLbConfig();
-
- String domain = cluster.getDomain();
- String subDomain = cluster.getSubDomain();
-
- if (subDomain == null || subDomain.isEmpty()) {
- // uses default sub domain
- subDomain = Constants.DEFAULT_SUB_DOMAIN;
- }
-
- String hostName = cluster.getHostName();
- String tenantRange = cluster.getTenantRange();
- int minInstances = cluster.getMinInstances();
- int maxInstances = cluster.getMaxInstances();
- String service = cluster.getServiceName();
- int maxRequestsPerSecond = cluster.getMaxRequestsPerSecond();
- int roundsToAverage = cluster.getRoundsToAverage();
- double alarmingUpperRate = cluster.getAlarmingUpperRate();
- double alarmingLowerRate = cluster.getAlarmingLowerRate();
- double scaleDownFactor = cluster.getScaleDownFactor();
-
- ServiceConfiguration serviceConfig ;
-
- if((serviceConfig = lbConfig.getServiceConfig(domain, subDomain)) == null){
- serviceConfig = lbConfig.new ServiceConfiguration();
- }
-
- // we simply override the attributes with new values
- serviceConfig.setDomain(domain);
- serviceConfig.setSub_domain(subDomain);
- serviceConfig.setTenant_range(tenantRange);
- serviceConfig.setHosts(hostName);
- serviceConfig.setMin_app_instances(minInstances);
- serviceConfig.setMax_app_instances(maxInstances);
- serviceConfig.setMax_requests_per_second(maxRequestsPerSecond);
- serviceConfig.setRounds_to_average(roundsToAverage);
- serviceConfig.setAlarming_upper_rate(alarmingUpperRate);
- serviceConfig.setAlarming_lower_rate(alarmingLowerRate);
- serviceConfig.setScale_down_factor(scaleDownFactor);
-
- // add to host name tracker
- lbConfig.addToHostNameTrackerMap(service, serviceConfig.getHosts());
-
- // add to host contexts
- lbConfig.addToHostContextMap(hostName, ctxt);
-
- // finally add this service config
- lbConfig.addServiceConfiguration(serviceConfig);
- }
-
- protected HostContext createGroupMgtAgentIfNotExists(ClusterDomain cluster) {
-
- String domain = cluster.getDomain();
- String subDomain = cluster.getSubDomain();
- String hostName = cluster.getHostName();
- String tenantRange = cluster.getTenantRange();
-
- // sub domain can be null, but others can't
- if (domain == null || hostName == null || tenantRange == null) {
- String msg =
- "Invalid value/s detected - domain: " + domain + "\n host name: " +
- hostName + "\n tenant range: " + tenantRange;
- log.error(msg);
- throw new SynapseException(msg);
- }
-
- if (subDomain == null || subDomain.isEmpty()) {
- // uses default sub domain
- subDomain = Constants.DEFAULT_SUB_DOMAIN;
- }
-
- ClusteringAgent clusteringAgent = null;
-
- try {
- clusteringAgent =
- ConfigHolder.getInstance().getAxisConfiguration()
- .getClusteringAgent();
-
- } catch (Exception e) {
- String msg = "Failed to retrieve Clustering Agent.";
- log.error(msg, e);
- throw new SynapseException(msg, e);
-
- }
-
- if (clusteringAgent == null) {
- String msg = "Clustering Agent is null.";
- log.error(msg);
- throw new SynapseException(msg);
- }
-
- /*
- * Add Group Management Agent if one is not already present for this domain and sub
- * domain
- */
-
- if (clusteringAgent.getGroupManagementAgent(domain, subDomain) == null) {
- clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(subDomain),
- domain, subDomain,-1);
-
- if (log.isDebugEnabled()) {
- log.debug("Group management agent added to cluster domain: " + domain +
- " and sub domain: " + subDomain);
- }
-
- } else {
- if (log.isDebugEnabled()) {
- log.debug("Group management agent is already available for cluster domain: " +
- domain + " and sub domain: " + subDomain);
- }
- }
-
- TenantLoadBalanceMembershipHandler handler =
- ConfigHolder.getInstance()
- .getTenantLoadBalanceMembershipHandler();
-
- if (handler == null) {
- String msg = "TenantLoadBalanceMembershipHandler is null. Thus, We cannot proceed.";
- log.error(msg);
- throw new SynapseException(msg);
- }
-
- HostContext hostCtxt;
-
- // if there's an already registered HostContext use it
- if((hostCtxt = handler.getHostContext(hostName)) == null){
- hostCtxt = new HostContext(hostName);
- }
-
- List<TenantDomainContext> ctxts;
- ctxts = new ArrayList<TenantDomainContext>(hostCtxt.getTenantDomainContexts());
-
- // default value is super tenant mode - which is defined by tenant id 0, in this context
- int tenantId = 0;
- if(!"*".equals(tenantRange)){
- tenantId = Integer.parseInt(tenantRange);
- }
-
- ctxts.add(new TenantDomainContext(tenantId, domain, subDomain));
-
- hostCtxt.addTenantDomainContexts(ctxts);
-
- handler.addHostContext(hostCtxt);
-
- return hostCtxt;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/group/mgt/GroupMgtAgentBuilder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/group/mgt/GroupMgtAgentBuilder.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/group/mgt/GroupMgtAgentBuilder.java
deleted file mode 100644
index 9ea5a35..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/group/mgt/GroupMgtAgentBuilder.java
+++ /dev/null
@@ -1,82 +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.lb.endpoint.group.mgt;
-
-import org.apache.axis2.clustering.ClusteringAgent;
-import org.apache.axis2.clustering.management.GroupManagementAgent;
-import org.apache.stratos.lb.endpoint.util.ConfigHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.SynapseException;
-import org.apache.stratos.lb.common.group.mgt.SubDomainAwareGroupManagementAgent;
-
-/**
- * Responsible for building {@link GroupManagementAgent}s.
- */
-public class GroupMgtAgentBuilder {
-
- private static final Log log = LogFactory.getLog(GroupMgtAgentBuilder.class);
-
- /**
- * Creates a {@link SubDomainAwareGroupManagementAgent} corresponds to the given
- * parameters, if and only if there's no existing agent.
- * @param domain clustering domain.
- * @param subDomain clustering sub domain.
- */
- public static void createGroupMgtAgent(String domain, String subDomain) {
-
- ClusteringAgent clusteringAgent =
- ConfigHolder.getInstance().getAxisConfiguration().getClusteringAgent();
-
- if (clusteringAgent == null) {
- throw new SynapseException("Axis2 Clustering Agent not defined in axis2.xml");
- }
-
- // checks the existence.
- if (clusteringAgent.getGroupManagementAgent(domain, subDomain) == null) {
-
- clusteringAgent.addGroupManagementAgent(new SubDomainAwareGroupManagementAgent(subDomain),
- domain, subDomain,-1);
-
- log.info("Group management agent added to cluster domain: " +
- domain + " and sub domain: " + subDomain);
- }
- }
-
- public static void resetGroupMgtAgent(String domain, String subDomain) {
-
- ClusteringAgent clusteringAgent =
- ConfigHolder.getInstance().getAxisConfiguration().getClusteringAgent();
-
- if (clusteringAgent == null) {
- throw new SynapseException("Axis2 Clustering Agent not defined in axis2.xml");
- }
-
- // checks the existence.
- if (clusteringAgent.getGroupManagementAgent(domain, subDomain) != null) {
-
- // FIX THIS IN PROPER WAY
- // This has changed some API of axis2 and we need to send upstream before using it
- //clusteringAgent.resetGroupManagementAgent(domain, subDomain);
-
- log.info("Group management agent of cluster domain: " +
- domain + " and sub domain: " + subDomain+" is removed.");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/internal/RegistryManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/internal/RegistryManager.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/internal/RegistryManager.java
deleted file mode 100644
index 2f91002..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/internal/RegistryManager.java
+++ /dev/null
@@ -1,54 +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.lb.endpoint.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.lb.endpoint.util.ConfigHolder;
-import org.apache.stratos.lb.common.util.DomainMapping;
-import org.wso2.carbon.registry.core.Resource;
-import org.wso2.carbon.registry.core.exceptions.RegistryException;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-
-public class RegistryManager {
- UserRegistry governanceRegistry = ConfigHolder.getInstance().getGovernanceRegistry();
- private static final Log log = LogFactory.getLog(RegistryManager.class);
- /**
- *
- */
- private Resource resource = null;
- public static final String HOST_INFO = "hostinfo/";
- public static final String ACTUAL_HOST = "actual.host";
-
- public DomainMapping getMapping(String hostName) {
- DomainMapping domainMapping;
- try {
- if (governanceRegistry.resourceExists(HOST_INFO + hostName)) {
- resource = governanceRegistry.get(HOST_INFO + hostName);
- domainMapping = new DomainMapping(hostName);
- domainMapping.setActualHost(resource.getProperty(ACTUAL_HOST));
- return domainMapping;
- }
- } catch (RegistryException e) {
- log.info("Error while getting registry resource");
- throw new RuntimeException(e);
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/subscriber/TopologyListener.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/subscriber/TopologyListener.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/subscriber/TopologyListener.java
deleted file mode 100644
index ee7a3ca..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/subscriber/TopologyListener.java
+++ /dev/null
@@ -1,47 +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.lb.endpoint.subscriber;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.TextMessage;
-
-import org.apache.stratos.lb.endpoint.util.ConfigHolder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class TopologyListener implements MessageListener {
-
- private static final Log log = LogFactory.getLog(TopologyListener.class);
-
- @Override
- public void onMessage(Message message) {
- TextMessage receivedMessage = (TextMessage) message;
- try {
-
- ConfigHolder.getInstance().getSharedTopologyDiffQueue().add(receivedMessage.getText());
-
- } catch (JMSException e) {
- log.error(e.getMessage(), e);
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/topology/TopologyEventMessageProcessor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/topology/TopologyEventMessageProcessor.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/topology/TopologyEventMessageProcessor.java
index c2a8644..f39c43d 100644
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/topology/TopologyEventMessageProcessor.java
+++ b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/topology/TopologyEventMessageProcessor.java
@@ -161,9 +161,6 @@ public class TopologyEventMessageProcessor extends MessageProcessor implements R
cluster.setClusterId(event.getClusterId());
cluster.setHostName(event.getHostName());
cluster.setTenantRange(event.getTenantRange());
- cluster.setCloud(event.getCloud());
- cluster.setRegion(event.getRegion());
- cluster.setZone(event.getZone());
Service service = TopologyManager.getTopology().getService(event.getServiceName());
service.addCluster(cluster);
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/ConfigHolder.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/ConfigHolder.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/ConfigHolder.java
deleted file mode 100644
index 3817579..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/ConfigHolder.java
+++ /dev/null
@@ -1,192 +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.lb.endpoint.util;
-
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.config.SynapseConfiguration;
-import org.apache.stratos.lb.common.conf.LoadBalancerConfiguration;
-import org.apache.stratos.lb.common.service.LoadBalancerConfigurationService;
-import org.apache.stratos.lb.endpoint.TenantAwareLoadBalanceEndpointException;
-import org.apache.stratos.lb.endpoint.TenantLoadBalanceMembershipHandler;
-import org.wso2.carbon.mediation.dependency.mgt.services.DependencyManagementService;
-import org.wso2.carbon.mediation.initializer.services.SynapseEnvironmentService;
-import org.wso2.carbon.registry.core.session.UserRegistry;
-import org.wso2.carbon.user.core.service.RealmService;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-/**
- *
- */
-public class ConfigHolder {
-
- private static ConfigHolder instance;
- private static final Log log = LogFactory.getLog(ConfigHolder.class);
-
- private SynapseConfiguration synapseConfiguration;
- private ConfigurationContext configCtxt;
- private AxisConfiguration axisConfiguration;
- private UserRegistry configRegistry;
- private UserRegistry governanceRegistry;
- private DependencyManagementService dependencyManager;
- private TenantLoadBalanceMembershipHandler tenantMembershipHandler;
- private LoadBalancerConfigurationService lbConfigService;
- private BlockingQueue<String> sharedTopologyQueue = new LinkedBlockingQueue<String>();
- private String previousMsg;
-
-
- private Map<Integer, SynapseEnvironmentService> synapseEnvironmentServices =
- new HashMap<Integer, SynapseEnvironmentService>();
-
- public RealmService getRealmService() {
- return realmService;
- }
-
- public void setRealmService(RealmService realmService) {
- this.realmService = realmService;
- }
-
- private RealmService realmService;
-
- private ConfigHolder() {
- }
-
- public static ConfigHolder getInstance() {
- if (instance == null) {
- instance = new ConfigHolder();
- }
- return instance;
- }
-
- public SynapseConfiguration getSynapseConfiguration() throws TenantAwareLoadBalanceEndpointException{
- assertNull("SynapseConfiguration", synapseConfiguration);
- return synapseConfiguration;
- }
-
- public void setSynapseConfiguration(SynapseConfiguration synapseConfiguration) {
- this.synapseConfiguration = synapseConfiguration;
- }
-
- public AxisConfiguration getAxisConfiguration() throws TenantAwareLoadBalanceEndpointException {
- assertNull("AxisConfiguration", axisConfiguration);
- return axisConfiguration;
- }
-
- public void setAxisConfiguration(AxisConfiguration axisConfiguration) {
- this.axisConfiguration = axisConfiguration;
- }
-
- public UserRegistry getConfigRegistry() throws TenantAwareLoadBalanceEndpointException {
- assertNull("Registry", configRegistry);
- return configRegistry;
- }
-
- public void setConfigRegistry(UserRegistry configRegistry) {
- this.configRegistry = configRegistry;
- }
-
- public DependencyManagementService getDependencyManager() {
- return dependencyManager;
- }
-
- public void setDependencyManager(DependencyManagementService dependencyManager) {
- this.dependencyManager = dependencyManager;
- }
-
- private void assertNull(String name, Object object) throws TenantAwareLoadBalanceEndpointException {
- if (object == null) {
- String message = name + " reference in the proxy admin config holder is null";
- log.error(message);
- throw new TenantAwareLoadBalanceEndpointException(message);
- }
- }
-
- public UserRegistry getGovernanceRegistry() {
- return governanceRegistry;
- }
-
- public void setGovernanceRegistry(UserRegistry governanceRegistry) {
- this.governanceRegistry = governanceRegistry;
- }
-
- public SynapseEnvironmentService getSynapseEnvironmentService(int id) {
- return synapseEnvironmentServices.get(id);
- }
-
- public void addSynapseEnvironmentService(int id,
- SynapseEnvironmentService synapseEnvironmentService) {
- synapseEnvironmentServices.put(id, synapseEnvironmentService);
- }
-
- public void removeSynapseEnvironmentService(int id) {
- synapseEnvironmentServices.remove(id);
- }
-
- public Map<Integer, SynapseEnvironmentService> getSynapseEnvironmentServices() {
- return synapseEnvironmentServices;
- }
-
- public void setTenantLoadBalanceMembershipHandler(TenantLoadBalanceMembershipHandler handler) {
- tenantMembershipHandler = handler;
- }
-
- public TenantLoadBalanceMembershipHandler getTenantLoadBalanceMembershipHandler() {
- return tenantMembershipHandler;
- }
-
- public ConfigurationContext getConfigCtxt() {
- return configCtxt;
- }
-
- public void setConfigCtxt(ConfigurationContext configCtxt) {
- this.configCtxt = configCtxt;
- }
-
- public void setLbConfigService(LoadBalancerConfigurationService lbConfigSer) {
- this.lbConfigService = lbConfigSer;
- }
-
- public LoadBalancerConfiguration getLbConfig() {
- return (LoadBalancerConfiguration) lbConfigService.getLoadBalancerConfig();
- }
-
- public BlockingQueue<String> getSharedTopologyDiffQueue() {
- return sharedTopologyQueue;
- }
-
- public void setSharedTopologyDiffQueue(BlockingQueue<String> sharedTopologyDiffQueue) {
- this.sharedTopologyQueue = sharedTopologyDiffQueue;
- }
-
- public String getPreviousMsg() {
- return previousMsg;
- }
-
- public void setPreviousMsg(String previousMsg) {
- this.previousMsg = previousMsg;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/TopologyConstants.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/TopologyConstants.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/TopologyConstants.java
deleted file mode 100644
index eecd52b..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/TopologyConstants.java
+++ /dev/null
@@ -1,29 +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.lb.endpoint.util;
-
-public class TopologyConstants {
-
- public static final String TOPIC_NAME = "cloud-controller-topology";
-
- public static final String TOPOLOGY_SYNC_CRON = "1 * * * * ? *";
- public static final String TOPOLOGY_SYNC_TASK_NAME = "TopologySubscriberTaskOfADC";
- public static final String TOPOLOGY_SYNC_TASK_TYPE = "TOPOLOGY_SUBSCRIBER_TASK";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/1d112b4a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/Transformer.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/Transformer.java b/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/Transformer.java
deleted file mode 100644
index 3d19b50..0000000
--- a/components/org.apache.stratos.lb.endpoint/src/main/java/org/apache/stratos/lb/endpoint/util/Transformer.java
+++ /dev/null
@@ -1,41 +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.lb.endpoint.util;
-
-import org.apache.axis2.clustering.Member;
-import org.apache.stratos.messaging.domain.topology.Port;
-
-/**
- * Implements domain model transformation logic.
- */
-public class Transformer {
- public static Member transform(org.apache.stratos.messaging.domain.topology.Member topologyMember) {
- Port httpPort = topologyMember.getPort("HTTP");
- Port httpsPort = topologyMember.getPort("HTTPS");
-
- Member member = new Member(topologyMember.getHostName(), httpPort.getValue());
- member.setDomain(topologyMember.getHostName());
- member.setHttpPort(httpPort.getValue());
- member.setHttpsPort(httpsPort.getValue());
- member.setActive(topologyMember.isActive());
- member.setProperties(topologyMember.getProperties());
- return member;
- }
-}