Sun Identity Manager 8.1 ビジネス管理者ガイド

管理オブジェクトの作成と格納

ここでは、次の管理オブジェクトの作成および格納手順について説明します。 この手順はシナリオ例が正しく機能するために必要です。

LDAP ディレクトリまたはファイルに管理オブジェクトを格納できます。ファイルを使用している場合、ファイルのすべてのインスタンスが同じである必要があります。

手順については、次を参照してください。


注 –

LDAP ディレクトリへの管理オブジェクトの格納

PasswordSync と JMS リスナーは、LDAP ディレクトリに格納されている管理オブジェクトを使用するように設定できます。図 11–14 は、この処理を示しています。PasswordSync サーブレットと JMS リスナーアダプタはどちらも、メッセージを送受信するために、LDAP ディレクトリから接続ファクトリとデスティネーション設定を取得する必要があります。

図 11–14 LDAP ディレクトリからの接続ファクトリおよびデスティネーションオブジェクトの取得

LDAP ディレクトリに格納された管理オブジェクトを使用するように、PasswordSync と JMS リスナーを設定する方法を示す図

Message Queue コマンド行ツールの使用法

この節では、Message Queue コマンド行ツール (imqobjmgr) を使用して、LDAP ディレクトリに管理オブジェクトを格納する方法を説明します。

接続ファクトリオブジェクトの格納

Message Queue コマンド行ツール (imqobjmgr) を開き、「接続ファクトリオブジェクトの格納」のコマンドを入力して、接続ファクトリオブジェクトを格納します。


例 11–1 接続ファクトリオブジェクトの格納


#> ./imqobjmgr add -l "cn=mytestFactory" 
-j "java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory" 
-j "java.naming.provider.url=ldap://gwenig.coopsrc.com:389/ou=sunmq,dc=coopsrc,dc=com" 
-j "java.naming.security.principal=cn=directory manager" 
-j "java.naming.security.credentials=password" 
-j "java.naming.security.authentication=simple" 
-t qf -o "imqAddressList=mq://gwenig.coopsrc.com:7676/jms" 
Adding a Queue Connection Factory object with the following attributes: 
imqAckOnAcknowledge [Message Service Acknowledgement of Client Acknowledgements] ... 
imqSetJMSXUserID [Enable JMSXUserID Message Property] false 
Using the following lookup name: cn=mytestFactory The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.ldap.LdapCtxFactory 
java.naming.provider.url 
ldap://gwenig.coopsrc.com:389/ou=sunmq,dc=coopsrc,dc=com 
java.naming.security.authentication 
simple java.naming.security.credentials netscape
java.naming.security.principal 
cn=directory manager Object successfully added.

「接続ファクトリオブジェクトの格納」では、imqAddressList によって JMS サーバー/ブローカのホスト名 (gwenig.coopsrc.com)、ポート (7676)、およびアクセス方法 (jms) を定義しています。

デスティネーションオブジェクトの格納

Message Queue コマンド行ツール (imqobjmgr) で、「デスティネーションオブジェクトの格納」のコマンドを入力して、デスティネーションオブジェクトを格納します。


例 11–2 デスティネーションオブジェクトの格納


#> ./imqobjmgr add -l "cn=mytestDestination" 
-j "java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory" 
-j "java.naming.provider.url=ldap://gwenig.coopsrc.com:389/ou=sunmq,dc=coopsrc,dc=com" 
-j "java.naming.security.principal=cn=directory manager" 
-j "java.naming.security.credentials=password" 
-j "java.naming.security.authentication=simple" 
-t q -o "imqDestinationName=mytestDestination" 
Adding a Queue object with the following attributes: 
imqDestinationDescription [Destination Description] 
A Description for the Destination Object imqDestinationName [Destination Name] 
mytestDestination Using the following lookup name: cn=mytestDestination 
The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.ldap.LdapCtxFactory 
java.naming.provider.url ldap://gwenig.coopsrc.com:389/ ou=sunmq,dc=coopsrc,dc=com 
java.naming.security.authentication simple 
java.naming.security.credentials netscape 
java.naming.security.principal cn=directory manager Object successfully added.

ldapsearch または LDAP ブラウザを使用して、新たに作成したオブジェクトをチェックできます。

LDAP サーバーに管理オブジェクトを格納することについての節はこれで終了です。次の節 (管理オブジェクトをファイルに格納する方法) を省略して、「このシナリオに対する JMS リスナーアダプタの設定」の節に進みます。

ファイルへの管理オブジェクトの格納

PasswordSync と JMS リスナーは、ファイルに格納されている管理オブジェクトを使用するように設定できます。管理オブジェクトを LDAP サーバーに格納 (「LDAP ディレクトリへの管理オブジェクトの格納」) していない場合は、この節の手順に従います。

接続ファクトリオブジェクトの格納

Message Queue コマンド行ツール (imqobjmgr) を開き、「接続ファクトリオブジェクトの格納」のコマンドを入力して、接続ファクトリオブジェクトを格納し、ルックアップ名を指定します。


例 11–3 接続ファクトリオブジェクトの格納とルックアップ名の指定


#> ./imqobjmgr add -l "mytestFactory" -j 
"java.naming.factory.initial= com.sun.jndi.fscontext.RefFSContextFactory"
 -j "java.naming.provider.url=file:///home/gael/tmp" -t qf -o 
 "imqAddressList=mq://gwenig.coopsrc.com:7676/jms" 
Adding a Queue Connection Factory object with the following attributes: 
imqAckOnAcknowledge [Message Service Acknowledgement of Client Acknowledgements] 
... 
imqSetJMSXUserID [Enable JMSXUserID Message Property] false 
Using the following lookup name: 
mytestFactory 
The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.fscontext.RefFSContextFactory 
java.naming.provider.url file:///home/gael/tmp 
Object successfully added. 
To specify a destination: 
#> ./imqobjmgr add -l "mytestQueue" -j 
"java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory" 
-j "java.naming.provider.url=file:///home/gael/tmp" -t q -o 
"imqDestinationName=myTestQueue" 
Adding a Queue object with the following attributes: 
imqDestinationDescription [Destination Description] A Description for the Destination 
Object imqDestinationName [Destination Name] myTestQueue 
Using the following lookup name: 
mytestQueue 
The object’s read-only state: false 
To the object store specified by: 
java.naming.factory.initial com.sun.jndi.fscontext.RefFSContextFactory 
java.naming.provider.url file:///home/gael/tmp 
Object successfully added.

ブローカでのデスティネーションの作成

Sun Message Queue ブローカでは、デフォルトでキューデスティネーションの自動作成が有効になっています (config.properties を参照。 ただし、imq.autocreate.queue のデフォルト値は true)。

キューデスティネーションが自動的に作成されない場合は、「ブローカでのデスティネーションの作成」に示すコマンドを使用して、ブローカ上でデスティネーションオブジェクトを作成する必要があります。このとき、myTestQueue がデスティネーションを表します。


例 11–4 ブローカでのデスティネーションオブジェクトの作成


name (Queue name): 
#> cd /opt/sun/mq/bin 
#>./imqcmd create dst -t q -n mytestQueue 
Username: <admin> 
Password: <admin> 
Creating a destination with the following attributes: 
Destination Name mytestQueue 
Destination Type Queue On the broker specified by: 
------------------------- 
Host Primary Port 
------------------------- localhost 7676 
Successfully created the destination.

ディレクトリまたはファイルに管理オブジェクトを格納できます。