JAVA/CORBA CLASSES
Applications call the NotesFactory createSession methods to create a Session object.
Creating a Domino session
For applications making local calls based on the Notes user ID, create a Session object as follows. A Domino server or Notes client must be installed locally.
Note The createSessionWithFullAccess methods are new with Release 6.
To access a server using Single Sign-on, create an Internet Session object as follows. For remote (IIOP) calls, the first parameter is the host name or IP address of the Domino server. For local calls, the first parameter is null.
To enable SSL (Secure Sockets Layer), use the String args[] parameter and specify "-ORBEnableSSLSecurity" for args[0]. For remote (IIOP) applications, the client must have access to the server's trusted root certificate, stored in TrustedCerts.class in domino/java in the server's data directory. This file is generated by the DIIOP task when it starts and is enabled to listen on the SSL port specified in the server document. The HTTP task delivers TrustedCerts.class to applets. For other applications, ensure that TrustedCerts.class is on the classpath.
The methods named createSessionWithIOR get an Internet session through explicit specification of the IOR. Typically this is not necessary. The createSession methods that specify a host call getIOR, which gets the IOR by querying the HTTP or DIIOP task listening on hostname:port for a file named diiop_ior.txt. Use the createSessionWithIOR methods if you have another mechanism for getting the IOR.
The createSession methods that include an org.omg.CORBA.ORB parameter create a session using an existing ORB, which you first create with one of the createORB methods. Using one ORB for multiple sessions (connection pooling) saves network overhead. However, make sure the connection can handle all the sessions you create, and be sure to recycle when you terminate a session.
For applets, use AppletBase.openSession. For agents, use AgentBase.getSession.
Specification of NotesFactory
The specification of the NotesFactory class is as follows:
public class NotesFactory { /* Local session - Notes client must be installed */ static public Session createSessionWithFullAccess() throws NotesException static public Session createSessionWithFullAccess(String passwd) throws NotesException static public Session createSession() throws NotesException /* Remote (IIOP) session using host name */ static public Session createSession(String host) throws NotesException static public Session createSession(String host, String user, String passwd) throws NotesException static public Session createSession(String host, String args[], String user, String passwd) throws NotesException static public Session createSession(String host, org.omg.CORBA.ORB orb, String user, String passwd) throws NotesException /* Remote (IIOP) session using IOR */ static public Session createSessionWithIOR(String IOR) throws NotesException static public Session createSessionWithIOR(String IOR, String user, String passwd) throws NotesException static public Session createSessionWithIOR(String IOR, String args[], String user, String passwd) throws NotesException static public Session createSessionWithIOR(String IOR, org.omg.CORBA.ORB orb, String user, String passwd) throws NotesException /* Remote (IIOP) session for applet */ static public Session createSession(java.applet.Applet app, String user, String passwd) throws NotesException static public Session createSession(java.applet.Applet app, org.omg.CORBA.ORB orb, String user, String passwd) throws NotesException /* For Single Sign-on */ static public Session createSession(String host, String cookie) throws NotesException static public Session createSession(String host, org.omg.SecurityLevel2.Credentials token) throws NotesException static public Session createSession(String host, HttpServletRequest request) static public Session createSession(String host, String args[], String cookie) throws NotesException static public Session createSession(String host, String args[], org.omg.SecurityLevel2.Credentials token) throws NotesException static public Session createSession(String host, String args[], HttpServletRequest request) throws NotesException static public Session createSession(String host, org.omg.CORBA.Orb orb, String cookie) throws NotesException static public Session createSession(String host, org.omg.CORBA.Orb orb, org.omg.SecurityLevel2.Credentials token) throws NotesException static public Session createSession(String host, org.omg.CORBA.Orb orb, HttpServletRequest request) throws NotesException /* Login to Websphere with session using LPTA token */ static public Object getCredentials(Session sess) throws NotesException /* Create an ORB for connection sharing */ static public org.omg.CORBA.ORB createORB() static public org.omg.CORBA.ORB createORB(String args[]) static public org.omg.CORBA.ORB createORB(Properties props) /* Get IOR from host */ static public String getIOR(String host) throws Exception; }
Example See Also