JUDDI レジストリガイド
JBoss システム管理者および開発者向け
エディッション 5.2.0
概要
第1章 レジストリとは?
1.1. はじめに
1.2. レジストリが必要な理由
注記
1.3. レジストリ vs レポジトリ
1.4. サービス指向アーキテクチャーのコンポーネント
注記
- 交換されるメッセージ
- サービスリクエスターやプロバイダーとして機能するエージェント
- メッセージのやり取りを可能にする共有トランスポートメカニズム
- サービスプロバイダー
- サービスプロバイダーは、サービスへのアクセス管理、サービスの説明の作成、サービスブローカーへの公開を行います。
- サービスブローカー
- サービスブローカーは、サービスの説明に関するレジストリをホストします。サービスリクエスターとサービスプロバイダーをつなぐ役割を果たします。
- サービスリクエスター
- サービスリクエスターは、サービスの検出を行います。サービスブローカーが提供するサービスの説明を検索することで、サービスを検出します。また、リクエスターは、サービスプロバイダーから取得したサービスをバインドします。

1.5. Universal Description, Discovery and Integration (UDDI) レジストリ
- グリーンページは、クライアントと提供のサービスをバインド可能な情報を提供します。
- イエローページは、所属する産業をベースにビジネスを分類する際に利用します。
- ホワイトページには、サービスを提供する企業の名前、住所、その他の連絡先など一般情報が含まれます。
1.6. Registry と JBoss Service-Oriented Architecture Platform
重要
第2章 レジストリの設定
注記
jdbc:teiid:vdb_name@mm://localhost:31000 です。
- Apache Scout
- Apache Scout は JAXR 実装です。
- レジストリインターフェース
- これは、ESB が jUDDI Registry と通信する手段です。
注記
手順2.1 レジストリ設定の定義
$SOA_ROOT/server/$PROFILE/deployers/esb.deployer/jbossesb-properties.xmlファイルのレジストリのセクションは、以下のプロパティを定義しています。<properties name="registry"> <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/> <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/> <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire"/> <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish"/> <property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure"/> <property name="org.jboss.soa.esb.registry.user" value="root"/> <property name="org.jboss.soa.esb.registry.password" value="root"/> <property name="org.jboss.soa.esb.scout.proxy.uddiVersion" value="3.0"/> <property name="org.jboss.soa.esb.scout.proxy.uddiNameSpace" value="urn:uddi-org:api_v3"/> <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/> <!-- specify the interceptors, in order --> <property name="org.jboss.soa.esb.registry.interceptors" value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor"/> <!-- The following properties modify the cache interceptor behaviour --> <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100"/> <property name="org.jboss.soa.esb.registry.cache.validityPeriod" value="600000"/> <!-- Organization Category to be used by this deployment. --> <property name="org.jboss.soa.esb.registry.orgCategory" value="org.jboss.soa.esb.:category"/> </properties>
表2.1 Registry プロパティ
| プロパティ | 説明 |
|---|---|
org.jboss.soa.esb.registry.implementationClass |
JBoss ESB Registry インターフェースを実装するクラスです。
JAXRRegistryImpl の実装 1 つが含まれています。JAXRRegistry インターフェースを使用します。
|
org.jboss.soa.esb.registry.factoryClass |
JAXR ConnectionFactory 実装のクラス名です。
|
org.jboss.soa.esb.registry.queryManagerURI |
サービスのクエリに JAXR で使用する URI です。
|
org.jboss.soa.esb.registry.lifeCycleManagerURI |
JAXR が編集に使用する URI です。
|
org.jboss.soa.esb.registry.user |
編集に使用するユーザー名です。
|
org.jboss.soa.esb.registry.password |
指定のユーザーのパスワードです。
|
org.jboss.soa.esb.scout.proxy.uddiVersion |
クエリの UDDI バージョンです。
|
org.jboss.soa.esb.scout.proxy.uddiNameSpace |
UDDI 名前空間です。
|
org.jboss.soa.esb.scout.proxy.transportClass |
Apache Scout が UDDI Registry にアイテムを送信する際に利用するクラスです。
|
org.jboss.soa.esb.registry.interceptors |
これは Registry に適用されるインターセプター一覧です。ESB には、インターセプターが 2 つあり、1 つは InVM 登録の処理に、もう 1 つは Registry にキャッシュを提供します。
デフォルトのインターセプターは、InVM インターセプター用にエントリ 1 つのみを含みます。
|
org.jboss.soa.esb.registry.cache.maxSize |
これがキャッシュ内に含むことができる最大サーバーエントリ数です。この値を超えると、エントリが最も古い順番に削除されます。デフォルトは、
100 です。
|
org.jboss.soa.esb.registry.cache.validityPeriod |
キャッシュインターセプターに設定された有効期限です。この値はミリ秒で指定し、デフォルトは
600000 (10 分) となっています。キャッシュが失効しないようにするには、この値を 0 に設定してください。
|
org.jboss.soa.esb.registry.orgCategory |
ESB の 組織カテゴリ名です。デフォルトは
org.jboss.soa.esb.:category です。
|
2.1. Registry のコンポーネント

