use of nl.nn.adapterframework.util.CredentialFactory in project iaf by ibissource.
the class SapSystem method initSystem.
private void initSystem() throws SapException {
try {
if (log.isDebugEnabled() && getTraceLevel() > 0) {
String logPath = AppConstants.getInstance().getResolvedProperty("logging.path");
JCO.setTracePath(logPath);
JCO.setTraceLevel(getTraceLevel());
}
clearSystem();
log.debug(getLogPrefix() + "creating ClientPool");
CredentialFactory cf = new CredentialFactory(getAuthAlias(), getUserid(), getPasswd());
// Add a connection pool to the specified system
// The pool will be saved in the pool list to be used
// from other threads by JCO.getClient(SID).
// The pool must be explicitely removed by JCO.removeClientPool(SID)
// Alias for this pool
JCO.addClientPool(// Alias for this pool
getName(), // Max. number of connections
getMaxConnections(), getMandant(), cf.getUsername(), cf.getPassword(), getLanguage(), getGwhost(), getSystemnr());
// Create a new repository
// The repository caches the function and structure definitions
// to be used for all calls to the system SID. The creation of
// redundant instances cause performance and memory waste.
log.debug(getLogPrefix() + "creating repository");
jcoRepository = JCO.createRepository(getName() + "-Repository", getName());
} catch (Throwable t) {
throw new SapException(getLogPrefix() + "exception initializing", t);
}
if (jcoRepository == null) {
throw new SapException(getLogPrefix() + "could not create repository");
}
}
use of nl.nn.adapterframework.util.CredentialFactory in project iaf by ibissource.
the class TibcoUtils method getConnection.
public static Connection getConnection(String provUrl, String authAlias, String userName, String password) throws JMSException {
String url = StringUtils.replace(provUrl, "tibjmsnaming:", "tcp:");
CredentialFactory cf = new CredentialFactory(authAlias, userName, password);
ConnectionFactory factory = new com.tibco.tibjms.TibjmsConnectionFactory(url);
return factory.createConnection(cf.getUsername(), cf.getPassword());
}
use of nl.nn.adapterframework.util.CredentialFactory in project iaf by ibissource.
the class ShowConfigurationStatus method addCertificateInfo.
private Map<String, Object> addCertificateInfo(HttpSender s) {
String certificate = s.getCertificate();
if (certificate == null || StringUtils.isEmpty(certificate))
return null;
Map<String, Object> certElem = new HashMap<String, Object>(4);
certElem.put("name", certificate);
String certificateAuthAlias = s.getCertificateAuthAlias();
certElem.put("authAlias", certificateAuthAlias);
URL certificateUrl = ClassUtils.getResourceURL(this, certificate);
if (certificateUrl == null) {
certElem.put("url", "");
certElem.put("info", "*** ERROR ***");
} else {
certElem.put("url", certificateUrl.toString());
String certificatePassword = s.getCertificatePassword();
CredentialFactory certificateCf = new CredentialFactory(certificateAuthAlias, null, certificatePassword);
String keystoreType = s.getKeystoreType();
certElem.put("info", getCertificateInfo(certificateUrl, certificateCf.getPassword(), keystoreType, "Certificate chain"));
}
return certElem;
}
use of nl.nn.adapterframework.util.CredentialFactory in project iaf by ibissource.
the class ShowConfigurationStatus method addCertificateInfo.
private Map<String, Object> addCertificateInfo(WebServiceSender s) {
String certificate = s.getCertificate();
if (certificate == null || StringUtils.isEmpty(certificate))
return null;
Map<String, Object> certElem = new HashMap<String, Object>(4);
certElem.put("name", certificate);
String certificateAuthAlias = s.getCertificateAuthAlias();
certElem.put("authAlias", certificateAuthAlias);
URL certificateUrl = ClassUtils.getResourceURL(this, certificate);
if (certificateUrl == null) {
certElem.put("url", null);
certElem.put("info", "*** ERROR ***");
} else {
certElem.put("url", certificateUrl.toString());
String certificatePassword = s.getCertificatePassword();
CredentialFactory certificateCf = new CredentialFactory(certificateAuthAlias, null, certificatePassword);
String keystoreType = s.getKeystoreType();
certElem.put("info", getCertificateInfo(certificateUrl, certificateCf.getPassword(), keystoreType, "Certificate chain"));
}
return certElem;
}
use of nl.nn.adapterframework.util.CredentialFactory in project iaf by ibissource.
the class ShowConfigurationStatus method addCertificateInfo.
private Map<String, Object> addCertificateInfo(FtpSender s) {
String certificate = s.getCertificate();
if (certificate == null || StringUtils.isEmpty(certificate))
return null;
Map<String, Object> certElem = new HashMap<String, Object>(4);
certElem.put("name", certificate);
String certificateAuthAlias = s.getCertificateAuthAlias();
certElem.put("authAlias", certificateAuthAlias);
URL certificateUrl = ClassUtils.getResourceURL(this, certificate);
if (certificateUrl == null) {
certElem.put("url", "");
certElem.put("info", "*** ERROR ***");
} else {
certElem.put("url", certificateUrl.toString());
String certificatePassword = s.getCertificatePassword();
CredentialFactory certificateCf = new CredentialFactory(certificateAuthAlias, null, certificatePassword);
String keystoreType = s.getCertificateType();
certElem.put("info", getCertificateInfo(certificateUrl, certificateCf.getPassword(), keystoreType, "Certificate chain"));
}
return certElem;
}
Aggregations