use of nl.nn.adapterframework.parameters.Parameter in project iaf by ibissource.
the class ConfigData method setActiveConfig.
private FixedQuerySender setActiveConfig(String activeConfig, FixedQuerySender qs) {
Parameter param = new Parameter();
param.setName(ACTIVE_CONFIG);
if ("on".equals(activeConfig)) {
param.setValue(qs.getDbmsSupport().getBooleanValue(true));
} else {
param.setValue(qs.getDbmsSupport().getBooleanValue(false));
}
qs.addParameter(param);
return qs;
}
use of nl.nn.adapterframework.parameters.Parameter in project iaf by ibissource.
the class ConfigData method activeConfigQuery.
private String activeConfigQuery(IPipeLineSession session, String name, String formJmsRealm, String result) throws PipeRunException {
FixedQuerySender qs = (FixedQuerySender) ibisContext.createBeanAutowireByName(FixedQuerySender.class);
try {
qs.setName("QuerySender");
qs.setJmsRealm(formJmsRealm);
qs.setQueryType("update");
qs.setQuery("UPDATE IBISCONFIG SET ACTIVECONFIG = '" + qs.getDbmsSupport().getBooleanValue(false) + "' WHERE NAME=?");
Parameter param = new Parameter();
param.setName("name");
param.setValue(name);
qs.addParameter(param);
qs.setScalar(true);
qs.configure();
qs.open();
ParameterResolutionContext prc = new ParameterResolutionContext(DUMMY, session);
result = qs.sendMessage(DUMMY, DUMMY, prc);
} catch (Exception t) {
throw new PipeRunException(this, getLogPrefix(session) + "Error occured on executing jdbc query", t);
} finally {
qs.close();
}
return result;
}
use of nl.nn.adapterframework.parameters.Parameter in project iaf by ibissource.
the class LdapSenderTest method updateAttribute.
@Test
public void updateAttribute() throws SAXException, IOException, ConfigurationException, SenderException, LDAPException {
String result;
LDAPConnection connection = inMemoryDirectoryServer.getConnection();
LdapSender ldapSender = null;
try {
ldapSender = new LdapSender();
ldapSender.setLdapProviderURL("ldap://" + connection.getConnectedAddress() + ":" + connection.getConnectedPort());
ldapSender.setOperation("update");
Parameter parameter = new Parameter();
parameter.setName("entryName");
parameter.setValue("cn=LEA Administrator,ou=groups,ou=development," + baseDNs);
ldapSender.addParameter(parameter);
ldapSender.configure();
ldapSender.open();
result = ldapSender.sendMessage("dummy", "<attributes><attribute name=\"mail\"><value>info@ibissource.org</value></attribute></attributes>");
} finally {
if (ldapSender != null) {
ldapSender.close();
}
if (connection != null) {
connection.close();
}
}
assertEquals("<LdapResult>Success</LdapResult>", result);
compareXML("Ldap/expected/updateAttribute.xml", getTree());
}
use of nl.nn.adapterframework.parameters.Parameter in project iaf by ibissource.
the class LdapSenderTest method updateNewEntry.
@Test
public void updateNewEntry() throws SAXException, IOException, ConfigurationException, SenderException, LDAPException {
String result;
LDAPConnection connection = inMemoryDirectoryServer.getConnection();
LdapSender ldapSender = null;
try {
ldapSender = new LdapSender();
ldapSender.setLdapProviderURL("ldap://" + connection.getConnectedAddress() + ":" + connection.getConnectedPort());
ldapSender.setOperation("update");
Parameter parameter = new Parameter();
parameter.setName("entryName");
parameter.setValue("cn=LEA Administrator,ou=groups,ou=development," + baseDNs);
ldapSender.addParameter(parameter);
Parameter parameter2 = new Parameter();
parameter2.setName("newEntryName");
parameter2.setValue("cn=LEA Administrator,ou=people,ou=development," + baseDNs);
ldapSender.addParameter(parameter2);
ldapSender.configure();
ldapSender.open();
result = ldapSender.sendMessage("dummy", "<dummy/>");
} finally {
if (ldapSender != null) {
ldapSender.close();
}
if (connection != null) {
connection.close();
}
}
assertEquals("<LdapResult>Success</LdapResult>", result);
compareXML("Ldap/expected/updateNewEntry.xml", getTree());
}
use of nl.nn.adapterframework.parameters.Parameter in project iaf by ibissource.
the class LdapSenderTest method getTree.
private String getTree() throws LDAPException, ConfigurationException, SenderException {
LDAPConnection connection = inMemoryDirectoryServer.getConnection();
LdapSender ldapSender = null;
try {
ldapSender = new LdapSender();
ldapSender.setLdapProviderURL("ldap://" + connection.getConnectedAddress() + ":" + connection.getConnectedPort());
ldapSender.setOperation("getTree");
Parameter parameter = new Parameter();
parameter.setName("entryName");
parameter.setValue(baseDNs);
ldapSender.addParameter(parameter);
ldapSender.configure();
ldapSender.open();
return ldapSender.sendMessage("dummy", "dummy");
} finally {
if (ldapSender != null) {
ldapSender.close();
}
if (connection != null) {
connection.close();
}
}
}
Aggregations