図2.1 Registry コンポーネントのアーキテクチャー
- JBoss Enterprise Service Bus は、
registry interface経由で Registry とのやり取りをすべて送ります。 - その後、このインターフェースの JAXR 実装を呼び出します。
- JAXR API は JAXR 実装を使用する必要があります (デフォルトは Apache Scout)。
- 次に Apache Scout は jUDDI Registry を呼び出します。
注記
注記
org.jboss.soa.esb.registry.implementationClass API は、XML ベースのレジストリやレポジトリであればどれにでも接続できるため、便利です。しかし、別の API を使用することも可能です。
手順2.2 他の API の使用
- 新しい
SystinetRegistryImplemtationクラスを記述して、このプロパティ内から参照します。
2.2. JAXR 実装の設定
手順2.3 JAXR 実装の設定
- 特定の JAXR 実装を選択します。
- プロパティを設定してクラスを構成します (JBoss Enterprise SOA Platform は Apache Scout を使用して、デフォルトでこのプロパティは
org.apache.ws.scout.registry.ConnectionFactoryImplという Scout factory クラスに設定されています)。 - Registry の場所を提供することで、JAXR 実装を設定します。
org.jboss.soa.esb.registry.queryManagerURI、org.jboss.soa.esb.registry.lifeCycleManagerURI、org.jboss.soa.esb.registry.securityManagerURIを編集します。
2.3. jUDDI トランスポートの使用
org.jboss.soa.esb.scout.proxy.transportClass) を設定することができます。これは、Scout と jUDDI Registry の間の通信を容易にする transport クラスです。
LocalTransport のままにして、jUDDI registry のトランスポート (InVM、RMI、WS) を使用するように server/config/deploy/jbossesb.sar/META-INF/esb.juddi.client.xml ファイルを設定します。このファイルは、Registry のノードを定義します。
- ノード
- ノードは、jUDDI Registry の場所です。
手順2.4 トランスポートの選択
- ノード設定を使用してどのトランスポートを使用するか選択します。
<node> <!-- required 'default' node --> <name>default</name> <description>Main jUDDI node</description> <properties> <property name="serverName" value="localhost" /> <property name="serverPort" value="8880" /> </properties> <!-- JAX-WS Transport <proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport> <custodyTransferUrl>http://${serverName}:${serverPort}/juddiv3/services/custody-transfer?wsdl</custodyTransferUrl> <inquiryUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiry?wsdl</inquiryUrl> <publishUrl>http://${serverName}:${serverPort}/juddiv3/services/publish?wsdl</publishUrl> <securityUrl>http://${serverName}:${serverPort}/juddiv3/services/security?wsdl</securityUrl> <subscriptionUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription?wsdl</subscriptionUrl> <subscriptionListenerUrl>http://${serverName}:${serverPort}/juddiv3/services/subscription-listener?wsdl</subscriptionListenerUrl> <juddiApiUrl>http://${serverName}:${serverPort}/juddiv3/services/juddi-api?wsdl</juddiApiUrl> --> <!-- In VM Transport Settings <proxyTransport>org.jboss.internal.soa.esb.registry.client.JuddiInVMTransport</proxyTransport> <custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl> <inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl> <publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl> <securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl> <subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl> <subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl> <juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl> --> <!-- RMI Transport Settings --> <proxyTransport>org.apache.juddi.v3.client.transport.RMITransport</proxyTransport> <custodyTransferUrl>/juddiv3/UDDICustodyTransferService</custodyTransferUrl> <inquiryUrl>/juddiv3/UDDIInquiryService</inquiryUrl> <publishUrl>/juddiv3/UDDIPublicationService</publishUrl> <securityUrl>/juddiv3/UDDISecurityService</securityUrl> <subscriptionUrl>/juddiv3/UDDISubscriptionService</subscriptionUrl> <subscriptionListenerUrl>/juddiv3/UDDISubscriptionListenerService</subscriptionListenerUrl> <juddiApiUrl>/juddiv3/JUDDIApiService</juddiApiUrl> <javaNamingFactoryInitial>org.jnp.interfaces.NamingContextFactory</javaNamingFactoryInitial> <javaNamingFactoryUrlPkgs>org.jboss.naming</javaNamingFactoryUrlPkgs> <javaNamingProviderUrl>jnp://localhost:1099</javaNamingProviderUrl> </node> - デフォルトでは Remote Method Invocation (RMI) の設定が有効になっています。トランスポートを切り替えるには、RMI の設定をコメントアウトして、使用したいものを有効にします。
transport を設定する場合、以下のアイテムを指定する必要があります。
proxyTransport- 対応の UDDI アプリケーションプログラミングインターフェースすべてに対する URL (
inquiry、publish、security、subscription、subscription-listener、custodytransfer) - jUDDI アプリケーションプログラミングインターフェースの URL
- RMI トランスポート (JNDI 設定を含みます)
2.4. Apache Scout と jUDDI の使用
org.jboss.soa.esb.scout.proxy.transportClass クラス実装が 4 つあり、SOAP、SAAJ、RMI、Embedded Java (Local) それぞれに対して 1 つずつ存在することになります。jUDDI Registry とやり取りを行う場合は、transportClass を LocalTransport に設定したままで残して、Registry のトランスポート (それぞれ、InVM、RMI、WS)を使用するように uddi.xml ファイルを設定します
- jUDDI データベースにアクセスできなければなりません。アクセスできるかを確認するには、データベースにスキーマを作成して、
jbossesb publisherを追加します (product/install/jUDDI-registryディレクトリには、最も一般的なデータベース向けのdatabase-createスクリプトが含まれています。)注記
ユーザーにテーブル作成の権限が与えられている場合は、システムにより自動でデータベースを生成することができます。jUDDI Registry は、関連の Hibernate 方言が存在するデータベースを作成することができます。 esb.juddi.xmlとesb.juddi.client.xmlは必須ファイルです。これらのファイルには、実際の jUDDI 設定が含まれています。
注記
SOAP queryManagerURI http://localhost:8080/juddi/inquiry lifeCycleManagerURI http://localhost:8080/juddi/publish transportClass org.apache.ws.scout.transport.AxisTransport RMI queryManagerURI jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire lifeCycleManagerURI jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish transportClass org.apache.ws.scout.transport.RMITransport Local queryManagerURI org.apache.juddi.registry.local.InquiryService#inquire lifeCycleManagerURI org.apache.juddi.registry.local.PublishService#publish transportClass org.apache.ws.scout.transport.LocalTransport
2.5. Registry インターセプター
- リクエストにサービスを提供
- リクエストに直接レスポンス
- 下層にあるインターセプターまたはレジストリ実装から受け取ったレスポンスを拡大

図2.2 Registry インターセプター
手順2.5 インターセプタースタックの設定
jbossesb-properties.xmlファイルを開き org.jboss.soa.esb.registry.interceptors プロパティを変更します。
表2.2 Registry プロパティ
| プロパティ | 説明 |
|---|---|
| org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor |
InVM レジストリインターセプターは、InVM エンドポイント参照の処理を担当します。同じサーバーインスタンス内で実行するサービスにより登録されます。InVM EPR や関連サービスの情報は、インターセプター内にキャッシュされ、後続のインターセプターに伝搬されず、後続のインターセプターやレジストリクエリからの決定を最適化して呼び出し元に返されます。
|
| org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor |
キャッシュレジストリのインターセプターは、エンドポイント参照のキャッシュと関連のサービスを保持して、LRU ベースまたは、情報が失効した後にキャッシュから情報をエビクトします。
インターセプターは、jbossesb-properties.xml 内でorg.jboss.soa.esb.registry.cache.maxSize と org.jboss.soa.esb.registry.cache.validityPeriod プロパティを使用して設定することができます。
|
第3章 Registry 設定例
注記
${SOA_ROOT}/tools/schema/ サブディレクトリに入っています。使用方法については、管理ガイドの「データベースの切り替え」の章にあります。
3.1. jUDDI Registry の埋め込み

図3.1 埋め込み jUDDI
手順3.1 jUDDI Registry の埋め込み
- jUDDI Registry を埋め込むには、以下のプロパティを設定します。
<properties name="registry"> <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/> <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/> <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/> <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#publish"/> <property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.registry.local.SecurityService#secure"/> <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/> <property name="org.jboss.soa.esb.registry.password" value="password"/> <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/> </properties>
3.2. Remote Method Invocation を使用するための jUDDI Registry の設定

