Examples of RuleSetDescription


Examples of org.wso2.carbon.rulecep.commons.descriptions.rule.RuleSetDescription

            ServiceDescription ruleServiceDescription = getRuleServiceDescription(request);
            if (ruleServiceDescription != null) {
                ruleServiceDescription.setExtension(RuleConstants.RULE_SERVICE_ARCHIVE_EXTENSION);
                RuleServiceExtensionDescription extensionDescription =
                        (RuleServiceExtensionDescription) ruleServiceDescription.getServiceExtensionDescription();
                RuleSetDescription ruleSetDescription =
                        extensionDescription.getRuleSetDescription();
                if (ruleSetDescription != null) {
                    ruleSetDescription.setPath(fileName);
                    ruleSetDescription.setKey("");
                    ruleSetDescription.setRuleSource(null); //remove rule source
                }
            }
        } catch (Exception e) {
            throw new RuleServiceClientException("Error uploading rule script : " + fileName, log);
        }
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.rule.RuleSetDescription

                                      XPathSerializer xPathSerializer,
                                      ExtensionSerializer configurationExtensionSerializer) {

        OMElement ruleElement = fac.createOMElement("rule", synNS);

        RuleSetDescription ruleSetDescription = ruleMediatorDescription.getRuleSetDescription();
        if (ruleSetDescription != null) {
            OMElement ruleSetElement = fac.createOMElement(CommonsConstants.ELE_RULESET, synNS);
            RuleSetDescriptionSerializer.serialize(ruleSetDescription, xPathSerializer,
                    ruleSetElement, configurationExtensionSerializer);
            ruleElement.addChild(ruleSetElement);
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.rule.RuleSetDescription

        ruleEngine = Util.getRuleServerManagerService().createRuleEngine(
                        Thread.currentThread().getContextClassLoader());
       
        String ruleFile = handlerConfig.get("file");
        ruleFile = CarbonUtils.getCarbonConfigDirPath() + "/" + ruleFile;
        RuleSetDescription ruleSetDescription = new RuleSetDescription();
       
        try {
            ruleSetDescription.setRuleSource(new FileInputStream(ruleFile));
        } catch (FileNotFoundException e) {
            String msg = "file not found. file name: " + ruleFile + ".";
            throw new BillingException(msg, e);
        }
       
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.rule.RuleSetDescription

    public synchronized void updateRules() throws ThrottlingException {
        ruleEngine =
                Util.getRuleServerManagerService().createRuleEngine(
                        Thread.currentThread().getContextClassLoader());
        RuleSetDescription ruleSetDescription = new RuleSetDescription();
        Resource ruleContentResource;
        // getting the resource content.
        try {
            UserRegistry systemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
            ruleContentResource =
                    systemRegistry.get(StratosConstants.THROTTLING_RULES_PATH);
        } 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);
        }
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.rule.RuleSetDescription

//        configuration.addOutputResourceDescription(outputThree);
//        configuration.addOutputResourceDescription(outputOne);
        ruleMediatorDescription.addResultDescription(outputsTwo);


        RuleSetDescription setDescription = new RuleSetDescription();
        setDescription.setBindURI("RoutingRules");
        setDescription.setRuleSource(createOMElement(drlRule));

        PropertyDescription creationDescription = new PropertyDescription();
        creationDescription.setName(RuleConstants.SOURCE);
        creationDescription.setValue("drl");
        setDescription.addCreationProperty(creationDescription);

        ruleMediatorDescription.setRuleSetDescription(setDescription);
        RuleMediator ruleMediator = new RuleMediator(ruleMediatorDescription);
        ruleMediator.init(null);
View Full Code Here

Examples of org.wso2.carbon.rulecep.commons.descriptions.rule.RuleSetDescription

//        configuration.addOutputResourceDescription(outputThree);
//        configuration.addOutputResourceDescription(outputOne);
        ruleMediatorDescription.addResultDescription(outputsTwo);


        RuleSetDescription setDescription = new RuleSetDescription();
        setDescription.setBindURI("RoutingRules");
        setDescription.setRuleSource(createOMElement(drlRule));

        PropertyDescription creationDescription = new PropertyDescription();
        creationDescription.setName(RuleConstants.SOURCE);
        creationDescription.setValue("drl");
        setDescription.addCreationProperty(creationDescription);

        ruleMediatorDescription.setRuleSetDescription(setDescription);
        RuleMediator ruleMediator = new RuleMediator(ruleMediatorDescription);
        ruleMediator.init(null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.