changeset 16:75015189e1e8

Move Agent's storage layer classes/interfaces to subpackage.
author Jon VanAlten <jon.vanalten@redhat.com>
date Wed, 07 Dec 2011 17:41:30 -0500
parents e68f658a3e19
children 29ae24fc783d
files src/com/redhat/thermostat/agent/Agent.java src/com/redhat/thermostat/agent/Main.java src/com/redhat/thermostat/agent/MongoStorage.java src/com/redhat/thermostat/agent/Storage.java src/com/redhat/thermostat/agent/StorageConstants.java src/com/redhat/thermostat/agent/config/ConfigurationWatcher.java src/com/redhat/thermostat/agent/config/StartupConfiguration.java src/com/redhat/thermostat/agent/storage/MongoStorage.java src/com/redhat/thermostat/agent/storage/Storage.java src/com/redhat/thermostat/agent/storage/StorageConstants.java src/com/redhat/thermostat/backend/Backend.java src/com/redhat/thermostat/backend/BackendRegistry.java
diffstat 12 files changed, 224 insertions(+), 221 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/redhat/thermostat/agent/Agent.java	Wed Dec 07 12:35:10 2011 -0500
+++ b/src/com/redhat/thermostat/agent/Agent.java	Wed Dec 07 17:41:30 2011 -0500
@@ -5,6 +5,7 @@
 
 import com.redhat.thermostat.agent.config.ConfigurationWatcher;
 import com.redhat.thermostat.agent.config.StartupConfiguration;
+import com.redhat.thermostat.agent.storage.Storage;
 import com.redhat.thermostat.backend.Backend;
 import com.redhat.thermostat.backend.BackendRegistry;
 import com.redhat.thermostat.common.LaunchException;
--- a/src/com/redhat/thermostat/agent/Main.java	Wed Dec 07 12:35:10 2011 -0500
+++ b/src/com/redhat/thermostat/agent/Main.java	Wed Dec 07 17:41:30 2011 -0500
@@ -11,6 +11,8 @@
 import java.util.logging.Logger;
 
 import com.redhat.thermostat.agent.config.StartupConfiguration;
+import com.redhat.thermostat.agent.storage.MongoStorage;
+import com.redhat.thermostat.agent.storage.Storage;
 import com.redhat.thermostat.backend.BackendLoadException;
 import com.redhat.thermostat.backend.BackendRegistry;
 import com.redhat.thermostat.common.Constants;
--- a/src/com/redhat/thermostat/agent/MongoStorage.java	Wed Dec 07 12:35:10 2011 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-package com.redhat.thermostat.agent;
-
-import java.net.UnknownHostException;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.UUID;
-
-import org.bson.BSONObject;
-
-import com.mongodb.BasicDBObject;
-import com.mongodb.DB;
-import com.mongodb.DBCollection;
-import com.mongodb.DBObject;
-import com.mongodb.Mongo;
-import com.mongodb.MongoURI;
-import com.mongodb.WriteConcern;
-import com.redhat.thermostat.agent.config.StartupConfiguration;
-import com.redhat.thermostat.common.Constants;
-import com.redhat.thermostat.common.CpuStat;
-import com.redhat.thermostat.common.HostInfo;
-import com.redhat.thermostat.common.MemoryStat;
-
-public class MongoStorage implements Storage {
-
-    private Mongo mongo = null;
-    private DB db = null;
-
-    private UUID agentId = null;
-
-    @Override
-    public void connect(String uri) throws UnknownHostException {
-        connect(new MongoURI(uri));
-    }
-
-    public void connect(MongoURI uri) throws UnknownHostException {
-        mongo = new Mongo(uri);
-        db = mongo.getDB(StorageConstants.THERMOSTAT_DB);
-    }
-
-    @Override
-    public void setAgentId(UUID agentId) {
-        this.agentId = agentId;
-    }
-
-    @Override
-    public void addAgentInformation(StartupConfiguration config) {
-        DBCollection configCollection = db.getCollection(StorageConstants.COLLECTION_AGENT_CONFIG);
-        DBObject toInsert = config.toDBObject();
-        /* cast required to disambiguate between putAll(BSONObject) and putAll(Map) */
-        toInsert.putAll((BSONObject) getAgentDBObject());
-        configCollection.insert(toInsert, WriteConcern.SAFE);
-    }
-
-    @Override
-    public void removeAgentInformation() {
-        DBCollection configCollection = db.getCollection(StorageConstants.COLLECTION_AGENT_CONFIG);
-        BasicDBObject toRemove = getAgentDBObject();
-        configCollection.remove(toRemove, WriteConcern.NORMAL);
-    }
-
-    @Override
-    public String getBackendConfig(String backendName, String configurationKey) {
-        DBCollection configCollection = db.getCollection(StorageConstants.COLLECTION_AGENT_CONFIG);
-        BasicDBObject query = getAgentDBObject();
-        query.put(StorageConstants.KEY_AGENT_CONFIG_BACKENDS + "." + backendName, new BasicDBObject("$exists", true));
-        DBObject config = configCollection.findOne(query);
-        Object value = config.get(configurationKey);
-        if (value instanceof String) {
-            return (String) value;
-        }
-        return null;
-    }
-
-    private BasicDBObject getAgentDBObject() {
-        return new BasicDBObject(StorageConstants.KEY_AGENT_ID, agentId.toString());
-    }
-
-    @Override
-    public void updateHostInfo(HostInfo hostInfo) {
-        /*
-         * Host Info is determined (completely) on the agent side. No one else
-         * should be touching it. So let's overwrite any changes to it.
-         */
-        DBObject queryForOldObject = getAgentDBObject();
-
-        BasicDBObject toInsert = new BasicDBObject();
-        toInsert.put(StorageConstants.KEY_AGENT_ID, agentId.toString());
-        toInsert.put(StorageConstants.KEY_HOST_INFO_HOSTNAME, hostInfo.getHostname());
-
-        BasicDBObject osParts = new BasicDBObject();
-        osParts.put(StorageConstants.KEY_HOST_INFO_OS_NAME, hostInfo.getOsName());
-        osParts.put(StorageConstants.KEY_HOST_INFO_OS_KERNEL, hostInfo.getOsKernel());
-        toInsert.put(StorageConstants.KEY_HOST_INFO_OS, osParts);
-
-        BasicDBObject cpuParts = new BasicDBObject();
-        cpuParts.put(StorageConstants.KEY_HOST_INFO_CPU_COUNT, hostInfo.getCpuCount());
-        toInsert.put(StorageConstants.KEY_HOST_INFO_CPU, cpuParts);
-
-        BasicDBObject memoryParts = new BasicDBObject();
-        memoryParts.put(StorageConstants.KEY_HOST_INFO_MEMORY_TOTAL, hostInfo.getTotalMemory());
-        toInsert.put(StorageConstants.KEY_HOST_INFO_MEMORY, memoryParts);
-
-        BasicDBObject networkParts = new BasicDBObject();
-        for (Entry<String, List<String>> entry: hostInfo.getNetworkInfo().entrySet()) {
-            BasicDBObject details = new BasicDBObject();
-            details.put(StorageConstants.KEY_HOST_INFO_NETWORK_ADDR_IPV4,
-                    entry.getValue().get(Constants.HOST_INFO_NETWORK_IPV4_INDEX));
-            details.put(StorageConstants.KEY_HOST_INFO_NETWORK_ADDR_IPV6,
-                    entry.getValue().get(Constants.HOST_INFO_NETWORK_IPV6_INDEX));
-            networkParts.put(entry.getKey(), details);
-        }
-        toInsert.put(StorageConstants.KEY_HOST_INFO_NETWORK, networkParts);
-
-        DBCollection hostInfoCollection = db.getCollection(StorageConstants.COLLECTION_HOST_INFO);
-        hostInfoCollection.update(
-                queryForOldObject,
-                toInsert,
-                true,
-                false, /* doesnt matter should only have one object */
-                WriteConcern.NORMAL
-        );
-    }
-
-    @Override
-    public void addCpuStat(CpuStat stat) {
-        DBCollection cpuStatsCollection = db.getCollection(StorageConstants.COLLECTION_CPU_STATS);
-        BasicDBObject toInsert = getAgentDBObject();
-        toInsert.put(StorageConstants.KEY_TIMESTAMP, stat.getTimeStamp());
-        toInsert.put(StorageConstants.KEY_CPU_STATS_LOAD, stat.getLoad());
-        cpuStatsCollection.insert(toInsert, WriteConcern.NORMAL);
-    }
-
-    @Override
-    public void addMemoryStat(MemoryStat stat) {
-        DBCollection memoryStatsCollection = db.getCollection(StorageConstants.COLLECTION_MEMORY_STATS);
-        BasicDBObject toInsert = getAgentDBObject();
-        toInsert.put(StorageConstants.KEY_TIMESTAMP, stat.getTimeStamp());
-        toInsert.put(StorageConstants.KEY_MEMORY_STATS_TOTAL, stat.getTotal());
-        toInsert.put(StorageConstants.KEY_MEMORY_STATS_FREE, stat.getFree());
-        toInsert.put(StorageConstants.KEY_MEMORY_STATS_BUFFERS, stat.getBuffers());
-        toInsert.put(StorageConstants.KEY_MEMORY_STATS_CACHED, stat.getCached());
-        toInsert.put(StorageConstants.KEY_MEMORY_STATS_SWAP_TOTAL, stat.getSwapTotal());
-        toInsert.put(StorageConstants.KEY_MEMORY_STATS_SWAP_FREE, stat.getSwapFree());
-        toInsert.put(StorageConstants.KEY_MEMORY_STATS_COMMIT_LIMIT, stat.getCommitLimit());
-        memoryStatsCollection.insert(toInsert, WriteConcern.NORMAL);
-    }
-}
--- a/src/com/redhat/thermostat/agent/Storage.java	Wed Dec 07 12:35:10 2011 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-package com.redhat.thermostat.agent;
-
-import java.net.UnknownHostException;
-import java.util.UUID;
-
-import com.redhat.thermostat.agent.config.StartupConfiguration;
-import com.redhat.thermostat.common.CpuStat;
-import com.redhat.thermostat.common.HostInfo;
-import com.redhat.thermostat.common.MemoryStat;
-
-public interface Storage {
-    public void connect(String uri) throws UnknownHostException;
-
-    public void setAgentId(UUID id);
-
-    public void addAgentInformation(StartupConfiguration config);
-
-    public void removeAgentInformation();
-
-    public void addCpuStat(CpuStat stat);
-
-    public void addMemoryStat(MemoryStat stat);
-
-    public void updateHostInfo(HostInfo hostInfo);
-
-    /**
-     * @return {@code null} if the value is invalid or missing
-     */
-    public String getBackendConfig(String backendName, String configurationKey);
-
-}
--- a/src/com/redhat/thermostat/agent/StorageConstants.java	Wed Dec 07 12:35:10 2011 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-package com.redhat.thermostat.agent;
-
-public class StorageConstants {
-    public static final String THERMOSTAT_DB = "thermostat";
-
-    public static final String COLLECTION_AGENT_CONFIG = "agent-config";
-    public static final String COLLECTION_HOST_INFO = "host-info";
-    public static final String COLLECTION_CPU_STATS = "cpu-stats";
-    public static final String COLLECTION_MEMORY_STATS = "memory-stats";
-
-    public static final String KEY_AGENT_ID = "agent-id";
-    public static final String KEY_TIMESTAMP = "timestamp";
-
-    public static final String KEY_AGENT_CONFIG_BACKENDS = "backends";
-    public static final String KEY_AGENT_CONFIG_AGENT_START_TIME = "start-time";
-
-    public static final String KEY_HOST_INFO_HOSTNAME = "hostname";
-    public static final String KEY_HOST_INFO_OS = "os";
-    public static final String KEY_HOST_INFO_OS_NAME = "name";
-    public static final String KEY_HOST_INFO_OS_KERNEL = "kernel";
-    public static final String KEY_HOST_INFO_CPU = "cpu";
-    public static final String KEY_HOST_INFO_CPU_COUNT = "num";
-    public static final String KEY_HOST_INFO_MEMORY = "memory";
-    public static final String KEY_HOST_INFO_MEMORY_TOTAL = "total";
-    public static final String KEY_HOST_INFO_NETWORK = "network";
-    public static final String KEY_HOST_INFO_NETWORK_ADDR_IPV4 = "ipv4addr";
-    public static final String KEY_HOST_INFO_NETWORK_ADDR_IPV6 = "ipv6addr";
-
-    public static final String KEY_CPU_STATS_LOAD = "load";
-
-    public static final String KEY_MEMORY_STATS_TOTAL = "total";
-    public static final String KEY_MEMORY_STATS_FREE = "free";
-    public static final String KEY_MEMORY_STATS_BUFFERS = "buffers";
-    public static final String KEY_MEMORY_STATS_CACHED = "cached";
-    public static final String KEY_MEMORY_STATS_SWAP_TOTAL = "swap-total";
-    public static final String KEY_MEMORY_STATS_SWAP_FREE = "swap-free";
-    public static final String KEY_MEMORY_STATS_COMMIT_LIMIT = "commit-limit";
-
-}
--- a/src/com/redhat/thermostat/agent/config/ConfigurationWatcher.java	Wed Dec 07 12:35:10 2011 -0500
+++ b/src/com/redhat/thermostat/agent/config/ConfigurationWatcher.java	Wed Dec 07 17:41:30 2011 -0500
@@ -2,7 +2,7 @@
 
 import java.util.logging.Logger;
 
