Search in sources :

Example 1 with ConfigurationWarnings

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

the class OracleTransactionalStorage method configure.

public void configure() throws ConfigurationException {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = "Class OracleTransactionalStorage is no longer maintained. Please replace with JdbcTransactionalStorage";
    configWarnings.add(log, msg);
    super.configure();
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 2 with ConfigurationWarnings

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

the class LdapChallengePipe method configure.

public void configure() throws ConfigurationException {
    super.configure();
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    configWarnings.add(log, "LdapChallengePipe is deprecated, please use LdapSender with operation challenge and check for returned message <LdapResult>Success</LdapResult>");
    if (StringUtils.isEmpty(ldapProviderURL) && getParameterList().findParameter("ldapProviderURL") == null) {
        throw new ConfigurationException("ldapProviderURL must be specified, either as attribute or as parameter");
    }
    if (StringUtils.isNotEmpty(ldapProviderURL) && getParameterList().findParameter("ldapProviderURL") != null) {
        throw new ConfigurationException("ldapProviderURL can only be specified once, either as attribute or as parameter");
    }
    if (getParameterList().findParameter("principal") == null) {
        throw new ConfigurationException("Parameter 'principal' must be specified");
    }
    if (getParameterList().findParameter("credentials") == null) {
        throw new ConfigurationException("Parameter 'credentials' must be specified");
    }
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException)

Example 3 with ConfigurationWarnings

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

the class JmsSender method setDeliveryMode.

public void setDeliveryMode(String deliveryMode) {
    int newMode = stringToDeliveryMode(deliveryMode);
    if (newMode == 0) {
        ConfigurationWarnings cw = ConfigurationWarnings.getInstance();
        cw.add(log, getLogPrefix() + "unknown delivery mode [" + deliveryMode + "], delivery mode not changed");
    } else
        this.deliveryMode = newMode;
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 4 with ConfigurationWarnings

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

the class JdbcFacade method getDatasourceInfo.

public String getDatasourceInfo() throws JdbcException {
    String dsinfo = null;
    Connection conn = null;
    try {
        conn = getConnection();
        DatabaseMetaData md = conn.getMetaData();
        String product = md.getDatabaseProductName();
        String productVersion = md.getDatabaseProductVersion();
        String driver = md.getDriverName();
        String driverVersion = md.getDriverVersion();
        String url = md.getURL();
        String user = md.getUserName();
        if (getDatabaseType() == DbmsSupportFactory.DBMS_DB2 && "WAS".equals(IbisContext.getApplicationServerType()) && md.getResultSetHoldability() != ResultSet.HOLD_CURSORS_OVER_COMMIT) {
            // For (some?) combinations of WebShere and DB2 this seems to be
            // the default and result in the following exception when (for
            // example?) a ResultSetIteratingPipe is calling next() on the
            // ResultSet after it's sender has called a pipeline which
            // contains a GenericMessageSendingPipe using
            // transactionAttribute="NotSupported":
            // com.ibm.websphere.ce.cm.ObjectClosedException: DSRA9110E: ResultSet is closed.
            ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
            configWarnings.add(log, "The database's default holdability for ResultSet objects is " + md.getResultSetHoldability() + " instead of " + ResultSet.HOLD_CURSORS_OVER_COMMIT + " (ResultSet.HOLD_CURSORS_OVER_COMMIT)");
        }
        dsinfo = "user [" + user + "] url [" + url + "] product [" + product + "] version [" + productVersion + "] driver [" + driver + "] version [" + driverVersion + "]";
    } catch (SQLException e) {
        log.warn("Exception determining databaseinfo", e);
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (SQLException e1) {
                log.warn("exception closing connection for metadata", e1);
            }
        }
    }
    return dsinfo;
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) SQLException(java.sql.SQLException) Connection(java.sql.Connection) DatabaseMetaData(java.sql.DatabaseMetaData)

Example 5 with ConfigurationWarnings

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

the class ShowConfigurationStatus method toConfigurationWarningsXml.

private XmlBuilder toConfigurationWarningsXml(List<Configuration> configurations, Configuration configurationSelected) {
    ConfigurationWarnings globalConfigurationWarnings = ConfigurationWarnings.getInstance();
    List<ErrorStoreCounter> errorStoreCounters = retrieveErrorStoreCounters(configurations, configurationSelected);
    List<String[]> selectedConfigurationWarnings = new ArrayList<String[]>();
    if (configurationSelected != null) {
        BaseConfigurationWarnings configWarns = configurationSelected.getConfigurationWarnings();
        for (int j = 0; j < configWarns.size(); j++) {
            String[] item = new String[2];
            item[0] = configurationSelected.getName();
            item[1] = (String) configWarns.get(j);
            selectedConfigurationWarnings.add(item);
        }
    } else {
        for (Configuration configuration : configurations) {
            BaseConfigurationWarnings configWarns = configuration.getConfigurationWarnings();
            for (int j = 0; j < configWarns.size(); j++) {
                String[] item = new String[2];
                item[0] = configuration.getName();
                item[1] = (String) configWarns.get(j);
                selectedConfigurationWarnings.add(item);
            }
        }
    }
    if (!globalConfigurationWarnings.isEmpty() || !errorStoreCounters.isEmpty() || !SHOW_COUNT_ERRORSTORE || !selectedConfigurationWarnings.isEmpty()) {
        XmlBuilder warningsXML = new XmlBuilder("warnings");
        if (!SHOW_COUNT_ERRORSTORE) {
            XmlBuilder warningXML = new XmlBuilder("warning");
            warningXML.setValue("Errorlog might contain records. This is unknown because errorStore.count.show is not set to true");
            warningXML.addAttribute("severe", true);
            warningsXML.addSubElement(warningXML);
        }
        for (int j = 0; j < errorStoreCounters.size(); j++) {
            ErrorStoreCounter esr = errorStoreCounters.get(j);
            XmlBuilder warningXML = new XmlBuilder("warning");
            warningXML.addAttribute("config", esr.config);
            if (esr.counter == 1) {
                warningXML.setValue("Errorlog contains 1 record. Service management should check whether this record has to be resent or deleted");
            } else {
                warningXML.setValue("Errorlog contains " + esr.counter + " records. Service Management should check whether these records have to be resent or deleted");
            }
            warningXML.addAttribute("severe", true);
            warningsXML.addSubElement(warningXML);
        }
        for (int j = 0; j < globalConfigurationWarnings.size(); j++) {
            XmlBuilder warningXML = new XmlBuilder("warning");
            warningXML.setValue((String) globalConfigurationWarnings.get(j));
            warningsXML.addSubElement(warningXML);
        }
        for (int j = 0; j < selectedConfigurationWarnings.size(); j++) {
            XmlBuilder warningXML = new XmlBuilder("warning");
            warningXML.addAttribute("config", selectedConfigurationWarnings.get(j)[0]);
            warningXML.setValue((String) selectedConfigurationWarnings.get(j)[1]);
            warningsXML.addSubElement(warningXML);
        }
        return warningsXML;
    }
    return null;
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) BaseConfigurationWarnings(nl.nn.adapterframework.configuration.BaseConfigurationWarnings) Configuration(nl.nn.adapterframework.configuration.Configuration) ArrayList(java.util.ArrayList) XmlBuilder(nl.nn.adapterframework.util.XmlBuilder) BaseConfigurationWarnings(nl.nn.adapterframework.configuration.BaseConfigurationWarnings)

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