# HG changeset patch # User Omair Majid # Date 1385424121 18000 # Node ID 07becc24f34d03f6e99e021ba73e717159d7b35b # Parent ad1f6b074c0c463855b7cbe02bca6697608daeea Rename c.r.t.utils.hostname to c.r.t.agent.utils.hostname Reviewed-by: vanaltj Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-November/008945.html diff -r ad1f6b074c0c -r 07becc24f34d README.api --- a/README.api Mon Nov 25 19:01:03 2013 -0500 +++ b/README.api Mon Nov 25 19:02:01 2013 -0500 @@ -7,6 +7,7 @@ - com.redhat.thermostat.agent.command - com.redhat.thermostat.agent.config - com.redhat.thermostat.agent.utils + - com.redhat.thermostat.agent.utils.hostname - com.redhat.thermostat.annotations - com.redhat.thermostat.backend - com.redhat.thermostat.client.cli @@ -39,7 +40,6 @@ - com.redhat.thermostat.storage.model - com.redhat.thermostat.storage.monitor - com.redhat.thermostat.storage.query - - com.redhat.thermostat.utils.hostname - com.redhat.thermostat.utils.keyring - com.redhat.thermostat.utils.management - com.redhat.thermostat.utils.username diff -r ad1f6b074c0c -r 07becc24f34d agent/core/Makefile --- a/agent/core/Makefile Mon Nov 25 19:01:03 2013 -0500 +++ b/agent/core/Makefile Mon Nov 25 19:02:01 2013 -0500 @@ -21,7 +21,7 @@ USERNAME_EXECUTABLE = libUserNameUtilWrapper.so .PHONY: -JNI_LIST = com.redhat.thermostat.utils.hostname.HostName\ +JNI_LIST = com.redhat.thermostat.agent.utils.hostname.HostName\ com.redhat.thermostat.utils.username.internal.UserNameUtilImpl $(JNI_LIST): diff -r ad1f6b074c0c -r 07becc24f34d agent/core/pom.xml --- a/agent/core/pom.xml Mon Nov 25 19:01:03 2013 -0500 +++ b/agent/core/pom.xml Mon Nov 25 19:02:01 2013 -0500 @@ -126,8 +126,8 @@ com.redhat.thermostat.agent, com.redhat.thermostat.agent.config, com.redhat.thermostat.agent.utils, + com.redhat.thermostat.agent.utils.hostname, com.redhat.thermostat.backend, - com.redhat.thermostat.utils.hostname, com.redhat.thermostat.utils.management, com.redhat.thermostat.utils.username, diff -r ad1f6b074c0c -r 07becc24f34d agent/core/src/main/java/com/redhat/thermostat/agent/utils/hostname/HostName.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent/core/src/main/java/com/redhat/thermostat/agent/utils/hostname/HostName.java Mon Nov 25 19:02:01 2013 -0500 @@ -0,0 +1,57 @@ +/* + * Copyright 2012, 2013 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 + * . + * + * 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.utils.hostname; + +import com.redhat.thermostat.shared.config.NativeLibraryResolver; + +/** + * Finds the current host name without doing a DNS lookup + */ +public class HostName { + + static { + String lib = NativeLibraryResolver.getAbsoluteLibraryPath("HostNameWrapper"); + System.load(lib); + } + + public static String getLocalHostName() { + return getHostName(); + } + + private static native String getHostName(); +} + diff -r ad1f6b074c0c -r 07becc24f34d agent/core/src/main/java/com/redhat/thermostat/utils/hostname/HostName.java --- a/agent/core/src/main/java/com/redhat/thermostat/utils/hostname/HostName.java Mon Nov 25 19:01:03 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright 2012, 2013 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 - * . - * - * 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.utils.hostname; - -import com.redhat.thermostat.shared.config.NativeLibraryResolver; - -/** - * Finds the current host name without doing a DNS lookup - */ -public class HostName { - - static { - String lib = NativeLibraryResolver.getAbsoluteLibraryPath("HostNameWrapper"); - System.load(lib); - } - - public static String getLocalHostName() { - return getHostName(); - } - - private static native String getHostName(); -} - diff -r ad1f6b074c0c -r 07becc24f34d agent/core/src/main/native/HostName.c --- a/agent/core/src/main/native/HostName.c Mon Nov 25 19:01:03 2013 -0500 +++ b/agent/core/src/main/native/HostName.c Mon Nov 25 19:02:01 2013 -0500 @@ -34,7 +34,7 @@ * to do so, delete this exception statement from your version. */ -#include "com_redhat_thermostat_utils_hostname_HostName.h" +#include "com_redhat_thermostat_agent_utils_hostname_HostName.h" #include #include @@ -47,7 +47,7 @@ #endif /* NI_MAXHOST */ JNIEXPORT jstring JNICALL -Java_com_redhat_thermostat_utils_hostname_HostName_getHostName +Java_com_redhat_thermostat_agent_utils_hostname_HostName_getHostName (JNIEnv *env, jclass HostNameClass) { char hostname[NI_MAXHOST]; diff -r ad1f6b074c0c -r 07becc24f34d system-backend/src/main/java/com/redhat/thermostat/backend/system/HostInfoBuilder.java --- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/HostInfoBuilder.java Mon Nov 25 19:01:03 2013 -0500 +++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/HostInfoBuilder.java Mon Nov 25 19:02:01 2013 -0500 @@ -44,12 +44,12 @@ import java.util.logging.Logger; import com.redhat.thermostat.agent.utils.ProcDataSource; +import com.redhat.thermostat.agent.utils.hostname.HostName; import com.redhat.thermostat.common.Size; import com.redhat.thermostat.common.Size.Unit; import com.redhat.thermostat.common.utils.LoggingUtils; import com.redhat.thermostat.storage.core.WriterID; import com.redhat.thermostat.storage.model.HostInfo; -import com.redhat.thermostat.utils.hostname.HostName; public class HostInfoBuilder {