4.1

Table Of Contents
5 Implement the IConfigurationAdaptor.loadConfiguration() method to load configuration information
from the configuration server into the Orchestrator server.
The SolarSystemConfigurationAdaptor.loadConfiguration() method creates a Properties list to contain
the configurable properties. The SolarSystemConfigurationAdaptor.loadConfiguration() method calls
the SDKHelper.getConfigurationPathForPluginName() and SDKHelper.loadPropertiesForPluginName()
methods to get the properties from the plug-in and adds them to the Properties list.
public void loadConfiguration(InputStream stream) throws IOException {
Properties prop = new Properties();
String path = SDKHelper.getConfigurationPathForPluginName(pluginName);
if (new File(path).exists()) {
prop = SDKHelper.loadPropertiesForPluginName(pluginName);
}
if (prop.getProperty("solar.system.home.planet") != null) {
homePlanet = prop.getProperty("solar.system.home.planet");
}
if (prop.getProperty("solar.system.isPlutoClassifiedAsAPlanet") != null){
plutoClassifiedAsAPlanet = prop.getProperty("solar.system.isPlutoClassifiedAsAPlanet");
}
}
6 Implement the IConfigurationAdaptor.setPluginName() method to set the name of the plug-in in the
configuration server.
The SolarSystemConfigurationAdaptor class does not add any additional code to the
IConfigurationAdaptor.setPluginName() method.
public void setPluginName(String name) {
}
7 Implement the IConfigurationAdaptor.validateConfiguration() method to validate the configuration
information.
The IConfigurationAdaptor.validateConfiguration() method returns a ConfigurationError instance for
each validation error. The SolarSystemConfigurationAdaptor class returns null in the event of an invalid
configuration property. You can implement more sophisticated code to perform more stringent validation
of the values that the user provides in the configuration interface.
public ConfigurationError[] validateConfiguration() {
return null;
}
You implemented the methods of the IConfigurationAdaptor and SDKHelper classes to load and save
configuration information in the configuration server and defined methods to obtain and set the configurable
values.
What to do next
Obtain configuration information that the user sets in the configuration interface by implementing the Apache
Struts framework.
Create a Configuration Action to Obtain Configuration Information from the User
Orchestrator uses the Apache Struts framework to pass to the Orchestrator server the configuration information
that the user provides in the configuration interface.
You can implement the action that passes configuration information from the Orchestrator configuration
interface to the configuration server directly in the configuration adapter implementation. However, the solar
system example defines this action in a separate class named SolarSystemConfigureAction. The
SolarSystemConfigureAction class uses the methods that the SolarSystemConfigurationAdaptor class defines
Chapter 7 Developing Plug-Ins
VMware, Inc. 189