UDDI レジストリー管理インターフェースを使用すると、UDDI アプリケーションのランタイム構成を検査および管理できます。 UDDI ノードについての情報と活動化状態の管理、プロパティーとポリシーの更新、公開層の制限の設定、UDDI パブリッシャーの登録、および値セット・サポートの制御が可能です。
標準 JMX (Java Management Extensions) インターフェースを使用して、UDDI レジストリー管理インターフェースの操作を読み取ったり、呼び出したりすることができます。JMX の使用法は、 管理プログラム (JMX) の使用に説明されています。
個々の WebSphere UDDI レジストリー・アプリケーションは、MBean を 「UddiNode」という MBean ID で登録します。この MBean は、UDDI アプリケーションのランタイム構成の検査および管理のために、 クライアント・アプリケーションによって使用されることがあります。 これには、UDDI ノードの活動化状態と UDDI ノードに関する情報の管理、 プロパティーおよびポリシーの更新、公開層の限界設定、UDDI パブリッシャーの登録、 値セット・サポートの制御などが含まれます。
標準的な JMX インターフェースを使用すると、 UddiNode 属性および操作を読み取ったり呼び出したりすることができます。 クライアント・ユーティリティー・クラス UddiNodeProxy.java は、 UddiNode MBean に接続して使用可能なすべての操作を実行するための、既製のアプリケーションを提供します。 UddiNodeProxy を実行し、さまざまな UDDI 管理データ型の使用方法を示すクラス例も提供されています。
WebSphere Application Server の グローバル・セキュリティーが使用可能になっている場合、 管理役割のユーザーのみが UddiNode MBean の操作を呼び出すことが できます。更新を行う操作にはアドミニストレーターまたはオペレーターの役割が必要ですが、 取得操作はアドミニストレーター、オペレーター、コンフィギュレーター、およびモニターの各役割で 実行できます。
UddiNodeProxy の使用法
java.lang.String getNodeID() [INFO] (getter for attribute nodeID) java.lang.String getNodeState() [INFO] (getter for attribute nodeState) java.lang.String getNodeDescription() [INFO] (getter for attribute nodeDescription) java.lang.String getNodeApplicationName() [INFO] (getter for attribute nodeApplicationName) void activateNode() [ACTION] (activates UDDI node) void deactivateNode() [ACTION] (deactivates UDDI node) void initNode() [ACTION] (initializes Uddi node) com.ibm.uddi.v3.management.Property getProperty(java.lang.String propertyId) [INFO] (returns UDDI Property) com.ibm.uddi.v3.management.PolicyGroup getPolicyGroup(java.lang.String policyGroupId) [INFO] (returns UDDI PolicyGroup) com.ibm.uddi.v3.management.Policy getPolicy(java.lang.String policyId) [INFO] (returns UDDI Policy) void updatePolicy(com.ibm.uddi.v3.management.Policy policy) [ACTION] (updates UDDI Policy) void updateProperty(com.ibm.uddi.v3.management.ConfigurationProperty property) [ACTION] (updates UDDI Property) void updateProperties(java.util.List properties) [ACTION] (updates collection of UDDI properties) void updatePolicies(java.util.List policies) [ACTION] (updates collection of UDDI policies) java.util.List getProperties() [INFO] (returns the collection of UDDI properties) java.util.List getPolicyGroups() [INFO] (returns collection of policy groups (note that the policies are not populated)) java.util.List getValueSets() [INFO] (returns collection of value set status objects) com.ibm.uddi.v3.management.ValueSetStatus getValueSetDetail(java.lang.String tModelKey) [INFO] (returns status for a value set) com.ibm.uddi.v3.management.ValueSetProperty getValueSetProperty(java.lang.String tModelKey,java.lang.String valueSetPropertyId) [INFO] (returns a property of a value set) void updateValueSet(com.ibm.uddi.v3.management.ValueSetStatus valueSet) [ACTION] (updates value set status) void updateValueSets(java.util.List valueSets) [ACTION] (updates multiple value sets) void loadValueSet(java.lang.String filePath,java.lang.String tModelKey) [ACTION] (loads values for a value set from a UDDI registry V3/V2 taxonomy data file.) void loadValueSet(com.ibm.uddi.v3.management.ValueSetData valueSetData) [ACTION] (loads values for a value set with the given tModel key.) void changeValueSetTModelKey(java.lang.String oldTModelKey,java.lang.String newTModelKey) [ACTION] (replaces all occurrences of values belonging to original tModelKey to new tModelKey.) void unloadValueSet(java.lang.String tModelKey) [ACTION] (unloads values for a value set with the given tModel key.) java.lang.Boolean isExistingValueSet(java.lang.String tModelKey) [INFO] (Determine if Value Set data exists for the given tModel key.) java.util.List getTierInfos() [INFO] (returns the collection of UDDI tier descriptions.) java.util.List getLimitInfos() [INFO] (returns the collection of UDDI limit descriptions.) java.util.List getEntitlementInfos() [INFO] (returns the collection of UDDI entitlements.) com.ibm.uddi.v3.management.Tier getTierDetail(java.lang.String tierId) [INFO] (returns UDDI Tier detail, specifying limits to the number of entities that can be published.) com.ibm.uddi.v3.management.Tier createTier(com.ibm.uddi.v3.management.Tier tier) [ACTION] (creates a UDDI Tier, specifying limits to the number of entities that can be published. Returns the new tier ID.) com.ibm.uddi.v3.management.Tier updateTier(com.ibm.uddi.v3.management.Tier tier) [ACTION] (updates UDDI Tier details. Returns the updated Tier.) void deleteTier(java.lang.String tierId) [ACTION] (deletes the UDDI Tier, if it not in use.) void setDefaultTier(java.lang.String tierId) [ACTION] (Specifies the tier that auto registered UDDI publishers are assigned to.) java.lang.Integer getUserCount(java.lang.String tierId) [INFO] (returns the number of UDDI publisher within the specified tier.) com.ibm.uddi.v3.management.TierInfo getUserTier(java.lang.String userId) [INFO] (returns UDDI Tier information, specifying the tier this user belongs to.) com.ibm.uddi.v3.management.UddiUser getUddiUser(java.lang.String userId) [INFO] (returns UDDI user details, including tier and entitlements details.) java.util.List getUserInfos() [INFO] (returns the collection of UDDI user names and the tier they belong to.) void createUddiUser(com.ibm.uddi.v3.management.UddiUser user) [ACTION] (creates a new UDDI user.) void createUddiUsers(java.util.List users) [ACTION] (creates the collection of new UDDI users.) void updateUddiUser(com.ibm.uddi.v3.management.UddiUser user) [ACTION] (updates UDDI user details.) void deleteUddiUser(java.lang.String userId) [ACTION] (deletes UDDI publisher.) void assignTier(java.util.List userIds,java.lang.String tierId) [ACTION] (sets the tier for a List of users.) notificationInfo: description=default UDDI event,descriptorType=notification,severity=(6),name=uddi.node.event notificationInfo: description=null,descriptorType=notification,severity=(6),name=jmx.attribute.changed
このセクションで取り上げる属性および操作の実例となるサンプル・コードについては、 ManageNodeInfoSample クラスを参照してください。
UDDI ノードにはいくつかの状態があり、 UDDI アプリケーションのインストール方法 (デフォルト構成としてインストールされているか、 初期設定時に管理者が制御する構成になっているか) によって、そのいずれかの状態になります。 UddiNode MBean では、4 つの読み取り専用属性 (nodeID、nodeState、nodeDescription、 および nodeApplicationName) が提供されます。さらに、次の MBean 操作で、 UDDI ノードの状態 (activateNode、deactivateNode、および initNode) が変わります。
nodeID
String nodeID = uddiNode.getNode(); System.out.println("node ID: " + nodeId);
nodeState
nodeState の値 | 状態の説明 |
node.state.uninitialized | 初期化されていない |
node.state.initialized | 初期化済み |
node.state.initPending | 初期化保留 |
node.state.initInProgress | 初期化進行中 |
node.state.activated | 活動化済み |
node.state.deactivated | 非活動状態 |
node.state.unknown | 不明 |
デフォルト構成を使用して UDDI アプリケーションをインストールした後は、 UDDI ノードは活動化済み、すなわち UDDI API 要求の受信および処理が可能な状態にあります。 ノード ID とルート・キー・ジェネレーター、および他のいくつかのプロパティーは、 生成はされますが変更はできません。 手動でインストールした UDDI アプリケーションで UDDI のノード ID とルート・キー・ジェネレーターの値を指定する場合、 UDDI アプリケーションを開始すると UDDI ノードの状態は initPending になります。 この状態では、書き込み可能なすべての値を、initNode 操作を呼び出すポイントまで更新することができます。 initNode 操作では、基本の tModel と値セットのデータがロードされ、 すべての構成データが UDDI ノードのデータベースに書き込まれます。 初期化の時の状態は initInProgress です。初期化が完了すると、 状態は一瞬「初期化済み」に変わり、続いて「活動化済み」になります。この時点では、 deactivateNode および activateNode の MBean 操作により、状態を「活動化済み」と「非活動状態」の間でのみ切り替えることができます。
String nodeStateKey = uddiNode.getNodeState();
String messages = "com.ibm.uddi.v3.management.messages"; ResourceBundle bundle = ResourceBundle.getBundle(messages, Locale.ENGLISH); String nodeStateText = bundle.getString(nodeStateKey); System.out.println("node state: " + nodeStateText);
nodeDescription
String nodeDescription = uddiNode.getNodeDescription(); System.out.println("node description: " + nodeDescription);
nodeApplicationName
String nodeApplicationId = uddiNode.getApplicationId(); System.out.println("node application location: " + nodeApplicationId);
activateNode
uddiNode.activateNode();
deactivateNode
uddiNode.deactivateNode();
initNode
uddiNode.initNode();
UDDI ノードのランタイムの振る舞いは、 いくつかの構成プロパティーの設定で決まります。UddiNode MBean では、getProperties、getProperty、updateProperty、 updateProperties のように、それぞれの値を検査したり更新したりする操作を提供しています。
このセクションで取り上げる操作の実例となるサンプル・コードについては、ManagePropertiesSample クラスを参照してください。
getProperties
List properties = uddiNode.getProperties();
if (properties != null) { for (Iterator iter = properties.iterator(); iter.hasNext();) { ConfigurationProperty property = (ConfigurationProperty) iter.next(); System.out.println(property); } }
ConfigurationProperty id: operatorNodeIDValue nameKey: property.name.operatorNodeIDValue descriptionKey: property.desc.operatorNodeIDValue type: java.lang.String value: uddi:capnscarlet:capnscarlet:server1:default unitsKey: readOnly: true required: true usingMessageKeys: false validValues: none
nameKey 値および descriptionKey 値を使用すると、 uddiadmin.jar 内の messages.properties リソースから、指定するロケール用に変換された名前と説明を検索することができます。
getProperty
ConfigurationProperty property = uddiNode.getProperty(PropertyConstants.DATABASE_MAX_RESULT_COUNT);
int maxResults = property.getIntegerValue();
updateProperty
ConfigurationProperty defaultLanguage = new ConfigurationProperty(); defaultLanguage.setId(PropertyConstants.DEFAULT_LANGUAGE);
defaultLanguage.setStringValue("ja");
uddiNode.updateProperty(defaultLanguage);
updateProperties
List updatedProperties = new ArrayList(); updatedProperties.add(updatedProperty1); updatedProperties.add(updatedProperty2);
uddiNode.updateProperties(updatedProperties);
UDDI API の振る舞いに影響を与えるポリシーは、getPolicyGroups、 getPolicyGroup、getPolicy、updatePolicy、updatePolicies などの UddiNode 操作を使用して管理されます。
このセクションで取り上げる属性および操作の実例となるサンプル・コードについては、ManagePoliciesSample クラスを参照してください。
getPolicyGroups
List policyGroups = uddiNode.getPolicyGroups();
if (policyGroups != null) { for (Iterator iter = policyGroups.iterator(); iter.hasNext();) { PolicyGroup policyGroup = (PolicyGroup) iter.next(); System.out.println(policyGroup); } }
各ポリシー・グループには、ID、名前、および説明キーがあります (これらは、 uddiadmin.jar 内の messages.properties リソースで検索できます)。PolicyGroup クラスには getPolicies メソッドが含まれていますが、 getPolicyGroups 操作で戻される PolicyGroup オブジェクトには、Policy オブジェクトはまったく含まれていないので注意が必要です。これは、クライアントが、1 つの要求に含まれるポリシー・セット全体を検索しなくても、 既知のポリシー・グループ (およびその ID) を判別できるようにするためです。 ポリシー・グループ内のポリシーを検索する場合は、 getPolicyGroup 操作を使用します。
getPolicyGroup
String groupId = Integer.toString(PolicyConstants.REG_APIS_GROUP);
PolicyGroup policyGroup = uddiNode.getPolicyGroup(groupId);
getPolicy
String policyId = Integer.toString( PolicyConstants.REG_AUTHORIZATION_FOR_INQUIRY_API);
Policy policy = uddiNode.getPolicy(policyId);
updatePolicy
Policy updatedPolicy = new Policy(); String policyId = Integer.toString(PolicyConstants.REG_SUPPORTS_UUID_KEYS); updatedPolicy.setId(policyId);
updatedPolicy.setBooleanValue(true);
uddiNode.updatePolicy(updatedPolicy);
updatePolicies
List updatedPolicies = new ArrayList(); updatedPolicies.add(updatedPolicy1); updatedPolicies.add(updatedPolicy2);
uddiNode.updatePolicies(updatedPolicies);
層の管理
パブリッシャーが UDDI レジストリー内に保管できる UDDI エンティティーのタイプごとの数は、 層が制御します。 層には、ID、管理者が定義する名前と説明、および限界セットが、 エンティティーのタイプごとに 1 つずつあります。 層を管理する UddiNode 操作は次のとおりです。 createTier、getTierDetail、getTierInfos、getLimitInfos、setDefaultTier、updateTier、 deleteTier、および getUserCount。
このセクションで取り上げる属性および操作の実例となるサンプル・コードについては、 ManageTiersSample クラスを参照してください。
createTier
String tierName = "Tier 100"; String tierDescription = "A tier with all limits set to 100."; TierInfo tierInfo = new TierInfo(null, tierName, tierDescription);
List limits = new ArrayList(); Limit businessLimit = new Limit(); businessLimit.setIntegerValue(100); businessLimit.setId(LimitConstants.BUSINESS_LIMIT); Limit serviceLimit = new Limit(); serviceLimit.setIntegerValue(100); serviceLimit.setId(LimitConstants.SERVICE_LIMIT); Limit bindingLimit = new Limit(); bindingLimit.setIntegerValue(100); bindingLimit.setId(LimitConstants.BINDING_LIMIT); Limit tModelLimit = new Limit(); tModelLimit.setIntegerValue(100); tModelLimit.setId(LimitConstants.TMODEL_LIMIT); Limit assertionLimit = new Limit(); assertionLimit.setIntegerValue(100); assertionLimit.setId(LimitConstants.ASSERTION_LIMIT); limits.add(businessLimit); limits.add(serviceLimit); limits.add(bindingLimit); limits.add(tModelLimit); limits.add(assertionLimit);
Tier tier = new Tier(tierInfo, limits);
Tier createdTier = uddiNode.createTier(tier);
tierId = createdTier.getId(); System.out.println("created tier has ID: " + tierId);
getTierDetail
Tier tier = uddiNode.getTierDetail("2");
updateTier
modifiedTier.setName(tier.getName()); modifiedTier.setDescription(tier.getDescription()); Limit tModelLimit = new Limit(); tModelLimit.setId(LimitConstants.TMODEL_LIMIT); tModelLimit.setIntegerValue(50); List updatedLimits = new ArrayList(); updatedLimits.add(tModelLimit); modifiedTier.setLimits(updatedLimits);
uddiNode.updateTier(modifiedTier);
getTierInfos
List tierInfos = uddiNode.getTierInfos();
if (tierInfos != null) { for (Iterator iter = tierInfos.iterator(); iter.hasNext();) { TierInfo tierInfo = (TierInfo) iter.next(); System.out.println(tierInfo); } }
setDefaultTier
uddiNode.setDefaultTier("4");
deleteTier
uddiNode.deleteTier("4");
getUserCount
Integer userCount = uddiNode.getUserCount("4"); System.out.println("users in tier 4: " + userCount.intValue());
getLimitInfos
List limits = uddiNode.getLimitInfos();
for (Iterator iter = limits.iterator(); iter.hasNext();) { Limit limit = (Limit) iter.next(); System.out.println("limit ID: " + limit.getId() + ", limit value: " + limit.getIntegerValue()); }
UDDI パブリッシャーの管理には、 UddiNode MBean 操作 (createUddiUser、createUddiUsers、updateUddiUser、 deleteUddiUser、getUddiUser、getUserInfos、getEntitlementInfos、assignTier、 getUserTier) を使用します。各操作には、UddiNodeProxy クライアント・クラスを利用する例が提供されています。
このセクションで取り上げる属性および操作の実例となるサンプル・コードについては、 ManagePublishersSample クラスを参照してください。
createUddiUser
指定した層で、 指定した資格を持つ単一の UDDI パブリッシャーを登録します。UddiUser クラスは UDDI パブリッシャーを表し、ユーザー ID、TierInfo オブジェクト (UDDI パブリッシャーの 割り振り先になる層の ID を指定します)、および Entitlement オブジェクトの集合 (UDDI パブリッシャーに許可されている操作を指定します) によって 構成されます。
UddiUser user = new UddiUser("user1", new TierInfo("3"), null);
uddiNode.createUddiUser(user);
createUddiUsers
TierInfo tier1 = new TierInfo("1"); TierInfo tier4 = new TierInfo("4");
UddiUser publisher1 = new UddiUser("Publisher1", tier4, null); UddiUser publisher2 = new UddiUser("Publisher2", tier4, null); UddiUser publisher3 = new UddiUser("Publisher3", tier4, null); UddiUser publisher4 = new UddiUser("Publisher4", tier1, null); UddiUser publisher5 = new UddiUser("Publisher5", tier1, null); UddiUser cts1 = new UddiUser("cts1", tier4, null); UddiUser cts2 = new UddiUser("cts2", tier4, null);
List uddiUsers = new ArrayList(); uddiUsers.add(publisher1); uddiUsers.add(publisher2); uddiUsers.add(publisher3); uddiUsers.add(publisher4); uddiUsers.add(publisher5); uddiUsers.add(cts1); uddiUsers.add(cts2);
uddiNode.createUddiUsers(uddiUsers);
updateUddiUser
Entitlement publishUuiDKeyGenerator = new Entitlement(PUBLISH_UUID_KEY_GENERATOR, true); Entitlement publishWithUuidKey = new Entitlement(PUBLISH_WITH_UUID_KEY, true);
List entitlements = new ArrayList(); entitlements.add(publishUuiDKeyGenerator); entitlements.add(publishWithUuidKey);
user.setEntitlements(entitlements);
uddiNode.updateUddiUser(user);
getUddiUser
UddiUser user1 = uddiNode.getUddiUser("user1");
System.out.println("retrieved user: " + user1);
getUserInfos
List registeredUsers = uddiNode.getUserInfos();
System.out.println("retrieved registered users: "); System.out.println(registeredUsers);
getEntitlementInfos
List entitlementInfos = uddiNode.getEntitlementInfos();
String messages = "com.ibm.uddi.v3.management.messages"; ResourceBundle bundle = ResourceBundle.getBundle( messages, Locale.ENGLISH);
for (Iterator iter = entitlementInfos.iterator(); iter.hasNext();) { Entitlement entitlement = (Entitlement) iter.next(); StringBuffer entitlementOutput = new StringBuffer(); String entitlementId = entitlement.getId(); String entitlementName = bundle.getString(entitlement.getNameKey()); String entitlementDescription = bundle.getString(entitlement.getDescriptionKey()); entitlementOutput.append("Entitlement id: "); entitlementOutput.append(entitlementId); entitlementOutput.append("¥n name: "); entitlementOutput.append(entitlementName); entitlementOutput.append("¥n description: "); entitlementOutput.append(entitlementDescription); System.out.println(entitlementOutput.toString()); }
deleteUddiUser
uddiNode.deleteUddiUser("user1");
assignTier
List uddiUserIds = new ArrayList(); uddiUserIds.add("Publisher1"); uddiUserIds.add("Publisher2"); uddiUserIds.add("Publisher3"); uddiUserIds.add("Publisher4"); uddiUserIds.add("Publisher5"); uddiUserIds.add("cts1"); uddiUserIds.add("cts2");
uddiNode.assignTier(uddiUserIds, "0");
getUserTier
TierInfo tierInfo = getUserTier("Publisher3");
System.out.println(tierInfo);
値セットは、UDDI レジストリーで値セット tModel として表され、 UDDI タイプ keyedReference の値は「categorization」です。このような値セットは、 有効な値のセットによって元に戻されます。ユーザー定義の値セットでは、 このデータは UddiNode MBean 操作によって UDDI レジストリーにロードされます (ただし、 この目的にはユーザー定義の値セット・ツールを使用する方が便利です)。 個々の値セットは、ポリシーによってサポートまたは非サポートとして制御できます。 値セットがポリシーによってサポートされる場合は、 UDDI 公開要求内で参照できます。値セットとそのデータの管理に使用できる UddiNode 操作は次のとおりです。 getValueSets、getValueSetDetail、getValueSetProperty、updateValueSet、updateValueSets、loadValueSet、 changeValueSetTModelKey、unloadValueSet、および isExistingValueSet。
このセクションで取り上げる属性および操作の実例となるサンプル・コードについては、ManageValueSetsSample クラスを参照してください。
getValueSets
List valueSets = uddiNode.getValueSets();
for (Iterator iter = valueSets.iterator(); iter.hasNext();) { ValueSetStatus valueSetStatus = (ValueSetStatus) iter.next(); System.out.println(valueSetStatus); }
getValueSetDetail
uddiNode.getValueSetDetail( "uddi:uddi.org:ubr:categorization:naics:2002");
String name = valueSetStatus.getName(); String displayName = valueSetStatus.getDisplayName(); boolean supported = valueSetStatus.isSupported(); System.out.println("name: " + name); System.out.println("display name: " + displayName); System.out.println("supported: " + supported);
List properties = valueSetStatus.getProperties(); for (Iterator iter = properties.iterator(); iter.hasNext();) { ValueSetProperty property = (ValueSetProperty) iter.next(); System.out.println(property); }
getValueSetProperty
uddiNode.getValueSetProperty( "uddi:uddi.org:ubr:categorization:naics:2002", ValueSetPropertyConstants.VS_CHECKED);
boolean checked = valueSetProperty.getBooleanValue(); System.out.println("checked: " + checked);
updateValueSet
ValueSetStatus updatedStatus = new ValueSetStatus(); updatedStatus.setTModelKey( "uddi:uddi.org:ubr:categorization:naics:2002"); updatedStatus.setSupported(true);
uddiNode.updateValueSet(updatedStatus);
updateValueSets
List valueSets = new ArrayList(); ValueSetStatus valueSetStatus = new ValueSetStatus(); valueSetStatus.setTModelKey( "uddi:uddi.org:ubr:categorization:naics:2002"); valueSetStatus.setSupported(false); valueSets.add(valueSetStatus); valueSetStatus = new ValueSetStatus(); valueSetStatus.setTModelKey( "uddi:uddi.org:ubr:categorizationgroup:wgs84"); valueSetStatus.setSupported(false); valueSets.add(valueSetStatus); valueSetStatus = new ValueSetStatus(); valueSetStatus.setTModelKey( "uddi:uddi.org:ubr:identifier:iso6523:icd"); valueSetStatus.setSupported(false); valueSets.add(valueSetStatus);
uddiNode.updateValueSets(valueSets);
loadValueSet
uddiNode.loadValueSet( "C:/valuesets/myvalueset.txt", "uddi:cell:node:server:myValueSet");
changeValueSetTModelKey
uddiNode.changeValueSetTModelKey( "uddi:cell:node:server:myValueSet", "uddi:cell:node:server:myNewValueSet");
unloadValueSet
uddiNode.unloadValueSet("uddi:myValueSet");
isExistingValueSet
boolean exists = uddiNode.isExistingValueSet( "uddi:uddi.org:ubr:categorization:naics:2002"); System.out.println("NAICS 2002 is a value set: " + exists);