Examples of ProxyAdminException


Examples of org.wso2.carbon.proxyadmin.ProxyAdminException

    public ProxyObserver(SynapseConfiguration synapseConfig, Registry configRegistry)
            throws ProxyAdminException {
        if (synapseConfig == null) {
            String msg = "Unable to initialize a ProxyObserver with a null SynapseConfiguration";
            log.error(msg);
            throw new ProxyAdminException(msg);
        }
        this.synapseConfig = synapseConfig;
        this.configSystemRegistry = configRegistry;
    }
View Full Code Here

Examples of org.wso2.carbon.proxyadmin.ProxyAdminException

    private void assertNull(String name, Object object) throws ProxyAdminException {
        if (object == null) {
            String message = name + " reference in the proxy admin config holder is null";
            log.error(message);
            throw new ProxyAdminException(message);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.proxyadmin.common.ProxyAdminException

    private void assertNull(String name, Object object) throws ProxyAdminException {
        if (object == null) {
            String message = name + " reference in the proxy admin config holder is null";
            log.error(message);
            throw new ProxyAdminException(message);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.proxyadmin.common.ProxyAdminException

            try {
                element.addChild(createElement(inSeqXML));
            } catch (XMLStreamException e) {
                String msg = "Unable to build the \"inSequence\" element";
                log.error(msg + e.getMessage());
                throw new ProxyAdminException(msg, e);
            }
        }

        if (outSeqKey != null) {
            element.addAttribute("outSequence", outSeqKey, nullNS);
        } else if (outSeqXML != null) {
            try {
                element.addChild(createElement(outSeqXML));
            } catch (XMLStreamException e) {
                String msg = "Unable to build the \"outSequence\" element";
                log.error(msg + e.getMessage());
                throw new ProxyAdminException(msg, e);
            }
        }

        if (faultSeqKey != null) {
            element.addAttribute("faultSequence", faultSeqKey, nullNS);
        } else if (faultSeqXML != null) {
            try {
                element.addChild(createElement(faultSeqXML));
            } catch (XMLStreamException e) {
                String msg = "Unable to build the \"faultSequence\" element";
                log.error(msg + e.getMessage());
                throw new ProxyAdminException(msg, e);
            }
        }

        if (endpointKey != null) {
            element.addAttribute("endpoint", endpointKey, nullNS);
        } else if (endpointXML != null && !"".equals(endpointXML)) {
            try {
                element.addChild(createElement(endpointXML));
            } catch (XMLStreamException e) {
                String msg = "Unable to build the \"endpoint\" element";
                log.error(msg + e.getMessage());
                throw new ProxyAdminException(msg, e);
            }
        }
        proxy.addChild(element);

        // creates the publishWSDL section of the configuration
        element = fac.createOMElement("publishWSDL", syn);
        if (wsdlKey != null) {
            publishWSDL = true;
            element.addAttribute("key", wsdlKey, nullNS);
        } else if (wsdlURI != null) {
            publishWSDL = true;
            element.addAttribute("uri", wsdlURI, nullNS);
        } else if (wsdlDef != null) {
            publishWSDL = true;
            try {
                element.addChild(createElement(wsdlDef));
            } catch (XMLStreamException e) {
                String msg = "Unable to build the in line WSDL definition";
                log.error(msg + e.getMessage());
                throw new ProxyAdminException(msg, e);
            }
        }

        if (publishWSDL){
            // builds the additional resources (if any) required by the WSDL
            if (wsdlResources != null && wsdlResources.length != 0) {
                OMElement resource;
                Entry wsdlResource;
                for (int i = 0; i < wsdlResources.length; i++) {
                    wsdlResource = wsdlResources[i];
                    resource = fac.createOMElement("resource", syn);
                    resource.addAttribute("location", wsdlResource.getKey(), nullNS);
                    resource.addAttribute("key", wsdlResource.getValue(), nullNS);
                    element.addChild(resource);
                }
            }
            proxy.addChild(element);
        }

        // creates the additional service level parameter list of the configuration
        if (serviceParams != null && serviceParams.length != 0) {
            Entry serviceParam;
            String value;
            for (int i = 0; i < serviceParams.length; i++) {
                serviceParam = serviceParams[i];
                element = fac.createOMElement("parameter", syn);
                element.addAttribute("name", serviceParam.getKey(), nullNS);
                value = serviceParam.getValue();
                if (value.startsWith("<")) {
                    try {
                        element.addChild(new StAXOMBuilder(
                                new ByteArrayInputStream(value.getBytes())).getDocumentElement());
                    } catch (XMLStreamException e) {
                        String msg = "Service parameter: " + serviceParam.getKey() + " has an invalid XML as its value";
                        log.error(msg);
                        throw new ProxyAdminException(msg,e);
                    }
                } else {
                    element.setText(value);
                }
                proxy.addChild(element);
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.