Interface SessionFactory

  • All Superinterfaces:
    java.rmi.Remote
    All Known Implementing Classes:
    SessionFactoryImpl

    public interface SessionFactory
    extends java.rmi.Remote
    This interface provides methods for creating a Session.
    • Method Detail

      • createSession

        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());
         
        Returns:
        The Session object.
        Throws:
        DIException - if an error occurs while creating Session.
        java.rmi.RemoteException - if a communication-related exception occurs.
      • createSession

        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());
         
        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.