4.0

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;
}
8 Implement the WebConfigurationAdaptor.getWebAppContext() and
WebConfigurationAdaptor.setWebConfiguration() methods to locate the WAR file of a Struts-based Web
application Web application that defines the actions to perform in the configuration tab.
The SolarSystemConfigurationAdaptor class points the getWebAppContext() method to the solarsystem
WAR file in the DAR file.
public String getWebAppContext() {
return "/solarsystem";
}
public void setWebConfiguration(boolean webConfiguration) {
}
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.
Chapter 7 Developing Plug-Ins
VMware, Inc. 195