Examples of MediatorException


Examples of org.wso2.carbon.mediator.service.MediatorException

    /**
     * @param exceptionMsg
     */
    private void handleException(String exceptionMsg) {
        throw new MediatorException(exceptionMsg);
    }
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

    /**
     * @param exceptionMsg
     */
    private void handleException(String exceptionMsg) {
        throw new MediatorException(exceptionMsg);
    }
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

                    case Types.TIMESTAMP: {
                        paramElt.addAttribute(fac.createOMAttribute("type", nullNS, "TIMESTAMP"));
                        break;
                    }
                    default: {
                        throw new MediatorException("Unknown or unsupported JDBC type : " +
                            param.getType());
                    }
                }

                stmntElt.addChild(paramElt);
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

                    if (xpath != null) {
                        try {
                            xp = SynapseXPathFactory.getSynapseXPath(paramElt, ATT_EXPRN);

                        } catch (JaxenException e) {
                            throw new MediatorException("Invalid XPath specified for the source attribute : " +
                                    xpath);
                        }
                    }
                    statement.addParameter(
                            value,
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

                createCustomDataSource(pool);

            } else if (pool.getFirstChildWithName(DSNAME_Q) != null) {
                lookupDataSource(pool);
            } else {
                throw new MediatorException("The DataSource connection information must be specified for " +
                        "using a custom DataSource connection pool or for a JNDI lookup");
            }

        } catch (JaxenException e) {
            throw new MediatorException("Error looking up DataSource connection information");
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

        if (mediator != null) {
            clazz.addAttribute(fac.createOMAttribute(
                "name", nullNS, mediator));
        } else {
            throw new MediatorException("Invalid class mediator. The class name is required");
        }

        Iterator itr = properties.keySet().iterator();
        while(itr.hasNext()) {
            String propName = (String) itr.next();
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

    public void build(OMElement elem) {
        OMAttribute name = elem.getAttribute(ATT_NAME);
        if (name == null) {
            String msg = "The name of the actual mediator class is a required attribute";
            throw new MediatorException(msg);
        }
        this.mediator = name.getAttributeValue();
       
        for (Iterator it = elem.getChildrenWithName(PROP_Q); it.hasNext();) {
            OMElement child = (OMElement) it.next();

            String propName = child.getAttribute(ATT_NAME).getAttributeValue();
            if (propName == null) {
                throw new MediatorException(
                    "A Class mediator property must specify the name attribute");
            } else {
                if (child.getAttribute(ATT_VALUE) != null) {
                    String value = child.getAttribute(ATT_VALUE).getAttributeValue();
                    properties.put(propName, value);
                } else {
                    OMNode omElt = child.getFirstElement();
                    if (omElt != null) {
                        properties.put(propName, omElt);
                    } else {
                        throw new MediatorException("A Class mediator property must specify " +
                            "name and value attributes, or a name and a child XML fragment");
                    }
                }
            }
        }
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

    public OMElement serialize(OMElement parent) {
        OMElement sequence = fac.createOMElement("RMSequence", synNS);
        saveTracingState(sequence, this);

        if(single && correlation != null) {
            throw new MediatorException("Invalid RMSequence mediator. A RMSequence can't have both a "
                    + "single attribute value of true and a correlation attribute specified.");
        }
        if(single && lastMessage != null) {
            throw new MediatorException("Invalid RMSequence mediator. A RMSequence can't have both a "
                    + "single attribute value of true and a last-message attribute specified.");
        }

        if (single) {
            sequence.addAttribute(fac.createOMAttribute("single", nullNS, String.valueOf(single)));
        } else if (correlation != null) {
            SynapseXPathSerializer.serializeXPath(
                correlation, sequence, "correlation");
        } else {
            throw new MediatorException("Invalid RMSequence mediator. Specify a single message sequence "
                    + "or a correlation attribute.");
        }

        if (lastMessage != null) {
            SynapseXPathSerializer.serializeXPath(
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

        OMAttribute version = elem.getAttribute(ATT_VERSION);

        if (single == null && correlation == null) {
            String msg = "The 'single' attribute value of true or a 'correlation' attribute is " +
                "required for the configuration of a RMSequence mediator";
            throw new MediatorException(msg);
        }

        if (correlation != null) {
            if (correlation.getAttributeValue() != null &&
                correlation.getAttributeValue().trim().length() == 0) {
                String msg = "Invalid attribute value specified for correlation";
                throw new MediatorException(msg);

            } else {
                try {
                    this.correlation =
                        SynapseXPathFactory.getSynapseXPath(elem, ATT_CORR);
        this.single = false;
                } catch (JaxenException e) {
                    String msg = "Invalid XPath expression for attribute correlation : "
                        + correlation.getAttributeValue();
                    throw new MediatorException(msg);
                }
            }
        }

        if (single != null) {
            this.single = Boolean.valueOf(single.getAttributeValue());
        }

        if (this.single && this.correlation != null) {
            String msg = "Invalid RMSequence mediator. A RMSequence can't have both a "
                + "single attribute value of true and a correlation attribute specified.";
            throw new MediatorException(msg);

        } else if (!this.single && correlation == null) {
            String msg = "Invalid RMSequence mediator. A RMSequence must have a "
                + "single attribute value of true or a correlation attribute specified.";
            throw new SynapseException(msg);
        }

        if (lastMessage != null) {
            if (lastMessage.getAttributeValue() != null &&
                lastMessage.getAttributeValue().trim().length() == 0) {
                String msg = "Invalid attribute value specified for last-message";
                throw new MediatorException(msg);

            } else {
                try {
                    this.lastMessage =
                        SynapseXPathFactory.getSynapseXPath(elem, ATT_LASTMSG);
                } catch (JaxenException e) {
                    String msg = "Invalid XPath expression for attribute last-message : "
                        + lastMessage.getAttributeValue();
                    throw new MediatorException(msg);
                }
            }
        }

        if (this.single && this.lastMessage != null) {
            String msg = "Invalid RMSequence mediator. A RMSequence can't have both a "
                + "single attribute value of true and a last-message attribute specified.";
            throw new SynapseException(msg);
        }

        if (version != null) {
            if (!XMLConfigConstants.SEQUENCE_VERSION_1_0.equals(version.getAttributeValue()) &&
                !XMLConfigConstants.SEQUENCE_VERSION_1_1.equals(version.getAttributeValue())) {
                String msg = "Only '" + XMLConfigConstants.SEQUENCE_VERSION_1_0 + "' or '" +
                    XMLConfigConstants.SEQUENCE_VERSION_1_1
                    + "' values are allowed for attribute version for a RMSequence mediator"
                    + ", Unsupported version " + version.getAttributeValue();
                throw new MediatorException(msg);
            }
            this.version = version.getAttributeValue();
        }

        // after successfully creating the mediator
View Full Code Here

Examples of org.wso2.carbon.mediator.service.MediatorException

                                faultCodeValue.getLocalPart())) ) {

            this.faultCodeValue = faultCodeValue;

        } else {
            throw new MediatorException("Invalid Fault code value for a SOAP 1.2 fault : " + faultCodeValue);
        }
    }
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.