|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.api.local.impl.SessionFactoryImpl
public class SessionFactoryImpl
This class implements methods for creating local Session.
Constructor Summary | |
---|---|
SessionFactoryImpl()
|
Method Summary | |
---|---|
Session |
createSession()
Creates a session object. |
Session |
createSession(String aUserName,
String aPassword)
Creates a session object with the specified username and password. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionFactoryImpl()
Method Detail |
---|
public 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); }
createSession
in interface SessionFactory
DIException
- if an error occurs while creating Session.public Session createSession(String aUserName, 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); }
createSession
in interface SessionFactory
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 |