Package org.apache.stratos.manager.retriever

Examples of org.apache.stratos.manager.retriever.DataInsertionAndRetrievalManager


    private static volatile ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock();

    private TopologyClusterInformationModel() {
        //tenantIdToCartridgeTypeContextMap = new HashMap<Integer, Set<CartridgeTypeContext>>();
        clusterIdToClusterMap = new HashMap<String, Cluster>();
        dataInsertionNRetrievalMgr = new DataInsertionAndRetrievalManager();
    }
View Full Code Here


        }
    }

    public static boolean isAliasTaken (int tenantId, String alias) {

        DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();
        // return (dataInsertionAndRetrievalManager.getCartridgeSubscription(tenantId, alias) == null) ? false : true;
        // fixing STRATOS-427, making the alias globally unique
        return (dataInsertionAndRetrievalManager.getCartridgeSubscriptionForAlias(alias) == null) ? false : true;
    }
View Full Code Here

                tenant = new Tenant(carbonTenant.getId(), carbonTenant.getDomain());
                // Add subscriptions
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //List<CartridgeSubscriptionInfo> cartridgeSubscriptions = PersistenceManager.getSubscriptionsForTenant(tenant.getTenantId());
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                Collection<CartridgeSubscription> cartridgeSubscriptions = new DataInsertionAndRetrievalManager().getCartridgeSubscriptions(tenant.getTenantId());
                if (cartridgeSubscriptions != null && !cartridgeSubscriptions.isEmpty()) {
                    for (CartridgeSubscription subscription : cartridgeSubscriptions) {
                        if(log.isDebugEnabled()) {
                            log.debug(String.format("Tenant subscription found: [tenant-id] %d [tenant-domain] %s [service] %s",
                                    carbonTenant.getId(), carbonTenant.getDomain(), subscription.getType()));
View Full Code Here

    public Service deployService (String type, String autoscalingPolicyName, String deploymentPolicyName, int tenantId, String tenantRange,
        String tenantDomain, String userName)
            throws ADCException, UnregisteredCartridgeException, ServiceAlreadyDeployedException {

        //check if already we have a Multitenant service deployed for the same type
        DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();

        Service deployedService;
        try {
            deployedService = dataInsertionAndRetrievalManager.getService(type);

        } catch (PersistenceManagerException e) {
            String errorMsg = "Error in checking if Service is available is PersistenceManager";
            log.error(errorMsg, e);
            throw new ADCException(errorMsg, e);
View Full Code Here

        persist(lbService);
    }

    private void persist (Service service) throws ADCException {

        DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();

        try {
            dataInsertionAndRetrievalManager.persistService(service);

        } catch (PersistenceManagerException e) {
            String errorMsg = "Error in persisting Service in PersistenceManager";
            log.error(errorMsg, e);
            throw new ADCException(errorMsg, e);
View Full Code Here

    }

    public Service getService (String type) throws ADCException {

        try {
            return new DataInsertionAndRetrievalManager().getService(type);

        } catch (PersistenceManagerException e) {
            String errorMsg = "Error in getting Service for type " + type;
            log.error(errorMsg, e);
            throw new ADCException(errorMsg, e);
View Full Code Here

    public void updateRepository(String url) {

        if ( StringUtils.isNotBlank(url))  {

            Set<CartridgeSubscription> cartridgeSubscriptions = new DataInsertionAndRetrievalManager().
                    getCartridgeSubscriptionForRepository(url);

            if (cartridgeSubscriptions == null || cartridgeSubscriptions.isEmpty()) {
                // No subscriptions, return
                if (log.isDebugEnabled()) {
View Full Code Here

    }

    public Collection<Service> getServices () throws ADCException {

        try {
            return new DataInsertionAndRetrievalManager().getServices();

        } catch (PersistenceManagerException e) {
            String errorMsg = "Error in getting deployed Services";
            log.error(errorMsg, e);
            throw new ADCException(errorMsg, e);
View Full Code Here

        }
    }

    public void undeployService (String type) throws ADCException {

        DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();

        // check if there are already created Subscriptions for this type
        Collection<CartridgeSubscription> cartridgeSubscriptions = dataInsertionAndRetrievalManager.getCartridgeSubscriptions(type);
        if (cartridgeSubscriptions != null) {
            if (!cartridgeSubscriptions.isEmpty()) {
                // can't undeploy; there are existing Subscriptions
                String errorMsg = "Cannot undeploy Service since existing Subscriptions are found";
                log.error(errorMsg);
                throw new ADCException(errorMsg);
            }
        }

        if (log.isDebugEnabled()) {
            log.debug("No subscriptions found for service type: " + type + " , proceeding with undeploying service");
        }

        Service service;
        try {
            service = dataInsertionAndRetrievalManager.getService(type);

        } catch (PersistenceManagerException e) {
            String errorMsg = "Error in checking if Service is available is PersistenceManager";
            log.error(errorMsg, e);
            throw new ADCException(errorMsg, e);
        }

        if (service == null) {
            String errorMsg = "No service found for type " + type;
            log.error(errorMsg);
            throw new ADCException(errorMsg);
        }

        // if service is found, undeploy
        try {
            service.undeploy();

        } catch (NotSubscribedException e) {
            String errorMsg = "Undeploying Service Cluster failed for " + type;
            log.error(errorMsg, e);
            throw new ADCException(errorMsg, e);
        }

        try {
            dataInsertionAndRetrievalManager.removeService(type);

        } catch (PersistenceManagerException e) {
            String errorMsg = "Error in removing Service from PersistenceManager";
            log.error(errorMsg, e);
            throw new ADCException(errorMsg, e);
View Full Code Here

      // get the cluster domain and host name from deployed Service

      Service deployedLBService;
      try {
        deployedLBService = new DataInsertionAndRetrievalManager()
            .getService(cartridgeInfo.getType());

      } catch (PersistenceManagerException e) {
        String errorMsg = "Error in checking if Service is available is PersistenceManager";
        log.error(errorMsg, e);
View Full Code Here

TOP

Related Classes of org.apache.stratos.manager.retriever.DataInsertionAndRetrievalManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.