Management of UDDI node configuration properties
You can 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 you have the ConfigurationProperty objects, you can inspect attributes such as the ID, value, and type. You 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: none
You can use 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.
- Invoke the getProperties operation:
- getProperty
- Returns 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, you 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 by using the
convenience
method getIntegerValue:
int maxResults = property.getIntegerValue();
- Invoke the
getProperty operation:
- 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 you 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);
- Create
a ConfigurationProperty object and set its ID:
- 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);
- Add the updated properties to a list: