Search in sources :

Example 1 with AppConstants

use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.

the class MonitorAdapterBase method configure.

public void configure() throws ConfigurationException {
    if (StringUtils.isEmpty(getName())) {
        setName(ClassUtils.nameOf(this));
    }
    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 + "]");
    }
}
Also used : ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) AppConstants(nl.nn.adapterframework.util.AppConstants)

Example 2 with AppConstants

use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.

the class ShowEnvironmentVariables method addPropertiesToXmlBuilder.

public void addPropertiesToXmlBuilder(XmlBuilder container, Properties props, String setName, List<String> propsToHide, boolean skipResolve) {
    Enumeration enumeration = props.keys();
    XmlBuilder propertySet = new XmlBuilder("propertySet");
    propertySet.addAttribute("name", setName);
    container.addSubElement(propertySet);
    while (enumeration.hasMoreElements()) {
        String propName = (String) enumeration.nextElement();
        XmlBuilder property = new XmlBuilder("property");
        property.addAttribute("name", XmlUtils.encodeCdataString(propName));
        String propValue;
        if (skipResolve && props instanceof AppConstants) {
            propValue = ((AppConstants) props).getUnresolvedProperty(propName);
        } else {
            propValue = props.getProperty(propName);
        }
        if (propsToHide != null && propsToHide.contains(propName)) {
            propValue = Misc.hide(propValue);
        }
        property.setCdataValue(XmlUtils.encodeCdataString(propValue));
        propertySet.addSubElement(property);
    }
}
Also used : Enumeration(java.util.Enumeration) XmlBuilder(nl.nn.adapterframework.util.XmlBuilder) AppConstants(nl.nn.adapterframework.util.AppConstants)

Example 3 with AppConstants

use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.

the class FxfPropertyPlaceholderConfigurer method convertProperties.

@Override
protected void convertProperties(Properties props) {
    AppConstants appConstants = AppConstants.getInstance();
    String fxfDir = appConstants.getResolvedProperty("fxf.dir");
    if (fxfDir == null) {
        // Use default location, see was.policy too
        fxfDir = System.getProperty("APPSERVER_ROOT_DIR");
        if (fxfDir != null) {
            fxfDir = fxfDir + File.separator + "fxf-work";
        }
    }
    if (fxfDir != null) {
        appConstants.putPropertyPlaceholderConfigurerProperty("fxf.dir", fxfDir);
        props.put("fxf.dir", fxfDir);
    }
    log.debug("FxF directory: " + fxfDir);
}
Also used : AppConstants(nl.nn.adapterframework.util.AppConstants)

Example 4 with AppConstants

use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.

the class LowerCasePropertyPlaceholderConfigurer method convertProperties.

@Override
protected void convertProperties(Properties props) {
    AppConstants appConstants = AppConstants.getInstance();
    String instanceName = appConstants.getProperty("instance.name");
    if (instanceName != null) {
        String lowerCase = instanceName.toLowerCase();
        appConstants.putPropertyPlaceholderConfigurerProperty("instance.name.lc", lowerCase);
        props.put("instance.name.lc", lowerCase);
    }
}
Also used : AppConstants(nl.nn.adapterframework.util.AppConstants)

Example 5 with AppConstants

use of nl.nn.adapterframework.util.AppConstants in project iaf by ibissource.

the class OverwritePropertyPlaceholderConfigurer method convertProperties.

@Override
protected void convertProperties(Properties props) {
    AppConstants appConstants = AppConstants.getInstance();
    appConstants.putPropertyPlaceholderConfigurerProperty(propertyName, propertyValue);
    props.put(propertyName, propertyValue);
}
Also used : AppConstants(nl.nn.adapterframework.util.AppConstants)

Aggregations

AppConstants (nl.nn.adapterframework.util.AppConstants)42 IbisContext (nl.nn.adapterframework.configuration.IbisContext)7 File (java.io.File)6 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)6 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)3 FileWriter (java.io.FileWriter)2 URL (java.net.URL)2 Enumeration (java.util.Enumeration)2 ServletContext (javax.servlet.ServletContext)2 ServletException (javax.servlet.ServletException)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 InputStream (java.io.InputStream)1 OutputStream (java.io.OutputStream)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 ZipEntry (java.util.zip.ZipEntry)1 ZipInputStream (java.util.zip.ZipInputStream)1