Search in sources :

Example 51 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class XmlParamSwitch method configure.

public void configure() throws ConfigurationException {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = getLogPrefix(null) + "The class [" + getClass().getName() + "] has been deprecated. Please change to [" + getClass().getSuperclass().getName() + "]";
    configWarnings.add(log, msg);
    super.configure();
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 52 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class XmlSwitch method configure.

/**
 * If no {@link #setServiceSelectionStylesheetFilename(String) serviceSelectionStylesheetFilename} is specified, the
 * switch uses the root node.
 */
public void configure() throws ConfigurationException {
    super.configure();
    if (getNotFoundForwardName() != null) {
        if (findForward(getNotFoundForwardName()) == null) {
            // throw new ConfigurationException(getLogPrefix(null)+"has a notFoundForwardName attribute. However, this forward ["+getNotFoundForwardName()+"] is not configured.");
            ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
            String msg = getLogPrefix(null) + "has a notFoundForwardName attribute. However, this forward [" + getNotFoundForwardName() + "] is not configured.";
            configWarnings.add(log, msg);
        }
    }
    if (getEmptyForwardName() != null) {
        if (findForward(getEmptyForwardName()) == null) {
            // throw new ConfigurationException(getLogPrefix(null)+"has a emptyForwardName attribute. However, this forward ["+getEmptyForwardName()+"] is not configured.");
            ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
            String msg = getLogPrefix(null) + "has a emptyForwardName attribute. However, this forward [" + getEmptyForwardName() + "] is not configured.";
            configWarnings.add(log, msg);
        }
    }
    if (!StringUtils.isEmpty(getXpathExpression())) {
        if (!StringUtils.isEmpty(getServiceSelectionStylesheetFilename())) {
            throw new ConfigurationException(getLogPrefix(null) + "cannot have both an xpathExpression and a serviceSelectionStylesheetFilename specified");
        }
        transformerPool = TransformerPool.configureTransformer0(getLogPrefix(null), classLoader, getNamespaceDefs(), getXpathExpression(), null, "text", false, getParameterList(), isXslt2());
    } else {
        if (!StringUtils.isEmpty(getServiceSelectionStylesheetFilename())) {
            try {
                URL stylesheetURL = ClassUtils.getResourceURL(classLoader, getServiceSelectionStylesheetFilename());
                if (stylesheetURL == null) {
                    throw new ConfigurationException(getLogPrefix(null) + "cannot find stylesheet [" + getServiceSelectionStylesheetFilename() + "]");
                }
                transformerPool = TransformerPool.getInstance(stylesheetURL, isXslt2());
            } catch (IOException e) {
                throw new ConfigurationException(getLogPrefix(null) + "cannot retrieve [" + serviceSelectionStylesheetFilename + "]", e);
            } catch (TransformerConfigurationException te) {
                throw new ConfigurationException(getLogPrefix(null) + "got error creating transformer from file [" + serviceSelectionStylesheetFilename + "]", te);
            }
        } else {
            if (StringUtils.isEmpty(getSessionKey())) {
                try {
                    // create a transformer that looks to the root node
                    transformerPool = TransformerPool.getInstance(XmlUtils.createXPathEvaluatorSource(DEFAULT_SERVICESELECTION_XPATH, "text"));
                } catch (TransformerConfigurationException te) {
                    throw new ConfigurationException(getLogPrefix(null) + "got error creating XPathEvaluator from string [" + DEFAULT_SERVICESELECTION_XPATH + "]", te);
                }
            }
        }
    }
    registerEvent(XML_SWITCH_FORWARD_FOUND_MONITOR_EVENT);
    registerEvent(XML_SWITCH_FORWARD_NOT_FOUND_MONITOR_EVENT);
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) TransformerConfigurationException(javax.xml.transform.TransformerConfigurationException) TransformerConfigurationException(javax.xml.transform.TransformerConfigurationException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) IOException(java.io.IOException) URL(java.net.URL)

Example 53 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class XmlValidator method checkRootValidation.

private void checkRootValidation(List<String> path, Set<XSD> xsds) throws ConfigurationException {
    boolean found = false;
    String validElements = path.get(path.size() - 1);
    List<String> validElementsAsList = Arrays.asList(validElements.split(","));
    for (String validElement : validElementsAsList) {
        if (StringUtils.isNotEmpty(validElement)) {
            List<String> allRootTags = new ArrayList<String>();
            for (XSD xsd : xsds) {
                for (String rootTag : xsd.getRootTags()) {
                    allRootTags.add(rootTag);
                    if (validElement.equals(rootTag)) {
                        found = true;
                    }
                }
            }
            if (!found) {
                ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
                String msg = getLogPrefix(null) + "Element '" + validElement + "' not in list of available root elements " + allRootTags;
                configWarnings.add(log, msg);
            }
        }
    }
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) ArrayList(java.util.ArrayList) XSD(nl.nn.adapterframework.validation.XSD)

Example 54 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class JmsCommunicator method configure.

public void configure() throws ConfigurationException {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = getLogPrefix(null) + "The class [" + getClass().getName() + "] has been deprecated. Please change to [" + GenericMessageSendingPipe.class.getName() + "]";
    configWarnings.add(log, msg);
    super.configure();
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 55 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class MailSender method configure.

public void configure() throws ConfigurationException {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = getLogPrefix() + "The class [" + getClass().getName() + "] has been deprecated. Please change to [" + getClass().getSuperclass().getName() + "]";
    configWarnings.add(log, msg);
    super.configure();
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Aggregations

ConfigurationWarnings (nl.nn.adapterframework.configuration.ConfigurationWarnings)58 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)16 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)5 ArrayList (java.util.ArrayList)4 ITransactionalStorage (nl.nn.adapterframework.core.ITransactionalStorage)3 PipeForward (nl.nn.adapterframework.core.PipeForward)3 ReceiverBase (nl.nn.adapterframework.receivers.ReceiverBase)3 URL (java.net.URL)2 BaseConfigurationWarnings (nl.nn.adapterframework.configuration.BaseConfigurationWarnings)2 Configuration (nl.nn.adapterframework.configuration.Configuration)2 HasPhysicalDestination (nl.nn.adapterframework.core.HasPhysicalDestination)2 ISender (nl.nn.adapterframework.core.ISender)2 EsbSoapWrapperPipe (nl.nn.adapterframework.extensions.esb.EsbSoapWrapperPipe)2 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Connection (java.sql.Connection)1 DatabaseMetaData (java.sql.DatabaseMetaData)1 SQLException (java.sql.SQLException)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1