|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SessionFactory
This interface provides methods for creating a Session.
Method Summary | |
---|---|
Session |
createSession()
Creates a session object. |
Session |
createSession(java.lang.String aUserName,
java.lang.String aPassword)
Creates a session object with the specified username and password. |
Method Detail |
---|
Session createSession() throws DIException
Example:
var session = APIEngine.getLocalSession(); var runningConfigs = session.getConfigInstances();
Example:
var session = (new com.ibm.di.api.local.impl.SessionFactoryImpl).createSession(); var serverInfo = session.getServerInfo(); if (serverInfo == null) { throw new Exception("Server version information is not available!"); } var serverVersion = serverInfo.getServerVersion(); if (serverVersion.startsWith("7.1")) { // TDI 7.1 specific code } else if (serverVersion.startsWith("7.0")) { // TDI 7.0 specific code } else if (serverVersion.startsWith("6.1")) { // TDI 6.1 specific code } else { throw new Exception("Unsupported TDI server version: " + serverVersion); }
DIException
- if an error occurs while creating Session.Session createSession(java.lang.String aUserName, java.lang.String aPassword) throws DIException
Example:
var session = APIEngine.getLocalSession("username", "password"); var runningConfigs = session.getConfigInstances();
Example:
var nick = "Username"; var pass = "Difficult password"//Notecustom authentication must be enabled
var session = (new com.ibm.di.api.local.impl.SessionFactoryImpl).createSession(nick , pass); var serverInfo = session.getServerInfo(); if (serverInfo == null) { throw new Exception("Server version information is not available!"); } var serverVersion = serverInfo.getServerVersion(); if (serverVersion.startsWith("7.1")) { // TDI 7.1 specific code } else if (serverVersion.startsWith("7.0")) { // TDI 7.0 specific code } else if (serverVersion.startsWith("6.1")) { // TDI 6.1 specific code } else { throw new Exception("Unsupported TDI server version: " + serverVersion); }
aUserName
- the username for authentication.aPassword
- the password for authentication.
DIException
- if an error occurs while creating Session.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |