Mercurial > hg > release > thermostat-0.9
changeset 72:977911dfde32
Fixes cross dependency between client and agent by moving StorageConstants class to common.
author | Roman Kennke <rkennke@redhat.com> |
---|---|
date | Thu, 09 Feb 2012 17:21:46 +0100 |
parents | ed6a8a2f5257 |
children | b024cd568e5f |
files | agent/src/main/java/com/redhat/thermostat/agent/storage/MongoStorage.java agent/src/main/java/com/redhat/thermostat/agent/storage/StorageConstants.java client/pom.xml client/src/main/java/com/redhat/thermostat/client/MongoConnection.java common/src/main/java/com/redhat/thermostat/common/storage/StorageConstants.java |
diffstat | 5 files changed, 53 insertions(+), 59 deletions(-) [+] |
line wrap: on
line diff
--- a/agent/src/main/java/com/redhat/thermostat/agent/storage/MongoStorage.java Fri Feb 10 10:29:23 2012 +0100 +++ b/agent/src/main/java/com/redhat/thermostat/agent/storage/MongoStorage.java Thu Feb 09 17:21:46 2012 +0100 @@ -56,6 +56,7 @@ import com.redhat.thermostat.agent.config.StartupConfiguration; import com.redhat.thermostat.backend.Backend; import com.redhat.thermostat.backend.BackendRegistry; +import com.redhat.thermostat.common.storage.StorageConstants; import com.redhat.thermostat.common.utils.LoggingUtils; /**
--- a/agent/src/main/java/com/redhat/thermostat/agent/storage/StorageConstants.java Fri Feb 10 10:29:23 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright 2012 Red Hat, Inc. - * - * This file is part of Thermostat. - * - * Thermostat is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published - * by the Free Software Foundation; either version 2, or (at your - * option) any later version. - * - * Thermostat is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Thermostat; see the file COPYING. If not see - * <http://www.gnu.org/licenses/>. - * - * Linking this code with other modules is making a combined work - * based on this code. Thus, the terms and conditions of the GNU - * General Public License cover the whole combination. - * - * As a special exception, the copyright holders of this code give - * you permission to link this code with independent modules to - * produce an executable, regardless of the license terms of these - * independent modules, and to copy and distribute the resulting - * executable under terms of your choice, provided that you also - * meet, for each linked independent module, the terms and conditions - * of the license of that module. An independent module is a module - * which is not derived from or based on this code. If you modify - * this code, you may extend this exception to your version of the - * library, but you are not obligated to do so. If you do not wish - * to do so, delete this exception statement from your version. - */ - -package com.redhat.thermostat.agent.storage; - -public class StorageConstants { - public static final String THERMOSTAT_DB_NAME = "thermostat"; - - public static final String CATEGORY_AGENT_CONFIG = "agent-config"; - - 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_AGENT_CONFIG_BACKEND_NAME = "name"; - public static final String KEY_AGENT_CONFIG_BACKEND_DESC = "description"; - public static final String KEY_AGENT_CONFIG_BACKEND_ACTIVE = "active"; - public static final String KEY_AGENT_CONFIG_BACKEND_NEW = "new"; - public static final String KEY_AGENT_CONFIG_BACKEND_PIDS = "pids"; -}
--- a/client/pom.xml Fri Feb 10 10:29:23 2012 +0100 +++ b/client/pom.xml Thu Feb 09 17:21:46 2012 +0100 @@ -63,12 +63,6 @@ <artifactId>thermostat-common</artifactId> <version>${project.version}</version> </dependency> - <!-- TODO: Should the dependency to agent/storage go to common? --> - <dependency> - <groupId>com.redhat.thermostat</groupId> - <artifactId>thermostat-agent</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.jfree</groupId> <artifactId>jfreechart</artifactId>
--- a/client/src/main/java/com/redhat/thermostat/client/MongoConnection.java Fri Feb 10 10:29:23 2012 +0100 +++ b/client/src/main/java/com/redhat/thermostat/client/MongoConnection.java Thu Feb 09 17:21:46 2012 +0100 @@ -40,16 +40,15 @@ import java.io.OutputStream; import java.net.UnknownHostException; import java.util.Properties; -import java.util.logging.Level; import java.util.logging.Logger; import com.mongodb.DB; import com.mongodb.Mongo; import com.mongodb.MongoException; import com.mongodb.MongoURI; -import com.redhat.thermostat.agent.storage.StorageConstants; import com.redhat.thermostat.common.Constants; import com.redhat.thermostat.common.NotImplementedException; +import com.redhat.thermostat.common.storage.StorageConstants; import com.redhat.thermostat.common.utils.LoggingUtils; public class MongoConnection extends Connection {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/src/main/java/com/redhat/thermostat/common/storage/StorageConstants.java Thu Feb 09 17:21:46 2012 +0100 @@ -0,0 +1,51 @@ +/* + * Copyright 2012 Red Hat, Inc. + * + * This file is part of Thermostat. + * + * Thermostat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * Thermostat is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Thermostat; see the file COPYING. If not see + * <http://www.gnu.org/licenses/>. + * + * Linking this code with other modules is making a combined work + * based on this code. Thus, the terms and conditions of the GNU + * General Public License cover the whole combination. + * + * As a special exception, the copyright holders of this code give + * you permission to link this code with independent modules to + * produce an executable, regardless of the license terms of these + * independent modules, and to copy and distribute the resulting + * executable under terms of your choice, provided that you also + * meet, for each linked independent module, the terms and conditions + * of the license of that module. An independent module is a module + * which is not derived from or based on this code. If you modify + * this code, you may extend this exception to your version of the + * library, but you are not obligated to do so. If you do not wish + * to do so, delete this exception statement from your version. + */ + +package com.redhat.thermostat.common.storage; + +public class StorageConstants { + public static final String THERMOSTAT_DB_NAME = "thermostat"; + + public static final String CATEGORY_AGENT_CONFIG = "agent-config"; + + 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_AGENT_CONFIG_BACKEND_NAME = "name"; + public static final String KEY_AGENT_CONFIG_BACKEND_DESC = "description"; + public static final String KEY_AGENT_CONFIG_BACKEND_ACTIVE = "active"; + public static final String KEY_AGENT_CONFIG_BACKEND_NEW = "new"; + public static final String KEY_AGENT_CONFIG_BACKEND_PIDS = "pids"; +}