図3.2 Remote Method Invocation
手順3.2 jbossesb.sar ファイル経由で Remote Method Invocation を使用するための jUDDI Registry の設定
- Remote Method Invocatoin サービスを呼び出す jUDDI Registry のバージョン 1 つをデプロイするだけです (JBoss Enterprise Service Bus は、デフォルトで Remote Invocation Service をデプロイします。ESB は
jbossesb.sarアーカイブ内で Registry を起動して、Remote Method Invocation サービスを自動登録するアーカイブと同じです)。設定プロパティを以下に示しています。<properties name="registry"> <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/> <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/> <property name="org.jboss.soa.esb.registry.queryManagerURI" value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/> <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish"/> <property name="org.jboss.soa.esb.registry.securityManagerURI" value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish"/> <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/> <property name="org.jboss.soa.esb.registry.password" value="password"/> <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.RMITransport"/> </properties>juddi.warアーカイブは、Remote Method Invocation サービスを呼び出すために設定されます。web.xmlファイルに以下のような設定をします。<!-- uncomment if you want to enable making calls in juddi with rmi --> <servlet> <servlet-name>RegisterServicesWithJNDI</servlet-name> <servlet-class>org.apache.juddi.registry.rmi.RegistrationService</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
juddi.propertiesファイルを編集して、以下の JNDI 設定を含めます。# JNDI settings (used by RMITransport) java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.provider.url=jnp://localhost:1099 java.naming.factory.url.pkgs=org.jboss.naming
重要
RMI クライアントのクラスパスにscout-client.jarを含めるのを忘れないでください。
3.3. RMI サービスの独自の JNDI 登録を使用した Remote Method Invocation
juddi.war アーカイブをデプロイしたくない場合、jUDDI Registry と実行しているのと同じ Java 仮想マシンで、Enterprise Service Bus コンポーネントの 1 つを設定します。このコンセプトについて以下に例示しています。

図3.3 独自の JNDI 登録を用いた RMI
手順3.3 独自の JNDI 登録を用いた RMI の設定
- 1 つ目のアプリケーションでは、以下のローカルの設定を行います。
<properties name="registry"> <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/> <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/> <property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.registry.local.InquiryService#inquire"/> <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.registry.local.PublishService#publish"/> <property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.registry.local.SecurityService#secure"/> <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/> <property name="org.jboss.soa.esb.registry.password" value="password"/> <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport"/> </properties> - 2 つ目のアプリケーションでは、以下のリモートメソッド呼び出しの設定を行います。
<properties name="registry"> <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/> <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/> <property name="org.jboss.soa.esb.registry.queryManagerURI" value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/> <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish"/> <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/> <property name="org.jboss.soa.esb.registry.password" value="password"/> <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.RMITransport"/> </properties> queryManagerURIとlifeCycleManagerURIクラスのホスト名を jUDDI Registry を実行中のホスト (アプリケーションのレジストリも実行しているホスト) へ参照させます。明らかに、アプリケーションレジストリは、ネーミングサービスへのアクセスが必要です。- 以下の設定を使用してアプリケーションを登録します。
//Getting the JNDI setting from the config Properties env = new Properties(); env.setProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_INITIAL,factoryInitial); env.setProperty(RegistryEngine.PROPNAME_JAVA_NAMING_PROVIDER_URL, providerURL); env.setProperty(RegistryEngine.PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS, factoryURLPkgs); InitialContext context = new InitialContext(env); Inquiry inquiry = new InquiryService(); log.info("Setting " + INQUIRY_SERVICE + ", " + inquiry.getClass().getName()); mInquery = inquiry; context.bind(INQUIRY_SERVICE, inquiry); Publish publish = new PublishService(); log.info("Setting " + PUBLISH_SERVICE + ", " + publish.getClass().getName()); mPublish = publish; context.bind(PUBLISH_SERVICE, publish);
重要
scout-client.jar ファイルを含めるのを忘れないでください。
3.4. SOAP

図3.4 SOAP ベースの通信
手順3.4 SOAP を使用するための Apache Scount 設定
juddi.warアーカイブをデプロイして、データソースを設定します。重要
web.xmlファイルのRegisterServicesWithJNDIサーブレットをコメントアウトして、RMI サービスもシャットダウンするとよいでしょう。サンプルプロパティを以下に示します。<properties name="registry"> <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/> <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/> <property name="org.jboss.soa.esb.registry.queryManagerURI" value="http://localhost:8080/juddi/inquiry"/> <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="http://localhost:8080/juddi/publish"/> <property name="org.jboss.soa.esb.registry.user" value="jbossesb"/> <property name="org.jboss.soa.esb.registry.password" value="password"/> <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.AxisTransport"/> </properties>
第4章 Registry トラブルシューティング
4.1. Scout と jUDDI での注意点
- リモートのメソッド呼び出しアプローチを使用する場合、
juddi-client.jarファイルを取得するようにしてください (それぞれのプロファイルの場所にあります。./server/default/deployers/esb.deployer/lib/juddi-client-3.1.0.jar、./server/all/deployers/esb.deployer/lib/juddi-client-3.1.0.jar、または./server/production/deployers/esb.deployer/lib/juddi-client-3.1.0.jar.)。 jbossesb-properties.xmlファイルが class-path にあり、正しく読み込まれるようにしてください。そうでないと、Registry はクラスをインスタンス化するときの名前に "null" を使おうとします。META-INF/esb.juddi.client.xmlファイルが有効なトランスポートを指定していることを確認します。persistence.xmlファイルの設定が有効で、選択した Hibernate 方言がデータベースで使用するものと同じであることを確認してください。
esb.juddi.xmlファイルが class-path にあるよう確認してください。これには、jUDDI Registry の設定の一部が含まれています。- サービスが失敗するか、クリーンにシャットダウンされない場合、Registry に古いエントリが残る可能性があります。このようなエントリは手動で削除します。
4.2. 詳細情報
- JBoss jUDDI Wiki: http://www.jboss.org/community/docs/DOC-11217
- JBoss ESB User Forum: http://community.jboss.org/en/jbossesb?view=discussions.
第5章 ルートシードデータ
5.1. はじめに
inquiry や publication など) です。ノード毎に root publisher は 1 つのみとなっています。
juddi_install_data/ の juddi-core-3.x.jar 配下にあります。
root と uddi のパブリッシャーを 2 つインストールします。Root には root パーティションを所有し、uddi はその他の全シードデータを所有します (定義済みの tModels など)。
5.2. シードデータファイル
<publisher>_Publisher.xml <publisher>_tModelKeyGen.xml <publisher>_BusinessEntity.xml <publisher>_tModels.xml
root_Publisher.xml のコンテンツは以下のとおりです。
<publisher xmlns="urn:juddi-apache-org:api_v3" authorizedName="root">
<publisherName>root publisher</publisherName>
<isAdmin>true</isAdmin>
</publisher>KenGenerator tModel を定義する必要があります。tModel Key Generator は root_tModelKeyGen.xml ファイルで定義されます。
<tModel tModelKey="uddi:juddi.apache.org:keygenerator" xmlns="urn:uddi-org:api_v3">
<name>uddi-org:keyGenerator</name>
<description>Root domain key generator</description>
<overviewDoc>
<overviewURL useType="text">
http://uddi.org/pubs/uddi_v3.htm#keyGen
</overviewURL>
</overviewDoc>
<categoryBag>
<keyedReference tModelKey="uddi:uddi.org:categorization:types"
keyName="uddi-org:types:keyGenerator"
keyValue="keyGenerator" />
</categoryBag>
</tModel>root publisher で使用されるキーは uddi:juddi.apache.org:<text-of-choice> の形式でなければなりません。別の形式を使用する場合、illegal key エラーが表示されます。
KeyGenerator を 1 つしか所有できませんが、他のパブリッシャは複数所有することができます。
KeyGenerators は共有しないでください。複数の KeyGenerator tModel からパブリッシャーを確認したい場合、 <publisher>_tModels.xml ファイルを使用してください。
<publisher>_BusinessEntity.xml ファイルを使用して、Business と Service データを設定できます。root_BusinessEntity.xml で、サービスを指定します。
<businessEntity xmlns="urn:uddi-org:api_v3"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
businessKey="uddi:juddi.apache.org:businesses-asf">
<!-- Change the name field to represent the name of your registry -->
<name xml:lang="en">An Apache jUDDI Node</name>
<!-- Change the description field to provided
a brief description of your registry -->
<description xml:lang="en">
This is a UDDI v3 registry node as implemented by Apache jUDDI.
</description>
<discoveryURLs>
<!-- This discovery URL should point to the home installation URL of jUDDI -->
<discoveryURL useType="home">
http://${juddi.server.name}:${juddi.server.port}/juddiv3
</discoveryURL>
</discoveryURLs>
<categoryBag>
<keyedReference tModelKey="uddi:uddi.org:categorization:nodes" keyValue="node" />
</categoryBag>
<businessServices>
<!-- As mentioned above, you may want to provide user-defined keys for
these (and the services/bindingTemplates below. Services that you
don't intend to support should be removed entirely -->
<businessService serviceKey="uddi:juddi.apache.org:services-inquiry"
businessKey="uddi:juddi.apache.org:businesses-asf">
<name xml:lang="en">UDDI Inquiry Service</name>
<description xml:lang="en">Web Service supporting UDDI Inquiry API</description>
<bindingTemplates>
<bindingTemplate bindingKey="uddi:juddi.apache.org:servicebindings-inquiry-ws"
serviceKey="uddi:juddi.apache.org:services-inquiry">
<description>UDDI Inquiry API V3</description>
<!-- This should be changed to the WSDL URL of the inquiry API.
An access point inside a bindingTemplate will be found for every service
in this file. They all must point to their API's WSDL URL -->
<accessPoint useType="wsdlDeployment">
http://${juddi.server.name}:${juddi.server.port}/juddiv3/services/inquiry?wsdl
</accessPoint>
<tModelInstanceDetails>
<tModelInstanceInfo tModelKey="uddi:uddi.org:v3_inquiry">
<instanceDetails>
<instanceParms>
<![CDATA[
<?xml version="1.0" encoding="utf-8" ?>
<UDDIinstanceParmsContainer
xmlns="urn:uddi-org:policy_v3_instanceParms">
<defaultSortOrder>
uddi:uddi.org:sortorder:binarysort
</defaultSortOrder>
</UDDIinstanceParmsContainer>
]]>
</instanceParms>
</instanceDetails>
</tModelInstanceInfo>
</tModelInstanceDetails>
<categoryBag>
<keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment"
tModelKey="uddi:uddi.org:categorization:types"/>
</categoryBag>
</bindingTemplate>
</bindingTemplates>
</businessService>
<businessService serviceKey="uddi:juddi.apache.org:services-publish"
businessKey="uddi:juddi.apache.org:businesses-asf">
<name xml:lang="en">UDDI Publish Service</name>
...........
</businessService>
</businessServices>
</businessEntity>警告
publishers がない場合のみ開始しますが、juddi.seed.always を true 設定すれば開始されません (ルートデータファイルの例外が全ファイルに再度適用されます)
5.3. シードデータのトークン
root_BusinessEntity.xml ファイル (${juddi.server.baseurl}) にトークンの値を設定するには、juddiv3.properties ファイルの該当セクションを変更します (値の代入は実行時に行われるため、必要であれば別のノードが独自の値を代入可能です)。
5.4. カスタマーシードデータ
juddiv3.war/WEB-INF/classes/ ディレクトリに juddi_custom_install_data を追加することです (こうすることで、juddi-core-3.x.jar アーカイブを変更する必要がなくなります)。
root と呼ばれず、juddiv3.properties ファイルの juddi.root.publisher プロパティを下記のもの以外に設定する必要があります。
juddi.root.publisher=root
juddiv3.war アーカイブファイルには、サンプルデータのディレクトリが 2 つ含まれています。1 つ目は、Sales Affiliate で、もう 1 つは Marketing Affiliate です。Sales Seed Data を使うには、juddiv3.war/WEB-INF/classes/ のディレクトリの名前を変更します。以下のコマンドを実行してください。
mv RENAME4Sales_juddi_custom_install_data juddi_custom_install_data
注記
juddiv3.properties ファイルのトークンを忘れずに設定してください) mv RENAME4Sales_juddi_custom_install_data juddi_custom_install_data
第6章 認証
6.1. はじめに
authToken がなければなりません。
重要
authToken を取得するには、getAuthToken() リクエストを出す必要があります。リクエストを出すと GetAuthToken オブジェクトが渡されますので、このオブジェクトに、userid と credential (password) を設定してください。
org.uddi.api_v3.GetAuthToken ga = new org.uddi.api_v3.GetAuthToken();
ga.setUserID(pubId);
ga.setCred("");
org.uddi.api_v3.AuthToken token = securityService.getAuthToken(ga);juddi.properties 設定ファイルの juddi.auth プロパティを使って、jUDDI Registry が GetAuthToken リクエストにより渡された認証情報をチェックするよう設定します (デフォルトでは JUDDIAuthenticator 実装を使用します)。
org.apache.juddi.auth.Authenticator インターフェースを使用して、juddi.auth プロパティは実装クラスを参照するようにします。
Authenticator インターフェースのメソッドで表現されます。
GetAuthToken リクエストが出されると発生します。このフェーズの目的は、user id や認証情報を有効な publisher id に変換することです。publisher id (UDDI の用語では 認証名 と呼ばれる) は、UDDI 内でオーナーシップを割り当てる値です。新しいエンティティが作成されると、必ず publisher の認証名でオーナーシップがタグ付けされます。
GetAuthToken リクエストが完了すると、authentication token が呼び出し元に発行されます。
GetAuthToken リクエストから発行されたトークンを提供する必要があります。その後、識別フェーズに移動します。
UddiEntityPublisher オブジェクトに変えることです。このオブジェクトには、 UDDI エンティティのオーナーシップを処理する際に必要な全プロパティが含まれています。そのため、トークン (または publisher id) を使用して、publisher を識別します。
UddiEntityPublisher のサブクラスである Publisher エンティティを提供します。このサブクラスは、jUDDI Registry 内で publisher プロパティを永続化します。
6.2. jUDDI 認証
JUDDIAuthenticator です。 JUDDIAuthenticator の認証フェーズは、Publisher テーブルの記録とサブミットされた user id が一致するか確認するだけです。認証情報の確認は行いません。認証プロセスで、Publisher がないと判断されると、その場で追加されます。
警告
UddiEntityPublisher から必要とされるプロパティをすべて継承します。
juddi.auth = org.apache.juddi.auth.JUDDIAuthentication
6.3. XMLDocAuthentication
XMLDocAuthentication 実装を使用するには、XML ファイルをクラスパスに追加する必要があります。
juddi-users.xml で、内容は以下のようになっています。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<juddi-users>
<user userid="anou_mana" password="password" />
<user userid="bozo" password="clown" />
<user userid="sviens" password="password" />
</juddi-users>juddi.properties ファイルの中身は、以下のようになります。
juddi.auth = org.apache.juddi.auth.XMLDocAuthentication juddi.usersfile = juddi-users.xml
UddiEntityPublisher を生成します。
6.4. CryptedXMLDocAuthentication
CryptedXMLDocAuthentication 実装は、XMLDocAuthentication 実装と似ていますが、パスワードが暗号化されています。
juddi.auth = org.apache.juddi.auth.CryptedXMLDocAuthentication juddi.usersfile = juddi-users-encrypted.xml juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
juddi-users-encrypted.xml で、ファイルの内容は、以下のようになります。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<juddi-users>
<user userid="anou_mana" password="+j/kXkZJftwTFTBH6Cf6IQ=="/>
<user userid="bozo" password="Na2Ait+2aW0="/>
<user userid="sviens" password="+j/kXkZJftwTFTBH6Cf6IQ=="/>
</juddi-users>DefaultCryptor 実装は BEWithMD5AndDES と Base64 を使用してパスワードを暗号化します。
注記
AuthenticatorTest のコードを使用して、この認証実装の使用方法を確認することができます。org.apache.juddi.cryptor.Cryptor インターフェースを実装して、この実装クラスを juddi.cryptor プロパティで参照し、独自の暗号化アルゴリズムをプラグインすることができます。
UddiEntityPublisher を生成します。
6.5. LDAP 認証
LdapSimpleAuthenticator を使用して、LDAP のシンプルな認証機能でユーザー認証を行います。このクラスは、principal と juddi publisher id が同じであれば、LDAP プリンシパルを元にユーザーを認証することができます。
juddi.properties ファイルに追加する必要があります。
juddi.auth=org.apache.juddi.auth.LdapSimpleAuthenticator juddi.auth.url=ldap://localhost:389
LdapSimpleAuthenticator クラスに LDAP サーバーが常駐する場所を伝えます。
6.6. JBoss 認証
docs/examples/auth ディレクトリに JBossAuthenticator クラスがあります。このクラスでは、JBoss に jUDDI をデプロイして、ユーザー認証を行うセキュリティドメインを使用できるようになります。
juddi.properties ファイルに追加する必要があります。
juddi.auth=org.apache.juddi.auth.JBossAuthenticator juddi.securityDomain=java:/jaas/other
JbossAuthenticator クラスと jUDDI Registry の Authenticator フレームワークを連携します。juddi.sercuity.domain は、JBossAuthenticator にアプリケーションサーバーのセキュリティドメインがどこにあるか伝えます。このドメインを使用して認証を行います。
$JBOSS_HOME/server/default/conf/login-config.xml ファイルにアプリケーションポリシー別のセキュリティドメインを 1 つ作成します。これらのドメインは、サーバー JNDI ツリーとその名前をバインドします java:/jaas/<application-policy-name> (ルックアップで、存在しないアプリケーションポリシーを参照した場合、デフォルトでは other という名前が使用されるようになっています)。
第7章 UDDI アノテーション
7.1. はじめに
注記
注記
juddi-client ライブラリを使用します。つまり、これらのアノテーションを使用して、UDDI バージョン 3 レジストリに登録できるということです。
7.2. UDDIService アノテーション
表7.1 UDDIService 属性
| 属性 | 説明 | 必須 |
|---|---|---|
| serviceName | サービス名。デフォルトでは、クラークが WebService アノテーションで指定された名前を使用します。 | いいえ |
| description | 人間が解読できるようなサービスの説明 | はい |
| serviceKey | サービスの UDDI v3 キー | はい |
| businessKey | サービスを所有すべきビジネスの UDDI v3 キー (ビジネスは、登録時に Registry に存在している必要があります)。 | はい |
| lang | これは、名前や説明で利用される言語ロケール (省略するとデフォルトの "en" に設定されます)。 | いいえ |
| categoryBag | CategoryBag の定義 | いいえ |
7.3. UDDIServiceBinding アノテーション
表7.2 UDDIServiceBinding 属性
| 属性 | 説明 | 必須 |
|---|---|---|
| bindingKey | ServiceBinding の UDDI v3 キー | はい |
| description | 人間が解読できるようなサービスの説明 | はい |
| accessPointType | UDDI v3 の AccessPointType (省略するとデフォルトの wsdlDeployment になります) | いいえ |
| accessPoint | エンドポイント参照 | はい |
| lang | これは、名前や説明で利用される言語ロケール (省略するとデフォルトの "en" に設定されます)。 | いいえ |
| tModelKeys | コンマ区切りの tModelKeys キー参照 | いいえ |
| categoryBag | CategoryBag の定義 | いいえ |
7.4. WebService の例
package org.apache.juddi.samples;
import javax.jws.WebService;
import org.apache.juddi.v3.annotations.UDDIService;
import org.apache.juddi.v3.annotations.UDDIServiceBinding;
@UDDIService(
businessKey="uddi:myBusinessKey",
serviceKey="uddi:myServiceKey",
description = "Hello World test service")
@UDDIServiceBinding(
bindingKey="uddi:myServiceBindingKey",
description="WSDL endpoint for the helloWorld Service. This service is used for "
+ "testing the jUDDI annotation functionality",
accessPointType="wsdlDeployment",
accessPoint="http://localhost:8080/juddiv3-samples/services/helloworld?wsdl")
@WebService(
endpointInterface = "org.apache.juddi.samples.HelloWorld",
serviceName = "HelloWorld")
public class HelloWorldImpl implements HelloWorld {
public String sayHi(String text) {
System.out.println("sayHi called");
return "Hello " + text;
}
}
この WebService をデプロイすると、juddi-client コードは、UDDI アノテーションに対してこのクラスをスキャンし、登録プロセスを担当します。
org.apache.juddi.samples.HelloWorldImpl サービスクラスに参照する必要があります。
<clerk name="BobCratchit" node="default" publisher="sales" password="sales">
<class>org.apache.juddi.samples.HelloWorldImpl</class>
</clerk>
このコードは、ボブが default という名前のノードの接続設定を使用しており、sales publisher (このパスワードは sales) を使用する予定であると記述しています。
注記
7.5. CategoryBag 属性
<categoryBag>
<keyedReference tModelKey="uddi:uddi.org:categorization:types"
keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" />
<keyedReference tModelKey="uddi:uddi.org:categorization:types"
keyName="uddi-org:types:wsdl2" keyValue="wsdlDeployment2" />
</categoryBag>
以下のように追加できます。
categoryBag="keyedReference=keyName=uddi-org:types:wsdl;keyValue=wsdlDeployment;" +
"tModelKey=uddi:uddi.org:categorization:types," +
"keyedReference=keyName=uddi-org:types:wsdl2;keyValue=wsdlDeployment2;" +
"tModelKey=uddi:uddi.org:categorization:types2",
第8章 API を使った簡単な公開方法
8.1. UDDI データモデル

