JAVA/CORBA クラス
アプリケーションで Session オブジェクトを作成するには、NotesFactory クラスの createSession メソッドを呼び出します。
Lotus Domino セッションを作成する
Lotus Notes のユーザー ID に基づいてローカル呼び出しを行うアプリケーションでは、次の方法で Session オブジェクトを作成します。この場合、Lotus Domino サーバーまたは Lotus Notes クライアントがローカルにインストールされている必要があります。
メモ この createTrustedSession メソッドは R8.0.1 で新しく追加されました。
メモ createSessionWithFullAccess メソッドは、Release 6 で新しく追加されました。
シングルサインオンを使用してサーバーにアクセスするには、Internet Session オブジェクトを次のように作成します。リモート (IIOP) 呼び出しを行う場合は、最初のパラメータに Lotus Domino サーバーのホスト名または IP アドレスを指定します。ローカル呼び出しを行う場合は、最初のパラメータは null となります。
SSL (セキュアソケットレイヤー) を有効にするには、String args[] パラメータを使用して args 配列の要素として「-ORBEnableSSLSecurity」を指定します。リモート (IIOP) アプリケーションの場合、クライアントは、サーバーのデータディレクトリにある domino/java の TrustedCerts.class に保存された、サーバーの信頼されたルートの証明書に対するアクセス権が必要です。このファイルは、DIIOP タスクの起動時に生成され、サーバー文書に指定された SSL ポートでの待機が可能になります。この HTTP タスクが各アプレットに TrustedCerts.class を配信します。他のアプリケーションの場合は、TrustedCerts.class が classpath 上にあることを確認してください。
createSessionWithIOR というメソッドは、IOR の明示的な指定により、インターネットセッションを取得します。通常、これは不要です。ホストを指定した createSession メソッドは getIOR を呼び出します。getIOR は、「ホスト名:ポート番号」によって「diiop_ior.txt」ファイルを受信する HTTP または DIIOP タスクを検索して、IOR を取得します。IOR を別の手段で取得できる場合は、createSessionWithIOR メソッドを使用します。
IOR を送れるのが HTTPS ポートだけの場合は、String args[] パラメータを使用して getIOR を呼び出し、arg 配列の要素として「-HTTPEnableSSLSecurity」を指定します。次に、返された IOR を createSessionWithIOR 呼び出しで使用します。
TrustedCerts.class 以外のファイルに、サーバーの信頼されたルートの証明書が含まれている場合には、arg 配列の要素として「-ORBSSLCertificates=filename」を指定します。notes.ini 変数として「DIIOP_DUP_KEYRING=filename」が指定されると、DIIOP タスクは TrustedCerts.class と複製ファイルを生成します。これは、別々の信頼されたルートの証明書を持つ 2 つのサーバーにアクセスする場合に役立ちます。
getIOR 操作は、SSL でも認証されません。
アクセスされる HTTP または HTTPS ポートで匿名アクセスが許可されていない場合は、user パラメータと passwd パラメータを指定して getIOR メソッドを使用します。
メモ args[]、user、および passwd の各パラメータを取る getIOR メソッドは Release 6.5 で新しく追加されました。
org.omg.CORBA.ORB パラメータを含む createSession メソッドは、既存の ORB を使用してセッションを作成します。ORB は、createORB メソッドのいずれかを使用して最初に作成します。複数のセッションに 1 つの ORB を使用する (接続プール) と、ネットワークオーバーヘッドが保存されます。ただし、この接続が、作成したセッションをすべて処理できることを確認してください。また、セッションを終了するときに recycle を実行するようにしてください。
アプレットに対しては AppletBase.openSession を使用してください。エージェントに対しては AgentBase.getSession を使用してください。
NotesFactory の仕様
NotesFactory クラスの仕様は次のとおりです。
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 static public Session createSessionWithIOR(String IOR, String cookie) throws NotesException static public Session createSessionWithIOR(String IOR, org.omg.SecurityLevel2.Credentials token) throws NotesException static public Session createSessionWithIOR(String IOR, HttpServletRequest request) static public Session createSessionWithIOR(String IOR, String args[], String cookie) throws NotesException static public Session createSessionWithIOR(String IOR, String args[], org.omg.SecurityLevel2.Credentials token) throws NotesException static public Session createSessionWithIOR(String IOR, String args[], HttpServletRequest request) throws NotesException static public Session createSessionWithIOR(String IOR, org.omg.CORBA.Orb orb, String cookie) throws NotesException static public Session createSessionWithIOR(String IOR, org.omg.CORBA.Orb orb, org.omg.SecurityLevel2.Credentials token) throws NotesException static public Session createSessionWithIOR(String IOR, 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 NotesException; static public String getIOR(String host, String user, String passwd) throws NotesException; static public String getIOR(String host, String args[]) throws NotesException; static public String getIOR(String host, String args[], String user, String passwd) throws NotesException; }
例 関連項目