Management of UDDI node configuration properties
Use the UDDI registry administrative interface to manage the UDDI node runtime behavior by setting the configuration properties.
UDDI node runtime behavior is affected by the setting of several configuration properties. The UddiNode MBean provides the following operations to inspect and update the configuration properties:
- getProperties
- getProperty
- updateProperty
- updateProperties
In the samples for WebSphere Application Server, the ManagePropertiesSample class in the UDDI registry samples demonstrates these operations.
- getProperties
- Returns a collection of all configuration properties as ConfigurationProperty objects.
- Invoke the getProperties operation:
List properties = uddiNode.getProperties();- Cast each collection member to the ConfigurationProperty object:
if (properties != null) { for (Iterator iter = properties.iterator(); iter.hasNext();) { ConfigurationProperty property = (ConfigurationProperty) iter.next(); System.out.println(property); } }
When we have the ConfigurationProperty objects, we can inspect attributes such as the ID, value, and type. We can determine whether the property is read-only or required for initialization, and get the name and description message keys. For example, if you invoke the toString method, results similar to the following example are returned:
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: noneUse the nameKey and descriptionKey values to look up the translated name and description for a given locale, using the messages.properties resource in the sample package.
- getProperty
- Return the ConfigurationProperty object with the specified ID. Available property IDs are specified in PropertyConstants with descriptions of the purpose of the corresponding properties.
- Invoke the getProperty operation:
ConfigurationProperty property = uddiNode.getProperty(PropertyConstants.DATABASE_MAX_RESULT_COUNT);- To retrieve the value of the property, we can use the getValue method, which returns an Object, but in this case, the property is an integer type, so it is easier to retrieve the value using the convenience method getIntegerValue:
int maxResults = property.getIntegerValue();
- updateProperty
- Updates the value of the ConfigurationProperty object with the specified ID. Available property IDs are specified in PropertyConstants with descriptions of the purpose of the corresponding properties. Although we can invoke the setter methods in a ConfigurationProperty object, the only value that is updated in the UDDI node is the value. To update a property, typically, use the following steps:
- Create a ConfigurationProperty object and set its ID:
ConfigurationProperty defaultLanguage = new ConfigurationProperty(); defaultLanguage.setId(PropertyConstants.DEFAULT_LANGUAGE);- Set the value:
defaultLanguage.setStringValue("ja");- Invoke the updateProperty operation:
uddiNode.updateProperty(defaultLanguage);
- updateProperties
- Updates several ConfigurationProperty objects in a single request. Set up the ConfigurationProperty objects in the same way as for the updateProperty operation.
- Add the updated properties to a list:
List updatedProperties = new ArrayList(); updatedProperties.add(updatedProperty1); updatedProperties.add(updatedProperty2);- Invoke the updateProperties operation:
uddiNode.updateProperties(updatedProperties);
Manage the UDDI registry Use the UDDI registry Use administrative programs (JMX) Management of UDDI node states and attributes Management of UDDI node policies Management of UDDI node tiers Management of UDDI publishers Management of UDDI node value sets Samples for WAS