public interface IlrSessionFactory
extends java.io.Serializable
IlrSession instance.
The following code example shows how to connect to Decision Center and retrieve an active session:
String serverUrl = "http://hostname:9080/teamserver";
String datasource = "jdbc/ilogDataSource";
String login = "rtsAdmin";
String password = "rtsAdmin";
String project = "loanvalidation-rules";
IlrSessionFactory factory = new IlrRemoteSessionFactory();
try {
factory.connect(login, password, serverUrl, datasource);
IlrSession session = factory.getSession();
//Perform some actions
//You should always close a session after actions are performed
//to free up Decision Center resources and improve performance.
session.close();
}
catch (IlrConnectException cE)
{
cE.printStackTrace();
}
IlrSession| Modifier and Type | Method and Description |
|---|---|
void |
connect(AuthenticationCredentials credentials,
java.lang.String url,
java.lang.String dataSourceName)
Deprecated.
As of 8.9.0.1, use
connect(String, String, RemoteConnectionContext) |
IlrSession |
connect(java.lang.String url,
java.lang.String datasource,
RemoteConnectionContext context)
Establishes a connection to Decision Center.
|
void |
connect(java.lang.String username,
java.lang.String password,
java.lang.String url,
java.lang.String dataSourceName)
Connects the given user to Decision Center.
|
IlrSession |
getSession()
Returns the session created by the connection.
|
IlrSession getSession()
null if no user is connected or if the connection failed.void connect(java.lang.String username,
java.lang.String password,
java.lang.String url,
java.lang.String dataSourceName)
throws IlrConnectException
Once connected, getSession will return a session
associated with this user.
IlrConnectException - If the connection failed.username - The user name.password - The user password.url - The URL of the application server.dataSourceName - The name of the data source. If null, the default name is
jdbc/ilogDataSource.IlrSession.getUserName()void connect(AuthenticationCredentials credentials, java.lang.String url, java.lang.String dataSourceName) throws IlrConnectException
connect(String, String, RemoteConnectionContext)AuthenticationHandler that is responsible for the connection.
You have two options to set the handler:
AuthenticationCredentials.AuthenticationHandlerClassname as authentication details of the credentials with the fully qualified name of the implementation of AuthenticationHandler.AuthenticationHandler.
Once connected, getSession will return a session
associated with this user.
IlrConnectException - If the connection failed.credentials - The credentials to use for the connection.url - The URL of the application server.dataSourceName - The name of the data source. If null, the default name is
jdbc/ilogDataSource.IlrSession.getUserName(),
AuthenticationCredentials,
AuthenticationHandlerIlrSession connect(java.lang.String url, java.lang.String datasource, RemoteConnectionContext context) throws IlrConnectException
IlrConnectException - if the connection failed.url - The URL of the application server.datasource - The name of the data source. If null, the default name is jdbc/ilogDataSource.context - The context to use to connect to Decision CenterRemoteConnectionContext© Copyright IBM Corp. 1987, 2017