Examples of MediatorException


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

            // Use KeySerializer to serialize Key
            ValueSerializer keySerializer =  new ValueSerializer();
            keySerializer.serializeValue(xsltKey, XMLConfigConstants.KEY, xslt);

        } else {
            throw new MediatorException("Invalid XSLT mediator. XSLT registry key is required");
        }
        saveTracingState(xslt, this);

        if (source != null) {
            SynapseXPathSerializer.serializeXPath(source, xslt, "source");
        }
        if (targetPropertyName != null) {
            xslt.addAttribute(fac.createOMAttribute(
                "target", nullNS, targetPropertyName));
        }
        serializeMediatorProperties(xslt, properties, PROP_Q);
        if (!transformerFactoryFeatures.isEmpty()) {
            for (MediatorProperty mp : transformerFactoryFeatures) {
                OMElement prop = fac.createOMElement("feature", synNS, xslt);
                if (mp.getName() != null) {
                    prop.addAttribute(fac.createOMAttribute("name", nullNS, mp.getName()));
                } else {
                    throw new MediatorException("The Feature name is missing");
                }
                if (mp.getValue() != null) {
                    prop.addAttribute(fac.createOMAttribute("value", nullNS, mp.getValue()));
                else {
                    throw new MediatorException("The Feature value is missing");
                }
            }
        }
        serializeMediatorProperties(xslt, transformerFactoryAttributes, ATTRIBUTE_Q);
View Full Code Here

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

        if (attXslt != null) {
            //Use KeyFactory to create Key
            ValueFactory keyFactory = new ValueFactory();
            xsltKey = keyFactory.createValue(XMLConfigConstants.KEY, elem);
        } else {
            throw new MediatorException("The 'key' attribute is required for the XSLT mediator");
        }

        if (attSource != null) {
            try {
                source = SynapseXPathFactory.getSynapseXPath(elem, ATT_SOURCE);
            } catch (JaxenException e) {
                throw new MediatorException("Invalid XPath specified for the source attribute : " +
                    attSource.getAttributeValue());
            }
        }

        if (attTarget != null) {
            targetPropertyName = attTarget.getAttributeValue();
        }   
   
        // after successfully creating the mediator
        // set its common attributes such as tracing etc
        processAuditStatus(this, elem);
        // set the features
        for (Map.Entry<String,String> entry : collectNameValuePairs(elem, FEATURE_Q).entrySet()) {
            String value = entry.getValue();
            boolean isFeatureEnabled;
            if ("true".equals(value)) {
                isFeatureEnabled = true;
            } else if ("false".equals(value)) {
                isFeatureEnabled = false;
            } else {
                throw new MediatorException("The feature must have value true or false");
            }
            addFeature(entry.getKey(), isFeatureEnabled);
        }
        for (Map.Entry<String,String> entry : collectNameValuePairs(elem, ATTRIBUTE_Q).entrySet()) {
            addAttribute(entry.getKey(), entry.getValue());
View Full Code Here

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

    public QName getTagQName() {
    return PAYPAL_Q;
  }

  protected void handleException(String exceptionMsg) {
    throw new MediatorException(exceptionMsg);
  }
View Full Code Here

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

        return parameterElem;
    }

    protected void handleException(String exceptionMsg) {
        throw new MediatorException(exceptionMsg);
    }
View Full Code Here

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

                            this.diskCacheSize = Integer.parseInt(sizeAttr.getAttributeValue());
                        } else {
                            this.diskCacheSize = DEFAULT_DISK_CACHE_SIZE;
                        }
                    } else {
                        throw new MediatorException("unknown implementation type for the Cache mediator");
                    }
                }
            }
        }
    }
View Full Code Here

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

            return true;
        } else if (CachingConstants.SCOPE_PER_MEDIATOR.equals(scope)) {
            if (id != null) {
                return true;
            } else {
                throw new MediatorException("Id is required for a cache wirth scope : " + scope);               
            }
        } else if (CachingConstants.SCOPE_DISTRIBUTED.equals(scope)) {
            throw new MediatorException("Scope distributed is not supported yet by the Cache mediator");
        } else {
            throw new MediatorException("Unknown scope " + scope + " for the Cache mediator");
        }
    }
View Full Code Here

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

        if (remoteServiceUrl != null) {
          oauthService.addAttribute(fac.createOMAttribute("remoteServiceUrl", nullNS,
                    remoteServiceUrl));
        } else {
            throw new MediatorException(
                    "Invalid Entitlement mediator.OAuth service epr required");
        }

        saveTracingState(oauthService, this);
View Full Code Here

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

        OMAttribute attRemoteServiceUri = elem.getAttribute(PROP_NAME_SERVICE_EPR);

        if (attRemoteServiceUri != null) {
            remoteServiceUrl = attRemoteServiceUri.getAttributeValue();
        } else {
            throw new MediatorException(
                    "The 'remoteServiceUrl' attribute is required for the Entitlement mediator");
        }
    }
View Full Code Here

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

        if (expression != null) {
            SynapseXPathSerializer.serializeXPath(
                    expression, routeElem, "expression");
        } else {
            throw new MediatorException("Incomplete route has been found in the " +
                    "serialization of the RouterMediator");
        }

        if (match != null) {
            routeElem.addAttribute(
View Full Code Here

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

            try {
                expression =
                        SynapseXPathFactory.getSynapseXPath(elem, ATT_EXPRN);
            } catch (JaxenException e) {
                throw new MediatorException("Couldn't build the xpath from the expression : "
                        + expressionAttr.getAttributeValue());
            }
        } else {

            throw new MediatorException("Route without an expression attribute has been found, " +
                    "but it is required to have an expression for all routes");
        }

        if (matchAttr != null && matchAttr.getAttributeValue() != null) {
            match = Pattern.compile(matchAttr.getAttributeValue());
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.