Package org.wso2.carbon.throttling.manager.exception

Examples of org.wso2.carbon.throttling.manager.exception.ThrottlingException


        try {
            tenants = Util.getAllTenants();
        } catch (UserStoreException e) {
            String msg = "Error in getting all the tenants.";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }
        // prepare the knowledge base using data on each tenant

        for (Tenant tenant : tenants) {
            if (!tenant.isActive()) {
View Full Code Here


            if (dataProvider == null) {
                String msg =
                        "Error in invoking the data provider. " + "dataProviderConfigs is null or "
                                + "data provider is not yet loaded";
                log.error(msg);
                throw new ThrottlingException(msg);
            }
            dataProvider.invoke(dataContext);
            if (dataContext.isProcessingComplete()) {
                break;
            }
View Full Code Here

            }
        } catch (RegistryException e) {
            String msg =
                    "Error in getting the tenant validation info.  tenant id: " + tenantId + ".";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }
    }
View Full Code Here

                    tenantValidationInfoResource);
        } catch (RegistryException e) {
            String msg =
                    "Error in storing the tenant validation info.  tenant id: " + tenantId + ".";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }
    }
View Full Code Here

        } catch (RegistryException e) {
            String msg =
                    "Error in reading the rule resource content. resource path: " +
                            StratosConstants.THROTTLING_RULES_PATH + ".";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        } catch (Exception e) {
            String msg = "Error in loading the rules.";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }

        try {
            ruleSetDescription.setRuleSource(ruleContentResource.getContentStream());
        } catch (RegistryException e) {
            String msg = "Error in loading the rules from the content stream.";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }
        // ruleSetDescription.setBindURI("file:" + ruleFile);
        String uri;
        try {
            uri = ruleEngine.addRuleSet(ruleSetDescription);
        } catch (Exception e) {
            String msg = "Error in compiling the rules.";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }
        SessionDescription sessionDescription = new SessionDescription();
        sessionDescription.setSessionType(SessionDescription.STATELESS_SESSION);
        sessionDescription.setRuleSetURI(uri);
View Full Code Here

        try {
            cl = Class.forName(className);
        } catch (ClassNotFoundException e) {
            String msg = "The class: " + className + " is not in the classpath.";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }

        try {
            co = cl.getConstructor();
        } catch (NoSuchMethodException e) {
            String msg = "The default constructor for the  is not available for " + className + ".";
            log.error(msg, e);
            throw new ThrottlingException(msg, e);
        }
        try {
            obj = co.newInstance();
        } catch (Exception e) {
            String msg = "Error in initializing the object for " + className + ".";
            log.error(msg);
            throw new ThrottlingException(msg, e);
        }
        return obj;
    }
View Full Code Here

        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here

            // Adding static subscriptions
            List<Subscription> staticSubscriptionList =
                    eventSource.getSubscriptionManager().getStaticSubscriptions();
            for (Iterator<Subscription> iterator = staticSubscriptionList.iterator();
                 iterator.hasNext();) {
                Subscription staticSubscription = iterator.next();
                OMElement staticSubElem =
                        fac.createOMElement("subscription", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                staticSubElem.addAttribute(
                        fac.createOMAttribute("id", nullNS, staticSubscription.getId()));
                OMElement filterElem =
                        fac.createOMElement("filter", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                filterElem.addAttribute(fac.createOMAttribute("source", nullNS,
                        (String) staticSubscription.getFilterValue()));
                filterElem.addAttribute(fac.createOMAttribute("dialect", nullNS,
                        (String) staticSubscription.getFilterDialect()));
                staticSubElem.addChild(filterElem);
                OMElement endpointElem =
                        fac.createOMElement("endpoint", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                OMElement addressElem =
                        fac.createOMElement("address", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                addressElem.addAttribute(
                        fac.createOMAttribute("uri", nullNS, staticSubscription.getEndpointUrl()));
                endpointElem.addChild(addressElem);
                staticSubElem.addChild(endpointElem);
                if (staticSubscription.getExpires() != null) {
                    OMElement expiresElem =
                            fac.createOMElement("expires", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                    fac.createOMText(expiresElem,
                            ConverterUtil.convertToString(staticSubscription.getExpires()));
                    staticSubElem.addChild(expiresElem);
                }
                evenSourceElem.addChild(staticSubElem);
            }
View Full Code Here


    public SynapseSubscription() {
        this.setId(UIDGenerator.generateURNString());
        this.setDeliveryMode(EventingConstants.WSE_DEFAULT_DELIVERY_MODE);
        SubscriptionData subscriptionData = new SubscriptionData();
        subscriptionData.setProperty(SynapseEventingConstants.STATIC_ENTRY, "false");
        this.setSubscriptionData(subscriptionData);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.throttling.manager.exception.ThrottlingException

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.