Package org.wso2.carbon.rule.service

Examples of org.wso2.carbon.rule.service.RuleServiceManagementException


        validateRuleServiceDescription(serviceDescription, serviceXML);
        AxisConfiguration axisConfig = getAxisConfig();
        try {
            AxisService axisService = axisConfig.getService(name);
            if (axisService != null) {
                throw new RuleServiceManagementException("There is already a service " +
                        "with the given name : " + name, log);
            }
            RuleServiceAdminHandler adminHandler = getRuleServiceAdminHandler(fileExtension);
            adminHandler.saveRuleService(getAxisConfig(), axisService, serviceDescription);
        } catch (AxisFault axisFault) {
            throw new RuleServiceManagementException("Error while accessing " +
                    "the service with the name : " + name, axisFault, log);
        }
    }
View Full Code Here


            axisServiceGroup.addParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true");

            RuleServiceAdminHandler adminHandler = getRuleServiceAdminHandler(fileExtension);
            adminHandler.saveRuleService(getAxisConfig(), axisService, serviceDescription);
        } catch (AxisFault axisFault) {
            throw new RuleServiceManagementException("Error while accessing " +
                    "the service with the name : " + name, axisFault, log);
        }

    }
View Full Code Here

                    if (RuleConstants.RULE_SERVICE_TYPE.equals(parameter.getValue().toString())) {
                        serviceList.add(serviceName);
                    }
                }
            } catch (AxisFault axisFault) {
                throw new RuleServiceManagementException("Error while accessing " +
                        "the service with the name : " + serviceName, axisFault, log);
            }
        }
        return serviceList.toArray(new String[serviceList.size()]);
    }
View Full Code Here

                            break;
                        }
                    }
                }
                if (axisService == null) {
                    throw new RuleServiceManagementException("There is no a service " +
                            "with the given name : " + serviceName, log);
                }
            }
            String path = (String) axisService.getParameterValue(RuleConstants.RULE_SERVICE_PATH);
            String fileExtension = path.substring(path.lastIndexOf(".") + 1);
            RuleServiceAdminHandler adminHandler = getRuleServiceAdminHandler(fileExtension);
            OMElement omElement =
                    adminHandler.getRuleService(getAxisConfig(), serviceName);
            omElement.addAttribute(
                    OM_FACTORY.createOMAttribute(
                            RuleConstants.ATT_EXTENSION, NULL_NS, fileExtension));
            return omElement;
        } catch (AxisFault axisFault) {
            throw new RuleServiceManagementException("Error while accessing " +
                    "the service with the name : " + serviceName, axisFault, log);
        }
    }
View Full Code Here

        }
    }

    private static void validateElement(OMElement element) {
        if (element == null) {
            throw new RuleServiceManagementException("Rule Service" +
                    "Description OMElement can not be found.", log);
        }
    }
View Full Code Here

    }


    private static void validateName(String name) {
        if (name == null || "".equals(name)) {
            throw new RuleServiceManagementException("Name is null or empty", log);
        }
    }
View Full Code Here

    }

    private static void validateRuleServiceDescription(ServiceDescription description,
                                                       OMElement xml) {
        if (description == null) {
            throw new RuleServiceManagementException("RuleService Description can not be " +
                    "created from : " + xml,
                    log);
        }
    }
View Full Code Here

        if (RuleConstants.RULE_FILE_EXTENSION.equals(fileExtension)) {
            return RULE_FILE_HANDLER;
        } else if (RuleConstants.RULE_SERVICE_ARCHIVE_EXTENSION.equals(fileExtension)) {
            return RULE_ARCHIVE_HANDLER;
        } else {
            throw new RuleServiceManagementException("Invalid file extension : " + fileExtension,
                    log);
        }
    }
View Full Code Here

                            ruleServiceDescription, NULL_NS,
                            AXIOM_XPATH_SERIALIZER, CONFIGURATION_EXTENSION_SERIALIZER);
            servicesXML.build();
            servicesXML.serialize(os);
        } catch (Exception e) {
            throw new RuleServiceManagementException("Cannot write rule services XML", e, log);
        }

        try {
            FileManipulator.copyFile(new File(paths.getWorkingDirPath()),
                    new File(paths.getServicePath()));
        } catch (IOException e) {
            throw new RuleServiceManagementException("Error coping content of the  file : " +
                    paths.getWorkingDirPath() + ". to the target file : " +
                    paths.getServicePath(), log);
        }
//        saveToRegistry(paths, serviceName);
        cleanUp(paths);
View Full Code Here

            absoluteFile.delete();
        }
        try {
            rlsFile.createNewFile();
        } catch (IOException e) {
            throw new RuleServiceManagementException("Error creating a new file : " + rlsFile, log);
        }
        if (sourceFile.exists()) {
            try {
                FileManipulator.copyFile(sourceFile, absoluteFile);
            } catch (IOException e) {
                throw new RuleServiceManagementException("Error coping content of the  file : " +
                        sourceFile + ". to the target file : " + rlsFile, log);
            }
        }
        return new Paths(servicePath, targetDirectory);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.rule.service.RuleServiceManagementException

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.