# HG changeset patch # User Omair Majid # Date 1385424234 18000 # Node ID d532e4b839c3eb0b48077e70a2e196ff4dc42f2e # Parent b1f82879e6a9322c491faaca7c0c0ab52868e877 Rename c.r.t.utils.username to c.r.t.agent.utils.username Reviewed-by: vanaltj Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-November/008945.html diff -r b1f82879e6a9 -r d532e4b839c3 README.api --- a/README.api Mon Nov 25 19:03:29 2013 -0500 +++ b/README.api Mon Nov 25 19:03:54 2013 -0500 @@ -9,6 +9,7 @@ - com.redhat.thermostat.agent.utils - com.redhat.thermostat.agent.utils.hostname - com.redhat.thermostat.agent.utils.management + - com.redhat.thermostat.agent.utils.username - com.redhat.thermostat.annotations - com.redhat.thermostat.backend - com.redhat.thermostat.client.cli @@ -42,7 +43,6 @@ - com.redhat.thermostat.storage.monitor - com.redhat.thermostat.storage.query - com.redhat.thermostat.utils.keyring - - com.redhat.thermostat.utils.username diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/pom.xml --- a/agent/core/pom.xml Mon Nov 25 19:03:29 2013 -0500 +++ b/agent/core/pom.xml Mon Nov 25 19:03:54 2013 -0500 @@ -128,8 +128,8 @@ com.redhat.thermostat.agent.utils, com.redhat.thermostat.agent.utils.hostname, com.redhat.thermostat.agent.utils.management, + com.redhat.thermostat.agent.utils.username, com.redhat.thermostat.backend, - com.redhat.thermostat.utils.username, com.redhat.thermostat.agent.internal, diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/src/main/java/com/redhat/thermostat/agent/internal/Activator.java --- a/agent/core/src/main/java/com/redhat/thermostat/agent/internal/Activator.java Mon Nov 25 19:03:29 2013 -0500 +++ b/agent/core/src/main/java/com/redhat/thermostat/agent/internal/Activator.java Mon Nov 25 19:03:54 2013 -0500 @@ -44,10 +44,10 @@ import com.redhat.thermostat.agent.VmBlacklist; import com.redhat.thermostat.agent.config.AgentConfigsUtils; import com.redhat.thermostat.agent.utils.management.MXBeanConnectionPool; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.shared.config.CommonPaths; import com.redhat.thermostat.utils.management.internal.AgentProxyFilter; import com.redhat.thermostat.utils.management.internal.MXBeanConnectionPoolImpl; -import com.redhat.thermostat.utils.username.UserNameUtil; import com.redhat.thermostat.utils.username.internal.UserNameUtilImpl; public class Activator implements BundleActivator { diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/src/main/java/com/redhat/thermostat/agent/utils/username/UserNameLookupException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent/core/src/main/java/com/redhat/thermostat/agent/utils/username/UserNameLookupException.java Mon Nov 25 19:03:54 2013 -0500 @@ -0,0 +1,51 @@ +/* + * 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.username; + +/** + * + * Thrown on user name lookup error. + * + * @see UserNameUtil + */ +@SuppressWarnings("serial") +public class UserNameLookupException extends Exception { + + public UserNameLookupException(Throwable cause) { + super(cause); + } +} diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/src/main/java/com/redhat/thermostat/agent/utils/username/UserNameUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/agent/core/src/main/java/com/redhat/thermostat/agent/utils/username/UserNameUtil.java Mon Nov 25 19:03:54 2013 -0500 @@ -0,0 +1,55 @@ +/* + * 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.username; + +/** + * Utility to query the operating system for a user name. + */ +public interface UserNameUtil { + + /** + * Gets the user name corresponding to the provided UID. + * + * @param uid + * The UID whose name to return. + * @throws UserNameLookupException + * If an error occurred during retrieval of the user name. + * @return The user name if found. null if no such UID exists. + */ + String getUserName(long uid) throws UserNameLookupException; + +} diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/src/main/java/com/redhat/thermostat/utils/username/UserNameLookupException.java --- a/agent/core/src/main/java/com/redhat/thermostat/utils/username/UserNameLookupException.java Mon Nov 25 19:03:29 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +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.username; - -/** - * - * Thrown on user name lookup error. - * - * @see UserNameUtil - */ -@SuppressWarnings("serial") -public class UserNameLookupException extends Exception { - - public UserNameLookupException(Throwable cause) { - super(cause); - } -} diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/src/main/java/com/redhat/thermostat/utils/username/UserNameUtil.java --- a/agent/core/src/main/java/com/redhat/thermostat/utils/username/UserNameUtil.java Mon Nov 25 19:03:29 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +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.username; - -/** - * Utility to query the operating system for a user name. - */ -public interface UserNameUtil { - - /** - * Gets the user name corresponding to the provided UID. - * - * @param uid - * The UID whose name to return. - * @throws UserNameLookupException - * If an error occurred during retrieval of the user name. - * @return The user name if found. null if no such UID exists. - */ - String getUserName(long uid) throws UserNameLookupException; - -} diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/src/main/java/com/redhat/thermostat/utils/username/internal/UserNameUtilImpl.java --- a/agent/core/src/main/java/com/redhat/thermostat/utils/username/internal/UserNameUtilImpl.java Mon Nov 25 19:03:29 2013 -0500 +++ b/agent/core/src/main/java/com/redhat/thermostat/utils/username/internal/UserNameUtilImpl.java Mon Nov 25 19:03:54 2013 -0500 @@ -38,9 +38,9 @@ import java.io.IOException; -import com.redhat.thermostat.utils.username.UserNameLookupException; +import com.redhat.thermostat.agent.utils.username.UserNameLookupException; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.shared.config.NativeLibraryResolver; -import com.redhat.thermostat.utils.username.UserNameUtil; public class UserNameUtilImpl implements UserNameUtil { diff -r b1f82879e6a9 -r d532e4b839c3 agent/core/src/test/java/com/redhat/thermostat/agent/internal/ActivatorTest.java --- a/agent/core/src/test/java/com/redhat/thermostat/agent/internal/ActivatorTest.java Mon Nov 25 19:03:29 2013 -0500 +++ b/agent/core/src/test/java/com/redhat/thermostat/agent/internal/ActivatorTest.java Mon Nov 25 19:03:54 2013 -0500 @@ -48,11 +48,11 @@ import com.redhat.thermostat.agent.RMIRegistry; import com.redhat.thermostat.agent.VmBlacklist; import com.redhat.thermostat.agent.utils.management.MXBeanConnectionPool; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.shared.config.CommonPaths; import com.redhat.thermostat.shared.config.NativeLibraryResolver; import com.redhat.thermostat.testutils.StubBundleContext; import com.redhat.thermostat.utils.management.internal.MXBeanConnectionPoolImpl; -import com.redhat.thermostat.utils.username.UserNameUtil; import com.redhat.thermostat.utils.username.internal.UserNameUtilImpl; public class ActivatorTest { diff -r b1f82879e6a9 -r d532e4b839c3 system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilder.java --- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilder.java Mon Nov 25 19:03:29 2013 -0500 +++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilder.java Mon Nov 25 19:03:54 2013 -0500 @@ -43,9 +43,9 @@ import java.util.logging.Logger; import com.redhat.thermostat.agent.utils.ProcDataSource; +import com.redhat.thermostat.agent.utils.username.UserNameLookupException; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.common.utils.LoggingUtils; -import com.redhat.thermostat.utils.username.UserNameLookupException; -import com.redhat.thermostat.utils.username.UserNameUtil; class ProcessUserInfoBuilder { diff -r b1f82879e6a9 -r d532e4b839c3 system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java --- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java Mon Nov 25 19:03:29 2013 -0500 +++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/SystemBackend.java Mon Nov 25 19:03:54 2013 -0500 @@ -48,6 +48,7 @@ import com.redhat.thermostat.agent.VmBlacklist; import com.redhat.thermostat.agent.utils.ProcDataSource; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.backend.BaseBackend; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.common.utils.LoggingUtils; @@ -58,7 +59,6 @@ import com.redhat.thermostat.storage.dao.VmInfoDAO; import com.redhat.thermostat.storage.model.HostInfo; import com.redhat.thermostat.storage.model.NetworkInterfaceInfo; -import com.redhat.thermostat.utils.username.UserNameUtil; public class SystemBackend extends BaseBackend { diff -r b1f82879e6a9 -r d532e4b839c3 system-backend/src/main/java/com/redhat/thermostat/backend/system/osgi/SystemBackendActivator.java --- a/system-backend/src/main/java/com/redhat/thermostat/backend/system/osgi/SystemBackendActivator.java Mon Nov 25 19:03:29 2013 -0500 +++ b/system-backend/src/main/java/com/redhat/thermostat/backend/system/osgi/SystemBackendActivator.java Mon Nov 25 19:03:54 2013 -0500 @@ -43,6 +43,7 @@ import org.osgi.framework.ServiceRegistration; import com.redhat.thermostat.agent.VmBlacklist; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.backend.Backend; import com.redhat.thermostat.backend.BackendService; import com.redhat.thermostat.backend.system.SystemBackend; @@ -54,7 +55,6 @@ import com.redhat.thermostat.storage.dao.HostInfoDAO; import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO; import com.redhat.thermostat.storage.dao.VmInfoDAO; -import com.redhat.thermostat.utils.username.UserNameUtil; @SuppressWarnings("rawtypes") public class SystemBackendActivator implements BundleActivator { diff -r b1f82879e6a9 -r d532e4b839c3 system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilderTest.java --- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilderTest.java Mon Nov 25 19:03:29 2013 -0500 +++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/ProcessUserInfoBuilderTest.java Mon Nov 25 19:03:54 2013 -0500 @@ -47,10 +47,10 @@ import org.junit.Test; import com.redhat.thermostat.agent.utils.ProcDataSource; +import com.redhat.thermostat.agent.utils.username.UserNameLookupException; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.backend.system.ProcessUserInfoBuilder.ProcessUserInfo; import com.redhat.thermostat.common.tools.ApplicationException; -import com.redhat.thermostat.utils.username.UserNameLookupException; -import com.redhat.thermostat.utils.username.UserNameUtil; public class ProcessUserInfoBuilderTest { diff -r b1f82879e6a9 -r d532e4b839c3 system-backend/src/test/java/com/redhat/thermostat/backend/system/SystemBackendTest.java --- a/system-backend/src/test/java/com/redhat/thermostat/backend/system/SystemBackendTest.java Mon Nov 25 19:03:29 2013 -0500 +++ b/system-backend/src/test/java/com/redhat/thermostat/backend/system/SystemBackendTest.java Mon Nov 25 19:03:54 2013 -0500 @@ -46,12 +46,12 @@ import org.junit.Test; import com.redhat.thermostat.agent.VmBlacklist; +import com.redhat.thermostat.agent.utils.username.UserNameUtil; import com.redhat.thermostat.common.Version; import com.redhat.thermostat.storage.core.WriterID; import com.redhat.thermostat.storage.dao.HostInfoDAO; import com.redhat.thermostat.storage.dao.NetworkInterfaceInfoDAO; import com.redhat.thermostat.storage.dao.VmInfoDAO; -import com.redhat.thermostat.utils.username.UserNameUtil; public class SystemBackendTest {