Search in sources :

Example 1 with SapException

use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.

the class SapSender method getFunction.

public JCoFunction getFunction(SapSystem sapSystem, ParameterValueList pvl) throws SapException {
    if (StringUtils.isNotEmpty(getSapSystemName()) && StringUtils.isNotEmpty(getFunctionName())) {
        return getFunctionTemplate().getFunction();
    }
    String functionName = getFunctionName();
    if (StringUtils.isEmpty(functionName)) {
        if (pvl == null) {
            throw new SapException("no parameters to determine functionName from");
        }
        ParameterValue pv = pvl.getParameterValue(getFunctionNameParam());
        if (pv == null) {
            throw new SapException("could not get ParameterValue for parameter [" + getFunctionNameParam() + "]");
        }
        functionName = pv.asStringValue(null);
    }
    if (StringUtils.isEmpty(functionName)) {
        throw new SapException("could not determine functionName using parameter [" + getFunctionNameParam() + "]");
    }
    return getFunctionTemplate(sapSystem, functionName).getFunction();
}
Also used : ParameterValue(nl.nn.adapterframework.parameters.ParameterValue) SapException(nl.nn.adapterframework.extensions.sap.SapException)

Example 2 with SapException

use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.

the class JcoResourceHolder method commitAll.

public void commitAll() throws SapException {
    for (Iterator<JCoDestination> itc = this.destinations.iterator(); itc.hasNext(); ) {
        JCoDestination destination = itc.next();
        List<String> tids = this.tidsPerDestination.get(destination);
        for (Iterator<String> itt = tids.iterator(); itt.hasNext(); ) {
            String tid = itt.next();
            try {
                destination.confirmTID(tid);
            } catch (Throwable t) {
                throw new SapException("Could not confirm TID [" + tid + "]");
            }
        }
    }
}
Also used : JCoDestination(com.sap.conn.jco.JCoDestination) SapException(nl.nn.adapterframework.extensions.sap.SapException)

Example 3 with SapException

use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.

the class SapFunctionFacade method openFacade.

public void openFacade() throws SapException {
    if (sapSystem != null) {
        sapSystem.openSystem();
        log.info("open SapSystem [" + sapSystem.toString() + "]");
        // Something has changed, so remove the cached templates
        SapSystemDataProvider.getInstance().updateSystem(sapSystem);
        if (StringUtils.isNotEmpty(getFunctionName())) {
            // Listeners and IdocSenders don't use a functionName
            ftemplate = getFunctionTemplate(sapSystem, getFunctionName());
            log.debug("found JCoFunctionTemplate [" + ftemplate.toString() + "]");
            try {
                calculateStaticFieldIndices(ftemplate);
            } catch (Exception e) {
                throw new SapException(getLogPrefix() + "Exception calculation field-indices [" + getFunctionName() + "]", e);
            }
        }
    } else {
        log.info("open ALL SapSystems");
        SapSystem.openSystems();
    }
}
Also used : ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) SapException(nl.nn.adapterframework.extensions.sap.SapException) SapException(nl.nn.adapterframework.extensions.sap.SapException)

Example 4 with SapException

use of nl.nn.adapterframework.extensions.sap.SapException in project iaf by ibissource.

the class SapSystem method initSystem.

private void initSystem() throws SapException {
    try {
        SapSystemDataProvider.getInstance().updateSystem(this);
        if (log.isDebugEnabled() && getTraceLevel() > 0) {
            String logPath = AppConstants.getInstance().getResolvedProperty("logging.path");
            JCo.setTrace(getTraceLevel(), logPath);
        }
    } catch (Throwable t) {
        throw new SapException(getLogPrefix() + "exception initializing", t);
    }
}
Also used : SapException(nl.nn.adapterframework.extensions.sap.SapException)

Aggregations

SapException (nl.nn.adapterframework.extensions.sap.SapException)4 JCoDestination (com.sap.conn.jco.JCoDestination)1 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)1 ParameterValue (nl.nn.adapterframework.parameters.ParameterValue)1