com.ibm.di.api.remote.impl
Class SessionFactoryImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by com.ibm.di.api.remote.impl.APIRemoteObject
                  extended by com.ibm.di.api.remote.impl.SessionFactoryImpl
All Implemented Interfaces:
SessionFactory, java.io.Serializable, java.rmi.Remote

public class SessionFactoryImpl
extends APIRemoteObject
implements SessionFactory

This class implements methods for creating remote Session.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Method Summary
static SessionFactoryImpl createInstance()
          Creates new instance of this class.
 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.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createSession

public Session createSession()
                      throws DIException,
                             java.rmi.RemoteException
Creates a session object.

Example:

 var sf = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
 var session = sf.createSession();
 task.logmsg("OS: " + session.getServerInfo().getOperatingSystem());
 

Specified by:
createSession in interface SessionFactory
Returns:
The Session object.
Throws:
DIException - if an error occurs while creating Session.
java.rmi.RemoteException - if a communication-related exception occurs.

createSession

public Session createSession(java.lang.String aUserName,
                             java.lang.String aPassword)
                      throws DIException,
                             java.rmi.RemoteException
Creates a session object with the specified username and password.

Example:

 var nick = "Username";
 var pass = "Difficult password";
 var sf = java.rmi.Naming.lookup("rmi://127.0.0.1:1099/SessionFactory");
 var session = sf.createSession();
 task.logmsg("OS: " + session.getServerInfo().getOperatingSystem());
 

Specified by:
createSession in interface SessionFactory
Parameters:
aUserName - the username for authentication.
aPassword - the password for authentication.
Returns:
The Session object.
Throws:
DIException - if an error occurs while creating Session.
java.rmi.RemoteException - if a communication-related exception occurs.

createInstance

public static SessionFactoryImpl createInstance()
                                         throws DIException,
                                                java.rmi.RemoteException
Creates new instance of this class.

Returns:
SessionFactoryImpl object
Throws:
DIException - if Runtime or Security exception occurs.
java.rmi.RemoteException - if a communication-related exception occurs.