|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IlrSessionFactory
A static object used to connect a
registered user to Decision Center and get a corresponding
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
Method Summary | |
---|---|
void |
connect(AuthenticationCredentials credentials,
String url,
String dataSourceName)
Establishes a connection to Decision Center. |
void |
connect(String username,
String password,
String url,
String dataSourceName)
Connects the given user to Decision Center. |
IlrSession |
getSession()
Returns the session created by the connection. |
Method Detail |
---|
IlrSession getSession()
null
if no user is connected or if the connection failed.void connect(String username, String password, String url, 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, String url, String dataSourceName) throws IlrConnectException
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
,
AuthenticationHandler
|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |