use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class CompareStringPipe method configure.
@Override
public void configure() throws ConfigurationException {
super.configure();
if (null == findForward(LESSTHANFORWARD))
throw new ConfigurationException(getLogPrefix(null) + "forward [" + LESSTHANFORWARD + "] is not defined");
if (null == findForward(GREATERTHANFORWARD))
throw new ConfigurationException(getLogPrefix(null) + "forward [" + GREATERTHANFORWARD + "] is not defined");
if (null == findForward(EQUALSFORWARD))
throw new ConfigurationException(getLogPrefix(null) + "forward [" + EQUALSFORWARD + "] is not defined");
if (StringUtils.isEmpty(sessionKey1) && StringUtils.isEmpty(sessionKey2)) {
boolean operand1Exists = false;
boolean operand2Exists = false;
ParameterList parameterList = getParameterList();
for (int i = 0; i < parameterList.size(); i++) {
Parameter parameter = parameterList.getParameter(i);
if (parameter.getName().equalsIgnoreCase(OPERAND1)) {
operand1Exists = true;
} else {
if (parameter.getName().equalsIgnoreCase(OPERAND2)) {
operand2Exists = true;
}
}
}
if (!operand1Exists && !operand2Exists) {
throw new ConfigurationException(getLogPrefix(null) + "has neither parameter [" + OPERAND1 + "] nor parameter [" + OPERAND2 + "] specified");
}
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class DigesterPipe method configure.
@Override
public void configure() throws ConfigurationException {
super.configure();
try {
rulesURL = ClassUtils.getResourceURL(classLoader, digesterRulesFile);
// load rules to check if they can be loaded when needed
DigesterLoader.createDigester(rulesURL);
} catch (Exception e) {
throw new ConfigurationException(getLogPrefix(null) + "Digester rules file [" + digesterRulesFile + "] not found", e);
}
log.debug(getLogPrefix(null) + "End of configuration");
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class ParameterResolutionContext method getValues.
/**
* @param parameters
* @return arraylist of <link>ParameterValue<link> objects
*/
public ParameterValueList getValues(ParameterList parameters) throws ParameterException {
if (parameters == null)
return null;
ParameterValueList result = new ParameterValueList();
for (Iterator<Parameter> parmIterator = parameters.iterator(); parmIterator.hasNext(); ) {
Parameter parm = parmIterator.next();
String parmSessionKey = parm.getSessionKey();
if ("*".equals(parmSessionKey)) {
String parmName = parm.getName();
for (Iterator<String> keyIterator = session.keySet().iterator(); keyIterator.hasNext(); ) {
String key = keyIterator.next();
if (!PipeLineSessionBase.tsReceivedKey.equals(key)) {
if ((key.startsWith(parmName) || "*".equals(parmName))) {
Parameter newParm = new Parameter();
newParm.setName(key);
newParm.setSessionKey(key);
try {
newParm.configure();
} catch (ConfigurationException e) {
throw new ParameterException(e);
}
result.add(getValue(result, newParm));
}
}
}
} else {
result.add(getValue(result, parm));
}
}
return result;
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class AbstractPipe method configure.
/**
* <code>configure()</code> is called after the {@link nl.nn.adapterframework.core.PipeLine Pipeline} is registered
* at the {@link nl.nn.adapterframework.core.Adapter Adapter}. Purpose of this method is to reduce
* creating connections to databases etc. in the {@link #doPipe(Object) doPipe()} method.
* As much as possible class-instantiating should take place in the
* <code>configure()</code> method, to improve performance.
*/
@Override
public void configure() throws ConfigurationException {
ParameterList params = getParameterList();
if (params != null) {
try {
params.configure();
} catch (ConfigurationException e) {
throw new ConfigurationException(getLogPrefix(null) + "while configuring parameters", e);
}
}
if (!StringUtils.isEmpty(getElementToMove()) && !StringUtils.isEmpty(getElementToMoveChain())) {
throw new ConfigurationException(getLogPrefix(null) + "cannot have both an elementToMove and an elementToMoveChain specified");
}
if (pipeForwards.isEmpty()) {
ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
String msg = getLogPrefix(null) + "has no forwards defined.";
configWarnings.add(log, msg);
} else {
for (Iterator<String> it = pipeForwards.keySet().iterator(); it.hasNext(); ) {
String forwardName = it.next();
PipeForward forward = pipeForwards.get(forwardName);
if (forward != null) {
String path = forward.getPath();
if (path != null) {
PipeLineExit plExit = pipeline.getPipeLineExits().get(path);
if (plExit == null) {
if (pipeline.getPipe(path) == null) {
ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
String msg = getLogPrefix(null) + "has a forward of which the pipe to execute [" + path + "] is not defined.";
configWarnings.add(log, msg);
}
}
}
}
}
}
if (getLocker() != null) {
getLocker().configure();
}
eventHandler = MonitorManager.getEventHandler();
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class IteratingPipe method configure.
public void configure() throws ConfigurationException {
super.configure();
msgTransformerPool = TransformerPool.configureTransformer(getLogPrefix(null), classLoader, getNamespaceDefs(), getXpathExpression(), getStyleSheetName(), getOutputType(), !isOmitXmlDeclaration(), getParameterList(), false);
try {
if (StringUtils.isNotEmpty(getStopConditionXPathExpression())) {
stopConditionTp = TransformerPool.getInstance(XmlUtils.createXPathEvaluatorSource(null, getStopConditionXPathExpression(), "xml", false));
}
} catch (TransformerConfigurationException e) {
throw new ConfigurationException(e);
}
}
Aggregations