use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class Wsdl method getSoapAction.
protected String getSoapAction(IListener listener) {
AppConstants appConstants = AppConstants.getInstance(pipeLine.getAdapter().getConfiguration().getClassLoader());
String sa = appConstants.getResolvedProperty("wsdl." + getName() + "." + listener.getName() + ".soapAction");
if (sa != null) {
return sa;
}
sa = appConstants.getResolvedProperty("wsdl." + getName() + ".soapAction");
if (sa != null) {
return sa;
}
sa = appConstants.getResolvedProperty("wsdl.soapAction");
if (sa != null) {
return sa;
}
if (esbSoapOperationName != null && esbSoapOperationVersion != null) {
return esbSoapOperationName + "_" + esbSoapOperationVersion;
}
return "${wsdl." + getName() + "." + listener.getName() + ".soapAction}";
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class Wsdl method getLocation.
protected String getLocation(String defaultLocation) {
AppConstants appConstants = AppConstants.getInstance(pipeLine.getAdapter().getConfiguration().getClassLoader());
String sa = appConstants.getResolvedProperty("wsdl." + getName() + ".location");
if (sa != null) {
return sa;
}
sa = appConstants.getResolvedProperty("wsdl.location");
if (sa != null) {
return sa;
}
return defaultLocation;
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class HostnamePropertySourcePostProcessor method convertProperties.
@Override
protected void convertProperties(Properties props) {
AppConstants appConstants = AppConstants.getInstance();
String hostname = appConstants.getResolvedProperty(HOSTNAME_PROPERTY);
if (StringUtils.isEmpty(hostname)) {
hostname = Misc.getHostname();
appConstants.setProperty(HOSTNAME_PROPERTY, hostname);
props.put(HOSTNAME_PROPERTY, hostname);
}
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class ConfigurationDigester method digestConfiguration.
private void digestConfiguration(Configuration configuration) throws ConfigurationException {
String configurationFile = ConfigurationUtils.getConfigurationFile(configuration.getClassLoader(), configuration.getName());
Digester digester = null;
Resource configurationResource = Resource.getResource(configuration, configurationFile);
if (configurationResource == null) {
throw new ConfigurationException("Configuration file [" + configurationFile + "] not found in ClassLoader [" + configuration.getClassLoader() + "]");
}
try {
digester = getDigester(configuration);
if (log.isDebugEnabled())
log.debug("digesting configuration [" + configuration.getName() + "] configurationFile [" + configurationFile + "]");
AppConstants appConstants = AppConstants.getInstance(configuration.getClassLoader());
parseAndResolveEntitiesAndProperties(digester, configuration, configurationResource, appConstants);
configLogger.info(configuration.getLoadedConfiguration());
} catch (Throwable t) {
// wrap exception to be sure it gets rendered via the IbisException-renderer
String currentElementName = null;
if (digester != null) {
currentElementName = digester.getCurrentElementName();
}
throw new ConfigurationException("error during unmarshalling configuration from file [" + configurationFile + "] with digester-rules-file [" + getDigesterRules() + "] in element [" + currentElementName + "]", t);
}
}
use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.
the class GalmMonitorAdapter method configure.
@Override
public void configure() throws ConfigurationException {
super.configure();
hostname = Misc.getHostname();
AppConstants appConstants = AppConstants.getInstance();
sourceId = appConstants.getResolvedProperty(SOURCE_ID_KEY);
if (StringUtils.isEmpty(sourceId)) {
throw new ConfigurationException("cannot read sourceId from [" + SOURCE_ID_KEY + "]");
}
if (sourceId.indexOf(' ') >= 0) {
StringBuffer replacement = new StringBuffer();
boolean replacementsMade = false;
for (int i = 0; i < sourceId.length(); i++) {
char c = sourceId.charAt(i);
if (Character.isLetterOrDigit(c) || c == '_') {
replacement.append(c);
} else {
replacement.append('_');
replacementsMade = true;
}
}
if (replacementsMade) {
if (log.isDebugEnabled())
log.debug("sourceId [" + sourceId + "] read from [" + SOURCE_ID_KEY + "] contains spaces, replacing them with underscores, resulting in [" + replacement.toString() + "]");
sourceId = replacement.toString();
}
}
dtapStage = appConstants.getString(DTAP_STAGE_KEY, null);
if (StringUtils.isEmpty(dtapStage)) {
throw new ConfigurationException("cannot read dtapStage from [" + DTAP_STAGE_KEY + "]");
}
if (!("DEV".equals(dtapStage)) && !("TEST".equals(dtapStage)) && !("ACCEPT".equals(dtapStage)) && !("PROD".equals(dtapStage))) {
throw new ConfigurationException("dtapStage [" + dtapStage + "] read from [" + DTAP_STAGE_KEY + "] not equal to one of DEV, TEST, ACCEPT, PROD");
}
}
Aggregations