図8.1 UDDI コアデター構造
tModels と連携で使用)。
8.2. モデルへの jUDDI の追加
publish 呼び出しにアタッチされ、公開エンティティにオーナーシップを割り当てます。
注記
8.3. UDDI および jUDDI API
UDDI API の構成や、jUDDI Registry がこの API を実装する方法について見ていきます。
sets に分割されており、各 set は特定の機能エリアについて表しています。
Inquiryは、エンティティの詳細に関する Registry へのクエリを処理します。details about entities.Publicationは、エンティティの登録を処理します。Securityは、認証処理を行う変更可能な仕様です。Custody and Ownership Transferは、エンティティのオーナーシップの移行処理を行います。Subscriptionは、クライアントがサブスクリプションの形式を仕様してエンティティに関する情報をリトリーブできるようにします。Subscription Listenerは、サブスクリプションの結果を受け入れるクライアント API です。Value Set (Validation and Caching)は、キー付きの参照値を検証します (このセットは、jUDDI ではまだ利用できません)Replicationは、レジストリノード間のデータを連携できるようにします (このセットは、jUDDI ではまだ利用できません)
sets は、Inquiry、Publication、Security です。Registry とやり取りを行う際に必要な標準機能を提供してくれます。
sets をそれぞれ実装します (セット内に定義されたメソッドは、該当の Web サービスにあるメソッドと同じです)。
8.4. jUDDI Registry の初回利用
8.4.1. 簡単なパブリッシャーの例
SimplePublish クラス 1 つのみで構成されています。以下がコンストラクターです。
public SimplePublish()
{
try
{
String clazz = UDDIClientContainer.getUDDIClerkManager(null).
getClientConfig().getUDDINode("default").getProxyTransport();
Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
if (transportClass!=null)
{
Transport transport = (Transport) transportClass.
getConstructor(String.class).newInstance("default");
security = transport.getUDDISecurityService();
juddiApi = transport.getJUDDIApiService();
publish = transport.getUDDIPublishService();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}SecurityAPI セット (認証トークンを取得するため)- 専用の
jUDDIAPI セット (パブリッシャーを保存するため) PublicationAPI セット (jUDDI にエンティティを登録するため)
publish メソッドの最初の数行の例を示しています。
// Setting up the values to get an authentication token for the 'root' user
// ('root' user has admin privileges and can save other publishers).
GetAuthToken getAuthTokenRoot = new GetAuthToken();
getAuthTokenRoot.setUserID("root");
getAuthTokenRoot.setCred("");
// Making API call that retrieves the authentication token for the 'root' user.
AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
System.out.println ("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());注記
// Creating a new publisher that we will use to publish our entities to.
Publisher p = new Publisher();
p.setAuthorizedName("my-publisher");
p.setPublisherName("My Publisher");
// Adding the publisher to the "save" structure, using the 'root' user authentication
// info and saving away.
SavePublisher sp = new SavePublisher();
sp.getPublisher().add(p);
sp.setAuthInfo(rootAuthToken.getAuthInfo());
juddiApi.savePublisher(sp);// Our publisher is now saved, so now we want to retrieve its authentication token
GetAuthToken getAuthTokenMyPub = new GetAuthToken();
getAuthTokenMyPub.setUserID("my-publisher");
getAuthTokenMyPub.setCred("");
AuthToken myPubAuthToken = security.getAuthToken(getAuthTokenMyPub);
System.out.println ("myPub AUTHTOKEN = " + myPubAuthToken.getAuthInfo());// Creating the parent business entity that will contain our service.
BusinessEntity myBusEntity = new BusinessEntity();
Name myBusName = new Name();
myBusName.setValue("My Business");
myBusEntity.getName().add(myBusName);
// Adding the business entity to the "save" structure, using our publisher's
// authentication info and saving away.
SaveBusiness sb = new SaveBusiness();
sb.getBusinessEntity().add(myBusEntity);
sb.setAuthInfo(myPubAuthToken.getAuthInfo());
BusinessDetail bd = publish.saveBusiness(sb);
String myBusKey = bd.getBusinessEntity().get(0).getBusinessKey();
System.out.println("myBusiness key: " + myBusKey);
// Creating a service to save. Only adding the minimum data: the parent
// business key retrieved from saving the business above and a single name.
BusinessService myService = new BusinessService();
myService.setBusinessKey(myBusKey);
Name myServName = new Name();
myServName.setValue("My Service");
myService.getName().add(myServName);
// Add binding templates, etc...
// Adding the service to the "save" structure, using our publisher's
// authentication info and saving away.
SaveService ss = new SaveService();
ss.getBusinessService().add(myService);
ss.setAuthInfo(myPubAuthToken.getAuthInfo());
ServiceDetail sd = publish.saveService(ss);
String myServKey = sd.getBusinessService().get(0).getServiceKey();
System.out.println("myService key: " + myServKey);注記
save 呼び出しで、各エンティティの key フィールドを空の状態にすることで、デフォルトの実装アプローチを選択しました。jUDDI のデフォルトキー生成は、ノードのパーティションを取り、GUID をそのパーティションに追加するだけです。
uddi:juddi.apache.org:<GUID>
第9章 サブスクリプション
9.1. はじめに
subscription API を使用してサービスを複数レジストリ間で登録して、親 UDDI のレジストリ情報が変更すると通知を送信することで、最新の情報に保ちます。
- 非同期
- こちらは、サブスクリプションを保存して、設定したスケジュールで更新を受け取ることができます。
- 同期
- こちらは、サブスクリプションを保存して、
get_Subscriptionを呼び出すことで同期の返答を取得することができます。
9.2. 2 ノードの例:Sales と Marketing
sales と marketing のノードを設定します。これには、2 種のサービスに jUDDI Registry をデプロイして、システムが正しく設定されるように 2 つのプロシージャーに従う必要があります。
手順9.1 ノード 1 の設定: Sales
juddi_custom_install_dataを作成します。cd juddiv3/WEB-INF/classes mv RENAME4SALES_juddi_custom_install_data juddi_custom_install_data
juddiv3.propertiesを編集し、以下のプロパティ値を設定します。salesはサーバーの DNS 名となります。juddi.server.name=sales juddi.server.port=8080
- サーバーを起動します。jUDDI が初めて起動される場合は、UDDI シードデータが読み込まれます。
bin/startup.sh
- Web ブラウザーを開き、http://sales:8080/juddiv3 のアドレスに移動します。ノードに関する情報を含むメッセージが表示されます。
手順9.2 ノード 2 の設定: Marketing
juddi_custom_install_dataを作成します。cd juddiv3/WEB-INF/classes mv RENAME4MARKETING_juddi_custom_install_data juddi_custom_install_data
juddiv3.propertiesを編集し、以下のプロパティ値を設定します。marketingはサーバーの DNS 名となります。juddi.server.name=marketing juddi.server.port=8080
- サーバーを起動します。jUDDI が初めて起動される場合は、UDDI シードデータが読み込まれます。
bin/startup.sh
- Web ブラウザーを開き、http://sales:8080/juddiv3 に移動します。また、問題なく実行された旨、またノード情報を含むメッセージが表示されます。
注記
uddi-portlets.war/WEB-INF/classes/META-INF/uddi.xml ファイルを、 uddi-portlets.war/WEB-INF/classes/META-INF/uddi.xml.sales で置き換えます。
uddi-portlets.war/WEB-INF/classes/META-INF/uddi.xml ファイルを編集します。
<name>default</name>
<properties>
<property name="serverName" value="sales"/>
<property name="serverPort" value="8080"/>
<property name="rmiPort" value="1099"/>
</properties>sales でログインします。以下が画面に表示されます。

図9.1 Sales サービス
uddi-portlet.war/WEB-INF/classes/META-INF/uddi.xml ファイルを udd-portlet.war/WEB-INF/classes/META-INF/uddi.xml.marketing で置き換えます。
uddi-portlet.war/WEB-INF/classes/META_INF/uddi.xml ファイルを編集します。
<name>default</name>
<properties>
<property name="serverName" value="marketing"/>
<property name="serverPort" value="8080"/>
<property name="rmiPort" value="1099"/>
</properties>sales でログインします。以下が画面に表示されます。

図9.2 Marketing サービス
注記
9.3. HellowSales サービスのデプロイ
juddiv3-samples.war アーカイブファイルにあり、アノテーションがついているため自動的に登録されます。
sales にプロパティ値を設定するように juddiv3-samples.war/WEB-INF/classes/META-INF/uddi.xml ファイルを編集します。以下のようになります。
<?xml version="1.0" encoding="ISO-8859-1" ?>
<uddi>
<reloadDelay>5000</reloadDelay>
<manager name="example-manager">
<nodes>
<node>
<name>default</name>
<description>Sales jUDDI node</description>
<properties>
<property name="serverName" value="sales"/>
<property name="serverPort" value="8080"/>
<property name="keyDomain" value="sales.apache.org"/>
<property name="department" value="sales" />
</properties>
<proxyTransport>
org.apache.juddi.v3.client.transport.InVMTransport
</proxyTransport>
<custodyTransferUrl>
org.apache.juddi.api.impl.UDDICustodyTransferImpl
</custodyTransferUrl>
<inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
<publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
<securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
<subscriptionUrl>
org.apache.juddi.api.impl.UDDISubscriptionImpl
</subscriptionUrl>
<subscriptionListenerUrl>
org.apache.juddi.api.impl.UDDISubscriptionListenerImpl
</subscriptionListenerUrl>
<juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
</node>
</nodes>
</manager>
</uddi>juddiv3-samples.war をビルド、デプロイすることで sales レジストリノードにデプロイします。
9.4. ユーザーがサブスクリプションを作成ができるように許可
sales keygenerator tModel を所有する必要があります (この件についての詳細は、Marketing ノードと sales ノードの両方のルートシードデータで marketing_*.xml ファイルを確認してください。)
tModels を所有することを理解してください。
<save_tModel xmlns="urn:uddi-org:api_v3">
<tModel tModelKey="uddi:marketing.apache.org:keygenerator" xmlns="urn:uddi-org:api_v3">
<name>marketing-apache-org:keyGenerator</name>
<description>Marketing domain key generator</description>
<overviewDoc>
<overviewURL useType="text">
http://uddi.org/pubs/uddi_v3.htm#keyGen
</overviewURL>
</overviewDoc>
<categoryBag>
<keyedReference tModelKey="uddi:uddi.org:categorization:types"
keyName="uddi-org:types:keyGenerator"
keyValue="keyGenerator" />
</categoryBag>
</tModel>
<tModel tModelKey="uddi:marketing.apache.org:subscription:keygenerator"
xmlns="urn:uddi-org:api_v3">
<name>marketing-apache-org:subscription:keyGenerator</name>
<description>Marketing Subscriptions domain key generator</description>
<overviewDoc>
<overviewURL useType="text">
http://uddi.org/pubs/uddi_v3.htm#keyGen
</overviewURL>
</overviewDoc>
<categoryBag>
<keyedReference tModelKey="uddi:uddi.org:categorization:types"
keyName="uddi-org:types:keyGenerator"
keyValue="keyGenerator" />
</categoryBag>
</tModel>
<tModel tModelKey="uddi:sales.apache.org:keygenerator" xmlns="urn:uddi-org:api_v3">
<name>sales-apache-org:keyGenerator</name>
<description>Sales Root domain key generator</description>
<overviewDoc>
<overviewURL useType="text">
http://uddi.org/pubs/uddi_v3.htm#keyGen
</overviewURL>
</overviewDoc>
<categoryBag>
<keyedReference tModelKey="uddi:uddi.org:categorization:types"
keyName="uddi-org:types:keyGenerator"
keyValue="keyGenerator" />
</categoryBag>
</tModel>
</save_tModel>uddi-portlet.war の uddi.xml ファイルに追加します。
<clerks registerOnStartup="false">
<clerk name="MarketingCratchit" node="default"
publisher="marketing" password="marketing"/>
<clerk name="SalesCratchit" node="sales-ws"
publisher="marketing" password="marketing"/>
<!-- optional
<xregister>
<servicebinding
entityKey="uddi:marketing.apache.org:servicebindings-subscriptionlistener-ws"
fromClerk="MarketingCratchit" toClerk="SalesCratchit"/>
</xregister>
-->
</clerks>9.5. 同期通知
keyGenerator ルールを使うようにしてください。 sales-ws UDDI ノードの下にオレンジのサブスクリプションアイコンが表示されるはずです。
HelloWorld サービスに更新がないか Sales ノードを検索します。ロー XML レスポンスが UDDISubscriptionNotification ポートレットに掲示されます。

図9.3 同期サブスクリプションリクエストへのロー XML レスポンス
HelloWorld サブスクリプションの情報と sales business をインポートします。正常に同期されると、マーケティングノードのブラウザーポートレットに 3 つのビジネスが表示されます。
第10章 M Bean のサポート
- org.apache.juddi.api.impl.UDDIServiceCounter
- org.apache.juddi.api.impl.UDDICustodyTransferCounter
- org.apache.juddi.api.impl.UDDIInquiryCounter
- org.apache.juddi.api.impl.UDDIPublicationCounter
- org.apache.juddi.api.impl.UDDISecurityCounter
- org.apache.juddi.api.impl.UDDISubscriptionCounter
- 正常なクエリ
- 失敗したクエリ
- クエリ合計
- 処理時間
- API 別の合計/正常/失敗集計数
付録A UDDI Registry
A.1. はじめに
重要
A.2. UDDI Registry
UDDI_Security_PortType。セキュリティトークンを取得する API を定義します。有効なセキュリティトークンがあれば、パブリッシャーはレジストリを公開できます。全セッションを通して、セキュリティトークンを利用することができます。UDDI_Publication_PortType。ビジネスやサービス情報を UDDI レジストリに公開する API を定義します。UDDI_Inquiry_PortType。UDDI レジストリをクエリする API を定義します。通常、この API ではセキュリティトークンを必要としません。UDDI_CustodyTransfer_PortType。この API を使用して、ビジネスの管理を UDDI ノードから別のノードに移行します。UDDI_Subscription_PortType。特定のビジネスサービスに更新を登録する API を定義します。UDDI_SubscriptionListener_PortType。クライアントが UDDI ノードからサブスクリプション通知を受信するために実装する必要のある API を定義します。UDDI_Replication_PortType。UDDI ノード間のレジストリデータを複製する API を定義します。UDDI_ValueSetValidation_PortType。 ノード別に外部プロバイダーが値の検証をできるようにします。また、Web サービスが keyedReferences または keyedReferenceGroups が有効かを評価します。UDDI_ValueSetCaching_PortType。このような Web サービスから取得したキャッシュ値を使って、UDDI ノードは、パブリッシャー参照を検証する場合があります。
付録B jUDDI クライアントの使用
B.1. はじめに
./server/default/deployers/esb.deployer/lib/juddi-client-[version].jar、 ./server/all/deployers/esb.deployer/lib/juddi-client-[version].jar、または ./server/production/deployers/esb.deployer/lib/juddi-client-[version].jar にあります)。
注記
B.2. JAX-WS トランスポート
uddi.xml ファイルの設定に基づき、クライアントは JAX-WS を用いて (リモートの) レジストリサーバーとやり取りします。つまり、クライアントは JAX-WS 準拠の Web サービススタック (CXF、Axis2、JBossWS) へアクセスする必要があります。
<!-- JAX-WS Transport -->
<proxyTransport>org.apache.juddi.v3.client.transport.JAXWSTransport</proxyTransport>
<custodyTransferUrl>
http://${serverName}:${serverPort}/juddiv3/services/custody-transfer?wsdl
</custodyTransferUrl>
<inquiryUrl>
http://${serverName}:${serverPort}/juddiv3/services/inquiry?wsdl
</inquiryUrl>
<publishUrl>
http://${serverName}:${serverPort}/juddiv3/services/publish?wsdl
</publishUrl>
<securityUrl>
http://${serverName}:${serverPort}/juddiv3/services/security?wsdl
</securityUrl>
<subscriptionUrl>
http://${serverName}:${serverPort}/juddiv3/services/subscription?wsdl
</subscriptionUrl>
<subscriptionListenerUrl>
http://${serverName}:${serverPort}/juddiv3/services/subscription-listener?wsdl
</subscriptionListenerUrl>
<juddiApiUrl>
http://${serverName}:${serverPort}/juddiv3/services/juddi-api?wsdl
</juddiApiUrl>B.3. RMI トランスポート
deploy/jbossesb-registry.sar/esb.juddi.xml ファイルを編集します。
- juddi (クラス:
org.jnp.interfaces.NamingContext) - UDDIPublicationService (クラス:
org.apache.juddi.rmi.UDDIPublicationService) - UDDICustodyTransferService (クラス:
org.apache.juddi.rmi.UDDICustodyTransferService) - UDDISubscriptionListenerService (クラス:
org.apache.juddi.rmi.UDDISubscriptionListenerService) - UDDISecurityService (クラス:
org.apache.juddi.rmi.UDDISecurityService) - UDDISubscriptionService (クラス:
org.apache.juddi.rmi.UDDISubscriptionService) - UDDIInquiryService (クラス:
org.apache.juddi.rmi.UDDIInquiryService)
uddi.properties ファイルの JAXWS セクションをコメントアウトして、代わりに RMI Transport セクションを使用します。
注記
jndi.properties ファイルに java.naming.* プロパティを設定するか、システムパラメーターを設定することができます。
B.4. InVM トランスポート
juddi.war アーカイブにデプロイする場合、サーバーは org.apache.juddi.RegistryServlet クラスにより起動されますが、コンテナー以外で実行している場合は、ご自身で org.apache.juddi.Registry サービスを開始、停止する必要があります。
Registry.start()
Registry.stop()
uddi.properties ファイルの該当セクションをアンコメントして、JAXWS と RMI Transport セクションをコメントアウトします。
B.5. 依存性
uddi-ws-3.0.0.jar、commons-configuration-1.5.jar、 commons-collection-3.2.1.jar、log4j-1.2.13.jar に依存しています。
- JDK6 のライブラリ
- JAXWS クライアントライブラリ (CXF などの JAXWS トランスポートを使用している場合)
- RMI および JNDI クライアントライブラリ (RMI トランスポートを使用している場合)
B.6. サンプルコード
uddi-client モジュールにて UDDI クライアントの使用方法を説明している、サンプルコードがあります。
public void testAuthToken() {
try {
String clazz = ClientConfig.getConfiguration().getString(
Property.UDDI_PROXY_TRANSPORT,Property.DEFAULT_UDDI_PROXY_TRANSPORT);
Class<?> transportClass = Loader.loadClass(clazz);
if (transportClass!=null) {
Transport transport = (Transport) transportClass.newInstance();
UDDISecurityPortType securityService = transport.getSecurityService();
GetAuthToken getAuthToken = new GetAuthToken();
getAuthToken.setUserID("root");
getAuthToken.setCred("");
AuthToken authToken = securityService.getAuthToken(getAuthToken);
System.out.println(authToken.getAuthInfo());
Assert.assertNotNull(authToken);
} else {
Assert.fail();
}
} catch (Exception e) {
e.printStackTrace();
Assert.fail();
}
}root) が Registry 内に既存のパブリッシャーで、正しいレスポンスを取得できるように適切な認証情報を提供しているか確認してください。
付録C © 2011
付録D 改訂履歴
| 改訂履歴 | |||
|---|---|---|---|
| 改訂 5.2.0-0.2.400 | 2013-10-31 | ||
| |||
| 改訂 5.2.0-0.2 | Wed Dec 19 2012 | ||
| |||
| 改訂 5.2.0-0.1 | Wed Dec 19 2012 | ||
| |||
| 改訂 5.2.0-0 | Wed Jul 6 2011 | ||
| |||
