Search in sources :

Example 21 with ConfigurationWarnings

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

the class EsbJmsListener method configure.

public void configure() throws ConfigurationException {
    if (getMessageProtocol() == null) {
        throw new ConfigurationException(getLogPrefix() + "messageProtocol must be set");
    }
    if (!getMessageProtocol().equalsIgnoreCase(REQUEST_REPLY) && !getMessageProtocol().equalsIgnoreCase(FIRE_AND_FORGET)) {
        throw new ConfigurationException(getLogPrefix() + "illegal value for messageProtocol [" + getMessageProtocol() + "], must be '" + REQUEST_REPLY + "' or '" + FIRE_AND_FORGET + "'");
    }
    if (getMessageProtocol().equalsIgnoreCase(REQUEST_REPLY)) {
        setForceMessageIdAsCorrelationId(true);
        if (CACHE_CONSUMER.equals(getCacheMode())) {
            boolean recovered = false;
            ReceiverBase receiverBase = getReceiverBase();
            if (receiverBase != null) {
                recovered = (receiverBase.isRecover() || receiverBase.isRecoverAdapter());
            }
            if (!recovered) {
                ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
                configWarnings.add(log, "attribute [cacheMode] already has a default value [" + CACHE_CONSUMER + "]");
            }
        }
        setCacheMode("CACHE_CONSUMER");
    } else {
        setUseReplyTo(false);
    }
    super.configure();
}
Also used : ReceiverBase(nl.nn.adapterframework.receivers.ReceiverBase) ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException)

Example 22 with ConfigurationWarnings

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

the class EsbSoapWrapperPipe method configure.

@Override
public void configure() throws ConfigurationException {
    if (mode == Mode.REG) {
        if (cmhVersion == 0) {
            cmhVersion = 1;
        } else if (cmhVersion < 0 || cmhVersion > 2) {
            ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
            String msg = getLogPrefix(null) + "cmhVersion [" + cmhVersion + "] for mode [" + mode.toString() + "] should be set to '1' or '2', assuming '1'";
            configWarnings.add(log, msg);
            cmhVersion = 1;
        }
    } else {
        if (cmhVersion != 0) {
            ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
            String msg = getLogPrefix(null) + "cmhVersion [" + cmhVersion + "] for mode [" + mode.toString() + "] should not be set, assuming '0'";
            configWarnings.add(log, msg);
            cmhVersion = 0;
        }
    }
    if ("wrap".equalsIgnoreCase(getDirection())) {
        if (StringUtils.isEmpty(getSoapHeaderSessionKey())) {
            setSoapHeaderSessionKey(DEFAULT_SOAP_HEADER_SESSION_KEY);
        }
        if (StringUtils.isEmpty(getSoapHeaderStyleSheet())) {
            if (mode == Mode.BIS) {
                setSoapHeaderStyleSheet("/xml/xsl/esb/bisSoapHeader.xsl");
            } else {
                setSoapHeaderStyleSheet("/xml/xsl/esb/soapHeader.xsl");
            }
        }
        if (StringUtils.isEmpty(getSoapBodyStyleSheet())) {
            if (mode == Mode.REG) {
                setSoapBodyStyleSheet("/xml/xsl/esb/soapBody.xsl");
            } else if (mode == Mode.BIS) {
                setSoapBodyStyleSheet("/xml/xsl/esb/bisSoapBody.xsl");
            }
        }
        stripDestination();
        if (isAddOutputNamespace()) {
            String ons = getOutputNamespaceBaseUri();
            if (getMessagingLayer().equals("P2P") || (StringUtils.isNotEmpty(p2pAlias) && getMessagingLayer().equalsIgnoreCase(p2pAlias))) {
                ons = ons + "/" + getBusinessDomain() + "/" + getApplicationName() + "/" + getApplicationFunction();
            } else {
                ons = ons + "/" + getBusinessDomain() + "/" + getServiceName() + (StringUtils.isEmpty(getServiceContext()) ? "" : "/" + getServiceContext()) + "/" + getServiceContextVersion() + "/" + getOperationName() + "/" + getOperationVersion();
            }
            setOutputNamespace(ons);
        }
        addParameters();
    }
    super.configure();
    if (isUseFixedValues()) {
        if (!ConfigurationUtils.stubConfiguration()) {
            throw new ConfigurationException(getLogPrefix(null) + "returnFixedDate only allowed in stub mode");
        }
    }
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException)

Example 23 with ConfigurationWarnings

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

the class Adapter method setRequestReplyLogging.

public void setRequestReplyLogging(boolean requestReplyLogging) {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    if (requestReplyLogging) {
        String msg = "Adapter [" + getName() + "] implementing setting of requestReplyLogging=true as msgLogLevel=Terse";
        configWarnings.add(log, msg);
        setMsgLogLevelNum(MsgLogUtil.MSGLOG_LEVEL_TERSE);
    } else {
        String msg = "Adapter [" + getName() + "] implementing setting of requestReplyLogging=false as msgLogLevel=None";
        configWarnings.add(log, msg);
        setMsgLogLevelNum(MsgLogUtil.MSGLOG_LEVEL_NONE);
    }
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 24 with ConfigurationWarnings

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

the class RecordXslTransformer method setXslFile.

/**
 * @deprecated configuration using attribute 'xslFile' is deprecated. Please use attribute 'styleSheetName'
 */
public void setXslFile(String xslFile) {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = "configuration using attribute 'xslFile' is deprecated. Please use attribute 'styleSheetName'";
    configWarnings.add(log, msg);
    setStyleSheetName(xslFile);
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 25 with ConfigurationWarnings

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

the class AbstractRecordHandler method setFieldsDifferConditionForPrefix.

public void setFieldsDifferConditionForPrefix(String fieldNrs) {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = ClassUtils.nameOf(this) + "[" + getName() + "]: the attribute 'fieldsDifferConditionForPrefix' has been renamed 'recordIdentifyingFields' since version 4.7";
    configWarnings.add(log, msg);
    setRecordIdentifyingFields(fieldNrs);
}
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