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();
}
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);
}
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);
}
}
}
}
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();
}
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();
}
Aggregations