-import com.redhat.thermostat.agent.Storage;
+import com.redhat.thermostat.agent.storage.Storage;
 import com.redhat.thermostat.common.utils.LoggingUtils;
 
 public class ConfigurationWatcher implements Runnable {
--- a/src/com/redhat/thermostat/agent/config/StartupConfiguration.java	Wed Dec 07 12:35:10 2011 -0500
+++ b/src/com/redhat/thermostat/agent/config/StartupConfiguration.java	Wed Dec 07 17:41:30 2011 -0500
@@ -16,7 +16,7 @@
 import com.mongodb.DBObject;
 import com.redhat.thermostat.agent.Agent;
 import com.redhat.thermostat.agent.Defaults;
-import com.redhat.thermostat.agent.StorageConstants;
+import com.redhat.thermostat.agent.storage.StorageConstants;
 import com.redhat.thermostat.common.Constants;
 import com.redhat.thermostat.common.LaunchException;
 import com.redhat.thermostat.common.utils.LoggingUtils;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/redhat/thermostat/agent/storage/MongoStorage.java	Wed Dec 07 17:41:30 2011 -0500
@@ -0,0 +1,147 @@
+package com.redhat.thermostat.agent.storage;
+
+import java.net.UnknownHostException;
+import java.util.List;
+import java.util.Map.Entry;
+import java.util.UUID;
+
+import org.bson.BSONObject;
+
+import com.mongodb.BasicDBObject;
+import com.mongodb.DB;
+import com.mongodb.DBCollection;
+import com.mongodb.DBObject;
+import com.mongodb.Mongo;
+import com.mongodb.MongoURI;
+import com.mongodb.WriteConcern;
+import com.redhat.thermostat.agent.config.StartupConfiguration;
+import com.redhat.thermostat.common.Constants;
+import com.redhat.thermostat.common.CpuStat;
+import com.redhat.thermostat.common.HostInfo;
+import com.redhat.thermostat.common.MemoryStat;
+
+public class MongoStorage implements Storage {
+
+    private Mongo mongo = null;
+    private DB db = null;
+
+    private UUID agentId = null;
+
+    @Override
+    public void connect(String uri) throws UnknownHostException {
+        connect(new MongoURI(uri));
+    }
+
+    public void connect(MongoURI uri) throws UnknownHostException {
+        mongo = new Mongo(uri);
+        db = mongo.getDB(StorageConstants.THERMOSTAT_DB);
+    }
+
+    @Override
+    public void setAgentId(UUID agentId) {
+        this.agentId = agentId;
+    }
+
+    @Override
+    public void addAgentInformation(StartupConfiguration config) {
+        DBCollection configCollection = db.getCollection(StorageConstants.COLLECTION_AGENT_CONFIG);
+        DBObject toInsert = config.toDBObject();
+        /* cast required to disambiguate between putAll(BSONObject) and putAll(Map) */
+        toInsert.putAll((BSONObject) getAgentDBObject());
+        configCollection.insert(toInsert, WriteConcern.SAFE);
+    }
+
+    @Override
+    public void removeAgentInformation() {
+        DBCollection configCollection = db.getCollection(StorageConstants.COLLECTION_AGENT_CONFIG);
+        BasicDBObject toRemove = getAgentDBObject();
+        configCollection.remove(toRemove, WriteConcern.NORMAL);
+    }
+
+    @Override
+    public String getBackendConfig(String backendName, String configurationKey) {
+        DBCollection configCollection = db.getCollection(StorageConstants.COLLECTION_AGENT_CONFIG);
+        BasicDBObject query = getAgentDBObject();
+        query.put(StorageConstants.KEY_AGENT_CONFIG_BACKENDS + "." + backendName, new BasicDBObject("$exists", true));
+        DBObject config = configCollection.findOne(query);
+        Object value = config.get(configurationKey);
+        if (value instanceof String) {
+            return (String) value;
+        }
+        return null;
+    }
+
+    private BasicDBObject getAgentDBObject() {
+        return new BasicDBObject(StorageConstants.KEY_AGENT_ID, agentId.toString());
+    }
+
+    @Override
+    public void updateHostInfo(HostInfo hostInfo) {
+        /*
+         * Host Info is determined (completely) on the agent side. No one else
+         * should be touching it. So let's overwrite any changes to it.
+         */
+        DBObject queryForOldObject = getAgentDBObject();
+
+        BasicDBObject toInsert = new BasicDBObject();
+        toInsert.put(StorageConstants.KEY_AGENT_ID, agentId.toString());
+        toInsert.put(StorageConstants.KEY_HOST_INFO_HOSTNAME, hostInfo.getHostname());
+
+        BasicDBObject osParts = new BasicDBObject();
+        osParts.put(StorageConstants.KEY_HOST_INFO_OS_NAME, hostInfo.getOsName());
+        osParts.put(StorageConstants.KEY_HOST_INFO_OS_KERNEL, hostInfo.getOsKernel());
+        toInsert.put(StorageConstants.KEY_HOST_INFO_OS, osParts);
+
+        BasicDBObject cpuParts = new BasicDBObject();
+        cpuParts.put(StorageConstants.KEY_HOST_INFO_CPU_COUNT, hostInfo.getCpuCount());
+        toInsert.put(StorageConstants.KEY_HOST_INFO_CPU, cpuParts);
+
+        BasicDBObject memoryParts = new BasicDBObject();
+        memoryParts.put(StorageConstants.KEY_HOST_INFO_MEMORY_TOTAL, hostInfo.getTotalMemory());
+        toInsert.put(StorageConstants.KEY_HOST_INFO_MEMORY, memoryParts);
+
+        BasicDBObject networkParts = new BasicDBObject();
+        for (Entry<String, List<String>> entry: hostInfo.getNetworkInfo().entrySet()) {
+            BasicDBObject details = new BasicDBObject();
+            details.put(StorageConstants.KEY_HOST_INFO_NETWORK_ADDR_IPV4,
+                    entry.getValue().get(Constants.HOST_INFO_NETWORK_IPV4_INDEX));
+            details.put(StorageConstants.KEY_HOST_INFO_NETWORK_ADDR_IPV6,
+                    entry.getValue().get(Constants.HOST_INFO_NETWORK_IPV6_INDEX));
+            networkParts.put(entry.getKey(), details);
+        }
+        toInsert.put(StorageConstants.KEY_HOST_INFO_NETWORK, networkParts);
+
+        DBCollection hostInfoCollection = db.getCollection(StorageConstants.COLLECTION_HOST_INFO);
+        hostInfoCollection.update(
+                queryForOldObject,
+                toInsert,
+                true,
+                false, /* doesnt matter should only have one object */
+                WriteConcern.NORMAL
+        );
+    }
+
+    @Override
+    public void addCpuStat(CpuStat stat) {
+        DBCollection cpuStatsCollection = db.getCollection(StorageConstants.COLLECTION_CPU_STATS);
+        BasicDBObject toInsert = getAgentDBObject();
+        toInsert.put(StorageConstants.KEY_TIMESTAMP, stat.getTimeStamp());
+        toInsert.put(StorageConstants.KEY_CPU_STATS_LOAD, stat.getLoad());
+        cpuStatsCollection.insert(toInsert, WriteConcern.NORMAL);
+    }
+
+    @Override
+    public void addMemoryStat(MemoryStat stat) {
+        DBCollection memoryStatsCollection = db.getCollection(StorageConstants.COLLECTION_MEMORY_STATS);
+        BasicDBObject toInsert = getAgentDBObject();
+        toInsert.put(StorageConstants.KEY_TIMESTAMP, stat.getTimeStamp());
+        toInsert.put(StorageConstants.KEY_MEMORY_STATS_TOTAL, stat.getTotal());
+        toInsert.put(StorageConstants.KEY_MEMORY_STATS_FREE, stat.getFree());
+        toInsert.put(StorageConstants.KEY_MEMORY_STATS_BUFFERS, stat.getBuffers());
+        toInsert.put(StorageConstants.KEY_MEMORY_STATS_CACHED, stat.getCached());
+        toInsert.put(StorageConstants.KEY_MEMORY_STATS_SWAP_TOTAL, stat.getSwapTotal());
+        toInsert.put(StorageConstants.KEY_MEMORY_STATS_SWAP_FREE, stat.getSwapFree());
+        toInsert.put(StorageConstants.KEY_MEMORY_STATS_COMMIT_LIMIT, stat.getCommitLimit());
+        memoryStatsCollection.insert(toInsert, WriteConcern.NORMAL);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/redhat/thermostat/agent/storage/Storage.java	Wed Dec 07 17:41:30 2011 -0500
@@ -0,0 +1,31 @@
+package com.redhat.thermostat.agent.storage;
+
+import java.net.UnknownHostException;
+import java.util.UUID;
+
+import com.redhat.thermostat.agent.config.StartupConfiguration;
+import com.redhat.thermostat.common.CpuStat;
+import com.redhat.thermostat.common.HostInfo;
+import com.redhat.thermostat.common.MemoryStat;
+
+public interface Storage {
+    public void connect(String uri) throws UnknownHostException;
+
+    public void setAgentId(UUID id);
+
+    public void addAgentInformation(StartupConfiguration config);
+
+    public void removeAgentInformation();
+
+    public void addCpuStat(CpuStat stat);
+
+    public void addMemoryStat(MemoryStat stat);
+
+    public void updateHostInfo(HostInfo hostInfo);
+
+    /**
+     * @return {@code null} if the value is invalid or missing
+     */
+    public String getBackendConfig(String backendName, String configurationKey);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/redhat/thermostat/agent/storage/StorageConstants.java	Wed Dec 07 17:41:30 2011 -0500
@@ -0,0 +1,39 @@
+package com.redhat.thermostat.agent.storage;
+
+public class StorageConstants {
+    public static final String THERMOSTAT_DB = "thermostat";
+
+    public static final String COLLECTION_AGENT_CONFIG = "agent-config";
+    public static final String COLLECTION_HOST_INFO = "host-info";
+    public static final String COLLECTION_CPU_STATS = "cpu-stats";
+    public static final String COLLECTION_MEMORY_STATS = "memory-stats";
+
+    public static final String KEY_AGENT_ID = "agent-id";
+    public static final String KEY_TIMESTAMP = "timestamp";
+
+    public static final String KEY_AGENT_CONFIG_BACKENDS = "backends";
+    public static final String KEY_AGENT_CONFIG_AGENT_START_TIME = "start-time";
+
+    public static final String KEY_HOST_INFO_HOSTNAME = "hostname";
+    public static final String KEY_HOST_INFO_OS = "os";
+    public static final String KEY_HOST_INFO_OS_NAME = "name";
+    public static final String KEY_HOST_INFO_OS_KERNEL = "kernel";
+    public static final String KEY_HOST_INFO_CPU = "cpu";
+    public static final String KEY_HOST_INFO_CPU_COUNT = "num";
+    public static final String KEY_HOST_INFO_MEMORY = "memory";
+    public static final String KEY_HOST_INFO_MEMORY_TOTAL = "total";
+    public static final String KEY_HOST_INFO_NETWORK = "network";
+    public static final String KEY_HOST_INFO_NETWORK_ADDR_IPV4 = "ipv4addr";
+    public static final String KEY_HOST_INFO_NETWORK_ADDR_IPV6 = "ipv6addr";
+
+    public static final String KEY_CPU_STATS_LOAD = "load";
+
+    public static final String KEY_MEMORY_STATS_TOTAL = "total";
+    public static final String KEY_MEMORY_STATS_FREE = "free";
+    public static final String KEY_MEMORY_STATS_BUFFERS = "buffers";
+    public static final String KEY_MEMORY_STATS_CACHED = "cached";
+    public static final String KEY_MEMORY_STATS_SWAP_TOTAL = "swap-total";
+    public static final String KEY_MEMORY_STATS_SWAP_FREE = "swap-free";
+    public static final String KEY_MEMORY_STATS_COMMIT_LIMIT = "commit-limit";
+
+}
--- a/src/com/redhat/thermostat/backend/Backend.java	Wed Dec 07 12:35:10 2011 -0500
+++ b/src/com/redhat/thermostat/backend/Backend.java	Wed Dec 07 17:41:30 2011 -0500
@@ -3,7 +3,7 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
-import com.redhat.thermostat.agent.Storage;
+import com.redhat.thermostat.agent.storage.Storage;
 
 /**
  * Represents a monitoring back-end. All the {@link Backend}s should be
--- a/src/com/redhat/thermostat/backend/BackendRegistry.java	Wed Dec 07 12:35:10 2011 -0500
+++ b/src/com/redhat/thermostat/backend/BackendRegistry.java	Wed Dec 07 17:41:30 2011 -0500
@@ -7,7 +7,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import com.redhat.thermostat.agent.Storage;
+import com.redhat.thermostat.agent.storage.Storage;
 import com.redhat.thermostat.agent.config.StartupConfiguration;
 import com.redhat.thermostat.backend.system.SystemBackend;
 import com.redhat.thermostat.common.utils.LoggingUtils;