Author: rareddy
Date: 2009-02-26 13:10:22 -0500 (Thu, 26 Feb 2009)
New Revision: 507
Modified:
trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployedHostPanel.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
trunk/server/src/main/java/com/metamatrix/platform/registry/HostControllerRegistryBinding.java
Log:
TEIID-309: adding host properties to Host object, so that they can be viewed by the client
applications such as Admin API.
Modified:
trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployedHostPanel.java
===================================================================
---
trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployedHostPanel.java 2009-02-26
15:31:30 UTC (rev 506)
+++
trunk/console/src/main/java/com/metamatrix/console/ui/views/deploy/DeployedHostPanel.java 2009-02-26
18:10:22 UTC (rev 507)
@@ -44,11 +44,13 @@
import javax.swing.event.DocumentListener;
import javax.swing.table.TableColumn;
+import com.metamatrix.admin.api.server.ServerAdmin;
import com.metamatrix.common.config.api.ConfigurationID;
import com.metamatrix.common.config.api.Host;
import com.metamatrix.common.config.api.HostID;
import com.metamatrix.common.config.api.VMComponentDefn;
import com.metamatrix.common.config.api.VMComponentDefnType;
+import com.metamatrix.common.config.model.BasicHost;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.object.PropertiedObject;
import com.metamatrix.common.object.PropertiedObjectEditor;
@@ -497,18 +499,19 @@
try {
if (theDomainObject == null) {
// this shouldn't happen since new hosts are created elsewhere
- host = getConfigurationManager().createHost(getString(
- "dhp.newhost")); //$NON-NLS-1$
+ host =
getConfigurationManager().createHost(getString("dhp.newhost")); //$NON-NLS-1$
}
else {
if (theDomainObject instanceof Host) {
host = (Host)theDomainObject;
+ ServerAdmin admin = getConnectionInfo().getServerAdmin();
+ Collection<com.metamatrix.admin.api.objects.Host> adminHosts =
admin.getHosts(host.getFullName());
+ for (com.metamatrix.admin.api.objects.Host adminHost:adminHosts) {
+ ((BasicHost)host).setProperties(adminHost.getProperties());
+ }
}
else {
- throw new IllegalArgumentException(
- getString("msg.invalidclass", //$NON-NLS-1$
- new Object[] {"Host", //$NON-NLS-1$
- theDomainObject.getClass()}));
+ throw new
IllegalArgumentException(getString("msg.invalidclass", new Object[]
{"Host", theDomainObject.getClass()})); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified:
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-02-26
15:31:30 UTC (rev 506)
+++
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-02-26
18:10:22 UTC (rev 507)
@@ -540,8 +540,12 @@
host.setEnabled(hostObject.isEnabled());
Properties properties = hostObject.getProperties();
-
- host.setProperties(properties);
+ if (host.getProperties() != null) {
+ host.getProperties().putAll(properties);
+ }
+ else {
+ host.setProperties(properties);
+ }
host.setDeployed(true);
results.add(host);
Modified:
trunk/server/src/main/java/com/metamatrix/platform/registry/HostControllerRegistryBinding.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/platform/registry/HostControllerRegistryBinding.java 2009-02-26
15:31:30 UTC (rev 506)
+++
trunk/server/src/main/java/com/metamatrix/platform/registry/HostControllerRegistryBinding.java 2009-02-26
18:10:22 UTC (rev 507)
@@ -59,6 +59,8 @@
}
public Properties getProperties() {
- return new Properties(this.hostProperties);
+ Properties p = new Properties();
+ p.putAll(this.hostProperties);
+ return p;
}
}
Show replies by date