Package org.apache.stratos.manager.retriever

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


    DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager;

    @Before
    public void setUp () {
        cartridgeSubscriptions = new ArrayList<CartridgeSubscription>();
        dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();

        setUpCsrtridgeSubscriptions();
    }
View Full Code Here


                String clusterId = event.getClusterId();
                if(log.isInfoEnabled()) {
                    log.info("Cluster id: " + clusterId);
                }

                Set<CartridgeSubscription> cartridgeSubscriptions = new DataInsertionAndRetrievalManager().getCartridgeSubscriptionForCluster(clusterId);
                if (cartridgeSubscriptions == null || cartridgeSubscriptions.isEmpty()) {
                    // No subscriptions, return
                    if (log.isDebugEnabled()) {
                        log.debug("No subscription information found for cluster id " + clusterId);
                    }
View Full Code Here

            Thread topologyReceiverThread = new Thread(stratosManagerTopologyEventReceiver);
            topologyReceiverThread.start();
            log.info("Topology receiver thread started");

            // retrieve persisted CartridgeSubscriptions
            new DataInsertionAndRetrievalManager().cachePersistedSubscriptions();

            //Component activated successfully
            log.info("ADC management server component is activated");
     
    } catch (Exception e) {
View Full Code Here

        //set status as 'SUBSCRIBED'
        cartridgeSubscription.setSubscriptionStatus(CartridgeConstants.SUBSCRIBED);

        try {
            new DataInsertionAndRetrievalManager().cacheAndPersistSubcription(cartridgeSubscription);

        } catch (PersistenceManagerException e) {
            String errorMsg = "Error saving subscription for tenant " +
                    cartridgeSubscription.getSubscriber().getTenantDomain() + ", alias " + cartridgeSubscription.getType();
            log.error(errorMsg);
View Full Code Here

    }

    public Collection<CartridgeSubscription> getCartridgeSubscriptions (int tenantId, String type) throws ADCException {

        if (type == null || type.isEmpty()) {
            return new DataInsertionAndRetrievalManager().getCartridgeSubscriptions(tenantId);

        } else {
            return new DataInsertionAndRetrievalManager().getCartridgeSubscriptions(tenantId, type);
        }
    }
View Full Code Here

        }
    }

    public CartridgeSubscription getCartridgeSubscription (int tenantId, String subscriptionAlias) {

        return new DataInsertionAndRetrievalManager().getCartridgeSubscription(tenantId, subscriptionAlias);
    }
View Full Code Here

     * @throws NotSubscribedException
     */
    public void unsubscribeFromCartridge (String tenantDomain, String alias)
            throws ADCException, NotSubscribedException {

        DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();

        CartridgeSubscription cartridgeSubscription = dataInsertionAndRetrievalManager.getCartridgeSubscription(CarbonContext.getThreadLocalCarbonContext().getTenantId(), alias);
        if(cartridgeSubscription != null) {
            cartridgeSubscription.removeSubscription();

            // Remove the information from Topology Model
            // Not needed now. TopologyModel is now changed so that information is taken from subscriptions
            //TopologyClusterInformationModel.getInstance().removeCluster(cartridgeSubscription.getSubscriber().getTenantId(),
            //        cartridgeSubscription.getType(), cartridgeSubscription.getAlias());

            // remove subscription
            try {
                dataInsertionAndRetrievalManager.removeSubscription(cartridgeSubscription.getSubscriber().getTenantId(), alias);

            } catch (PersistenceManagerException e) {
                String errorMsg = "Error removing subscription for tenant " + tenantDomain + ", alias " + cartridgeSubscription.getAlias();
                log.error(errorMsg);
                throw new ADCException(errorMsg, e);
View Full Code Here

     * @param cartridgeType
     * @return
     */
    public Collection<CartridgeSubscription> isCartridgeSubscribed(int tenantId, String cartridgeType) {
     
      DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();
        return dataInsertionAndRetrievalManager.getCartridgeSubscriptions(tenantId, cartridgeType);
    }
View Full Code Here

                throw new AlreadySubscribedException(msg, cartridgeInfo.getType());
            }
        }

        // get the cluster domain and host name from deployed Service
        DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();

        Service deployedService;
        try {
            deployedService = dataInsertionAndRetrievalManager.getService(cartridgeInfo.getType());

        } 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

                "unregister services");
    }

    private static boolean hasAlreadySubscribed(int tenantId, String cartridgeType) {

        DataInsertionAndRetrievalManager dataInsertionAndRetrievalManager = new DataInsertionAndRetrievalManager();
        return ( dataInsertionAndRetrievalManager.getCartridgeSubscriptions(tenantId, cartridgeType) == null ||
                 dataInsertionAndRetrievalManager.getCartridgeSubscriptions(tenantId, cartridgeType).isEmpty() ) ? false : true;
    }
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.