Updated Branches:
  refs/heads/master 80f53db0b -> b746b90e4

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ade7fa98/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/MultiTenantCartridgeSubscription.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/MultiTenantCartridgeSubscription.java
 
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/MultiTenantCartridgeSubscription.java
deleted file mode 100644
index d0a0036..0000000
--- 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/MultiTenantCartridgeSubscription.java
+++ /dev/null
@@ -1,134 +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.manager.subscription;
-//
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//import org.apache.stratos.manager.dao.CartridgeSubscriptionInfo;
-//import org.apache.stratos.manager.dto.Policy;
-//import org.apache.stratos.manager.exception.*;
-//import org.apache.stratos.manager.internal.DataHolder;
-//import org.apache.stratos.manager.payload.PayloadArg;
-//import org.apache.stratos.manager.repository.Repository;
-//import org.apache.stratos.manager.subscriber.Subscriber;
-//import org.apache.stratos.manager.utils.ApplicationManagementUtil;
-//import org.apache.stratos.manager.utils.CartridgeConstants;
-//import org.apache.stratos.manager.utils.PersistenceManager;
-//import org.apache.stratos.adc.topology.mgt.service.TopologyManagementService;
-//import org.apache.stratos.adc.topology.mgt.serviceobjects.DomainContext;
-//import org.apache.stratos.cloud.controller.pojo.CartridgeInfo;
-//
-//import java.util.Properties;
-//
-//public class MultiTenantCartridgeSubscription extends CartridgeSubscription {
-//
-//    private static Log log = 
LogFactory.getLog(MultiTenantCartridgeSubscription.class);
-//
-//    public MultiTenantCartridgeSubscription(CartridgeInfo cartridgeInfo) {
-//        super(cartridgeInfo);
-//    }
-//
-//    @Override
-//    public void createSubscription(Subscriber subscriber, String alias, 
Policy autoscalingPolicy, Repository repository)
-//
-//            throws InvalidCartridgeAliasException,
-//            DuplicateCartridgeAliasException, ADCException, 
AlreadySubscribedException,
-//            RepositoryCredentialsRequiredException, 
RepositoryTransportException, UnregisteredCartridgeException,
-//            InvalidRepositoryException, RepositoryRequiredException, 
PolicyException {
-//
-//        super.createSubscription(subscriber, alias, autoscalingPolicy, 
repository);
-//
-//        boolean allowMultipleSubscription = Boolean.
-//                
valueOf(System.getProperty(CartridgeConstants.FEATURE_MULTI_TENANT_MULTIPLE_SUBSCRIPTION_ENABLED));
-//
-//        if (!allowMultipleSubscription) {
-//            // If the cartridge is multi-tenant. We should not let users 
createSubscription twice.
-//            boolean subscribed;
-//            try {
-//                subscribed = 
PersistenceManager.isAlreadySubscribed(getType(), subscriber.getTenantId());
-//            } catch (Exception e) {
-//                String msg = "Error checking whether the cartridge type " + 
getType()
-//                        + " is already subscribed";
-//                log.error(msg, e);
-//                throw new ADCException(msg, e);
-//            }
-//
-//            if (subscribed) {
-//                String msg = "Already subscribed to " + getType()
-//                        + ". This multi-tenant cartridge will not be 
available to createSubscription";
-//                if (log.isDebugEnabled()) {
-//                    log.debug(msg);
-//                }
-//                throw new AlreadySubscribedException(msg, getType());
-//            }
-//        }
-//
-//        TopologyManagementService topologyService = 
DataHolder.getTopologyMgtService();
-//        DomainContext[] domainContexts = 
topologyService.getDomainsAndSubdomains(getType(), subscriber.getTenantId());
-//        log.info("Retrieved " + domainContexts.length + " domain and 
corresponding subdomain pairs");
-//
-//        if (domainContexts.length > 0) {
-//            if(domainContexts.length > 2) {
-//                if(log.isDebugEnabled())
-//                    log.debug("Too many domain sub domain pairs");
-//            }
-//
-//            for (DomainContext domainContext : domainContexts) {
-//                if (domainContext.getSubDomain().equalsIgnoreCase("mgt")) {
-//                    
getCluster().setMgtClusterDomain(domainContext.getDomain());
-//                    
getCluster().setMgtClusterSubDomain(domainContext.getSubDomain());
-//                } else {
-//                    getCluster().setClusterDomain(domainContext.getDomain());
-//                    
getCluster().setClusterSubDomain(domainContext.getSubDomain());
-//                }
-//            }
-//        } else {
-//            String msg = "Domain contexts not found for " + getType() + " 
and tenant id " + subscriber.getTenantId();
-//            log.warn(msg);
-//            throw new ADCException(msg);
-//        }
-//    }
-//
-//    @Override
-//    public void removeSubscription() throws ADCException, 
NotSubscribedException {
-//
-//        log.info("Cartridge with alias " + getAlias() + ", and type " + 
getType() +
-//                " is a multi-tenant cartridge and therefore will not 
terminate all instances and " +
-//                "unregister services");
-//
-//        super.cleanupSubscription();
-//    }
-//
-//    @Override
-//    public CartridgeSubscriptionInfo registerSubscription(Properties 
properties) {
-//
-//        return 
ApplicationManagementUtil.createCartridgeSubscription(getCartridgeInfo(), 
getAutoscalingPolicyName(),
-//                getType(), getAlias(), getSubscriber().getTenantId(), 
getSubscriber().getTenantDomain(),
-//                getRepository(), getCluster().getHostName(), 
getCluster().getClusterDomain(), getCluster().getClusterSubDomain(),
-//                getCluster().getMgtClusterDomain(), 
getCluster().getMgtClusterSubDomain(), null, "PENDING",getSubscriptionKey());
-//    }
-//
-//    @Override
-//    public PayloadArg createPayloadParameters() {
-//
-//        return null;
-//    }
-//
-//}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ade7fa98/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/SingleTenantCartridgeSubscription.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/SingleTenantCartridgeSubscription.java
 
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/SingleTenantCartridgeSubscription.java
deleted file mode 100644
index 0185632..0000000
--- 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/subscription/SingleTenantCartridgeSubscription.java
+++ /dev/null
@@ -1,136 +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.manager.subscription;
-//
-//import org.apache.axis2.AxisFault;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-//import org.apache.stratos.manager.client.CloudControllerServiceClient;
-//import org.apache.stratos.manager.dao.CartridgeSubscriptionInfo;
-//import org.apache.stratos.manager.dto.Policy;
-//import org.apache.stratos.manager.exception.*;
-//import org.apache.stratos.manager.payload.PayloadArg;
-//import org.apache.stratos.manager.repository.Repository;
-//import org.apache.stratos.manager.subscriber.Subscriber;
-//import org.apache.stratos.manager.utils.ApplicationManagementUtil;
-//import org.apache.stratos.manager.utils.CartridgeConstants;
-//import org.apache.stratos.cloud.controller.pojo.CartridgeInfo;
-//
-//import java.util.Properties;
-//
-//public class SingleTenantCartridgeSubscription extends CartridgeSubscription 
{
-//
-//    private static Log log = 
LogFactory.getLog(SingleTenantCartridgeSubscription.class);
-//
-//
-//    public SingleTenantCartridgeSubscription(CartridgeInfo cartridgeInfo) {
-//        super(cartridgeInfo);
-//    }
-//
-//    @Override
-//    public void createSubscription(Subscriber subscriber, String alias, 
Policy autoscalingPolicy,
-//                                   Repository repository) throws
-//            InvalidCartridgeAliasException, 
DuplicateCartridgeAliasException, ADCException,
-//            RepositoryCredentialsRequiredException, 
RepositoryTransportException, UnregisteredCartridgeException,
-//            AlreadySubscribedException, RepositoryRequiredException, 
InvalidRepositoryException, PolicyException {
-//
-//        super.createSubscription(subscriber, alias, autoscalingPolicy, 
repository);
-//        getCluster().setClusterDomain(alias + "." + 
getCluster().getHostName() + "." + getType() + ".domain");
-//        getCluster().setHostName(alias + "." + getCluster().getHostName());
-//    }
-//
-//    @Override
-//    public CartridgeSubscriptionInfo registerSubscription(Properties 
payloadProperties)
-//            throws ADCException, UnregisteredCartridgeException {
-//
-//        ApplicationManagementUtil.registerService(getType(),
-//                getCluster().getClusterDomain(),
-//                getCluster().getClusterSubDomain(),
-//                getPayloadData().createPayload(),
-//                getPayloadData().getPayloadArg().getTenantRange(),
-//                getCluster().getHostName(),
-//                null);
-//
-//        getPayloadData().delete();
-//
-//        return 
ApplicationManagementUtil.createCartridgeSubscription(getCartridgeInfo(), 
getAutoscalingPolicyName(),
-//                getType(), getAlias(), getSubscriber().getTenantId(), 
getSubscriber().getTenantDomain(),
-//                getRepository(), getCluster().getHostName(), 
getCluster().getClusterDomain(), getCluster().getClusterSubDomain(),
-//                getCluster().getMgtClusterDomain(), 
getCluster().getMgtClusterSubDomain(), null, "PENDING",getSubscriptionKey());
-//    }
-//
-//    @Override
-//    public void removeSubscription() throws ADCException, 
NotSubscribedException {
-//
-//        try {
-//            
CloudControllerServiceClient.getServiceClient().terminateAllInstances(getCluster().getClusterDomain());
-//
-//        } catch (AxisFault e) {
-//            String errorMsg = "Error in terminating cartridge subscription, 
alias " + getAlias();
-//            log.error(errorMsg);
-//            throw new ADCException(errorMsg, e);
-//
-//        } catch (Exception e) {
-//            String errorMsg = "Error in terminating cartridge subscription, 
alias " + getAlias();
-//            log.error(errorMsg);
-//            throw new ADCException(errorMsg, e);
-//        }
-//
-//        log.info("Terminated all instances of " + 
getCluster().getClusterDomain() + " " + getCluster().getClusterSubDomain());
-//
-//        try {
-//            
CloudControllerServiceClient.getServiceClient().unregisterService(getCluster().getClusterDomain());
-//
-//        } catch (Exception e) {
-//            String errorMsg = "Error in unregistering service cluster with 
domain " + getCluster().getClusterDomain() +
-//                    ", sub domain " + getCluster().getClusterSubDomain();
-//            log.error(errorMsg);
-//            throw new ADCException(errorMsg, e);
-//        }
-//
-//        log.info("Unregistered service cluster, domain " + 
getCluster().getClusterDomain() + ", sub domain " +
-//                getCluster().getClusterSubDomain());
-//
-//        super.cleanupSubscription();
-//    }
-//
-//    @Override
-//    public PayloadArg createPayloadParameters()
-//            throws ADCException {
-//
-//        PayloadArg payloadArg = super.createPayloadParameters();
-//        if(getRepository() != null) {
-//            payloadArg.setRepoURL(getRepository().getUrl());
-//        }
-//        payloadArg.setHostName(getCluster().getHostName());
-//        payloadArg.setServiceDomain(getCluster().getClusterDomain());
-//        
payloadArg.setServiceSubDomain(getCluster().getMgtClusterSubDomain());
-//        payloadArg.setMgtServiceDomain(getCluster().getMgtClusterDomain());
-//        
payloadArg.setMgtServiceSubDomain(getCluster().getMgtClusterSubDomain());
-//        
if(getCartridgeInfo().getProvider().equals(CartridgeConstants.PROVIDER_NAME_WSO2))
 {
-//            
payloadArg.setTenantRange(Integer.toString(getSubscriber().getTenantId()));
-//        }
-//        else {
-//            payloadArg.setTenantRange("*");
-//        }
-//
-//        return payloadArg;
-//    }
-//}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ade7fa98/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeAppType.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeAppType.java
 
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeAppType.java
deleted file mode 100644
index ed794dc..0000000
--- 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeAppType.java
+++ /dev/null
@@ -1,44 +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.manager.utils;
-//
-///**
-// *
-// */
-//public class CartridgeAppType {
-//     private String appType;
-//     private boolean appSpecificMapping;
-//
-//     public String getAppType() {
-//             return appType;
-//     }
-//
-//     public void setAppType(String appType) {
-//             this.appType = appType;
-//     }
-//
-//     public boolean isAppSpecificMapping() {
-//             return appSpecificMapping;
-//     }
-//
-//     public void setAppSpecificMapping(boolean appSpecificMapping) {
-//             this.appSpecificMapping = appSpecificMapping;
-//     }
-//}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ade7fa98/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeDomain.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeDomain.java
 
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeDomain.java
deleted file mode 100644
index 9d0d7a7..0000000
--- 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/CartridgeDomain.java
+++ /dev/null
@@ -1,146 +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.manager.utils;
-//
-///**
-// *
-// */
-//public class CartridgeDomain {
-//
-//     private String primaryPort;
-//     private String proxyPort;
-//     private String type;
-//     private String tenantId;
-//     private int min;
-//     private int max;
-//     private String cartridgeType;
-//     private boolean volume;
-//     private String tenantDomain;
-//     private String clusterDomain;
-//     private String clusterSubDomain;
-//
-//     private String hostName;
-//     private boolean started;
-//
-//     public String getPrimaryPort() {
-//             return primaryPort;
-//     }
-//
-//     public String getProxyPort() {
-//             return proxyPort;
-//     }
-//
-//     public String getType() {
-//             return type;
-//     }
-//
-//     public String getTenantId() {
-//             return tenantId;
-//     }
-//
-//     public int getMin() {
-//             return min;
-//     }
-//
-//     public int getMax() {
-//             return max;
-//     }
-//
-//     public String getCartridgeType() {
-//             return cartridgeType;
-//     }
-//
-//     public boolean getVolume() {
-//             return volume;
-//     }
-//
-//     public String getTenantDomain() {
-//             return tenantDomain;
-//     }
-//
-//     public void setPrimaryPort(String primaryPort) {
-//             this.primaryPort = primaryPort;
-//     }
-//
-//     public void setProxyPort(String proxyPort) {
-//             this.proxyPort = proxyPort;
-//     }
-//
-//     public void setType(String type) {
-//             this.type = type;
-//     }
-//
-//     public void setTenantId(String tenantId) {
-//             this.tenantId = tenantId;
-//     }
-//
-//     public void setMin(int min) {
-//             this.min = min;
-//     }
-//
-//     public void setMax(int max) {
-//             this.max = max;
-//     }
-//
-//     public void setCartridgeType(String cartridgeType) {
-//             this.cartridgeType = cartridgeType;
-//     }
-//
-//     public void setVolume(boolean volume) {
-//             this.volume = volume;
-//     }
-//
-//     public void setTenantDomain(String tenantDomain) {
-//             this.tenantDomain = tenantDomain;
-//     }
-//
-//     public void setStarted(boolean started) {
-//             this.started = started;
-//     }
-//
-//     public boolean isStarted() {
-//             return started;
-//     }
-//
-//     public String getHostName() {
-//             return hostName;
-//     }
-//
-//     public void setHostName(String hostName) {
-//             this.hostName = hostName;
-//     }
-//
-//     public String getClusterDomain() {
-//             return clusterDomain;
-//     }
-//
-//     public void setClusterDomain(String clusterDomain) {
-//             this.clusterDomain = clusterDomain;
-//     }
-//
-//     public String getClusterSubDomain() {
-//             return clusterSubDomain;
-//     }
-//
-//     public void setClusterSubDomain(String clusterSubDomain) {
-//             this.clusterSubDomain = clusterSubDomain;
-//     }
-//
-//}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ade7fa98/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/DomainInfo.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/DomainInfo.java
 
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/DomainInfo.java
deleted file mode 100644
index 1c91921..0000000
--- 
a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/DomainInfo.java
+++ /dev/null
@@ -1,43 +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.manager.utils;
-//
-//public class DomainInfo {
-//
-//     String domain;
-//     String subDomain;
-//
-//     public String getDomain() {
-//             return domain;
-//     }
-//
-//     public void setDomain(String domain) {
-//             this.domain = domain;
-//     }
-//
-//     public String getSubDomain() {
-//             return subDomain;
-//     }
-//
-//     public void setSubDomain(String subDomain) {
-//             this.subDomain = subDomain;
-//     }
-//
-//}

Reply via email to