diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java index 46b9f6d32918b3a6f562f7ccb1d6474cdceee7d1..7bab9dbe45f5bd85717c0c209b39732a86ed16dc 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/EnvironmentLoaderListener.java @@ -29,7 +29,10 @@ import kieker.common.logging.LogFactory; * * The only environment property which is currently set by this listener is the property for the web application logger. This makes sure that later created analyses * use the correct logger, whose messages can be intercepted by this application. If this environment property is not set, the log entries of the analyses cannot be - * shown in the corresponding control panel. + * shown in the corresponding control panel.<br> + * </br> + * + * As this class is used by the servlet container, it is <b>not</b> recommended to use or access it in any way. * * @author Nils Christian Ehmke */ @@ -57,7 +60,7 @@ public final class EnvironmentLoaderListener implements ServletContextListener { LOG.info("Starting Kieker.WebGUI environment initialization."); final long timeIn = System.currentTimeMillis(); - System.setProperty("kieker.common.logging.Log", "WEBGUI"); + this.initializeProperties(); final long timeOut = System.currentTimeMillis(); final long timeDelta = timeOut - timeIn; @@ -65,4 +68,8 @@ public final class EnvironmentLoaderListener implements ServletContextListener { LOG.info(String.format("Kieker.WebGUI environment initialized in %d ms.", timeDelta)); } + private void initializeProperties() { + System.setProperty("kieker.common.logging.Log", "WEBGUI"); + } + } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/DisplayType.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/DisplayType.java index d63f2db3f8ebef227085e4cd0a1eeb2e5a21c22b..bfd1fb878c333f1af08ef46e7c36e6f9af6d05e2 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/DisplayType.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/DisplayType.java @@ -37,5 +37,6 @@ public enum DisplayType { METER_GAUGE, /** Represents the tag cloud display type. */ TAG_CLOUD, + /** Represents an unknown display type. This field is necessary in order to avoid null values and resulting exceptions. */ UNKNOWN } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java index e09f6195aa0e9cf3e4b79b873b41d62b2b9f113d..809e29669ddd4d626de0381485951d083f55e5f9 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAOImpl.java @@ -39,8 +39,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; /** - * This service uses Apache Derby to persist and manage the available users. A transaction manager makes sure that all operations are atomically. The connection to - * the data base, the actual data source, and the transaction manager are managed by the Spring framework. + * This service uses Apache Derby to persist and manage the available users. A transaction manager makes sure that all operations are atomically performed. The + * connection to the data base, the actual data source, and the transaction manager are managed by the Spring framework. The configuration can be found in the file + * {@code spring-database-config.xml}. * * @author Nils Christian Ehmke */ @@ -49,6 +50,10 @@ public final class DerbyUserDAOImpl implements IUserDAO { private static final Log LOG = LogFactory.getLog(DerbyUserDAOImpl.class); + /** + * We use this state to determine that a transaction failed due to a duplicate key. The class containing this constant is unfortunately not packed in the Apache + * Derby jar. + */ private static final String SQL_STATE_DUPLICATE_KEY = "23505"; @Autowired @@ -82,17 +87,17 @@ public final class DerbyUserDAOImpl implements IUserDAO { } catch (final SQLException ex) { // Check whether the execution failed due to a duplicate key if (SQL_STATE_DUPLICATE_KEY.equals(ex.getSQLState())) { - throw new UserAlreadyExistingException("A user with the given name exists already.", ex); + throw new UserAlreadyExistingException("A user with the given name exists already", ex); } - // Something else went wrong. - throw new DataAccessException("Could not add user to the database.", ex); + // Something else went wrong + throw new DataAccessException("Could not add user to the database", ex); } finally { - // Try to close the statement. If this is not possible then log the problem. It is not necessary to inform the calling method about a fail though. + // Try to close the statement. If this is not possible, then log the problem. It is not necessary to inform the calling method about a fail though. if (statement != null) { try { statement.close(); } catch (final SQLException ex) { - LOG.error("Could not close prepared statement.", ex); + LOG.error("Could not close prepared statement", ex); } } } @@ -112,14 +117,14 @@ public final class DerbyUserDAOImpl implements IUserDAO { statement.execute(); } catch (final SQLException ex) { // Something went wrong. Inform the calling method. - throw new DataAccessException("Could not delete user from the database.", ex); + throw new DataAccessException("Could not delete user from the database", ex); } finally { - // Try to close the statement. If this is not possible then log the problem. It is not necessary to inform the calling method about a fail though. + // Try to close the statement. If this is not possible, then log the problem. It is not necessary to inform the calling method about a fail though. if (statement != null) { try { statement.close(); } catch (final SQLException ex) { - LOG.error("Could not close prepared statement.", ex); + LOG.error("Could not close prepared statement", ex); } } } @@ -152,14 +157,14 @@ public final class DerbyUserDAOImpl implements IUserDAO { statement.execute(); } catch (final SQLException ex) { - throw new DataAccessException("Could not edit user within the database.", ex); + throw new DataAccessException("Could not modify user within the database", ex); } finally { - // Try to close the statement. If this is not possible then log the problem. It is not necessary to inform the calling method about a fail though. + // Try to close the statement. If this is not possible, then log the problem. It is not necessary to inform the calling method about a fail though. if (statement != null) { try { statement.close(); } catch (final SQLException ex) { - LOG.error("Could not close prepared statement.", ex); + LOG.error("Could not close prepared statement", ex); } } } @@ -182,21 +187,21 @@ public final class DerbyUserDAOImpl implements IUserDAO { DerbyUserDAOImpl.queryToUsers(queryResult, result); } catch (final SQLException ex) { - throw new DataAccessException("Could not receive user list.", ex); + throw new DataAccessException("Could not receive user list", ex); } finally { - // Try to close everything. If this is not possible then log the problem. It is not necessary to inform the calling method about a fail though. + // Try to close everything. If this is not possible, then log the problem. It is not necessary to inform the calling method about a fail though. if (queryResult != null) { try { queryResult.close(); } catch (final SQLException ex) { - LOG.error("Could not close query result.", ex); + LOG.error("Could not close query result", ex); } } if (statement != null) { try { statement.close(); } catch (final SQLException ex) { - LOG.error("Could not close prepared statement.", ex); + LOG.error("Could not close prepared statement", ex); } } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/CloseableURLClassLoader.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/CloseableURLClassLoader.java index 16556f18237eb649c44c8badd62a901b2d0a91ca..7171da8626470b13bf49d0a6df3aa630d46cb275 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/CloseableURLClassLoader.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/CloseableURLClassLoader.java @@ -24,7 +24,7 @@ import java.util.Collection; import java.util.jar.JarFile; /** - * This is a class loader which enriches the {@link URLClassLoader} with a close-method. The close method is implemented using a hack, which will probably work only + * This is a class loader which enriches the {@link URLClassLoader} with a close-method. The close method is implemented using a hack, which will probably only work * for a Sun VM. * * @author Nils Christian Ehmke @@ -83,8 +83,8 @@ public final class CloseableURLClassLoader extends URLClassLoader implements Clo } } } catch (final Throwable ex) { // NOCS, NOPMD (Catch of Throwable) - // Probably not a SUN VM - throw new IOException("Not a Sun VM.", ex); + // We work probably not on a SUN VM + throw new IOException("Could not close class loader", ex); } } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/PluginFinder.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/PluginFinder.java index 2bcb36700de95379be76e350da80ec179918895a..c7bc5271256198b864007435c0210bb9cae6786f 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/PluginFinder.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/utility/PluginFinder.java @@ -53,8 +53,8 @@ public final class PluginFinder { } /** - * This method delivers all non abstract classes which are available in the given jar and are compatible with - * {@link kieker.analysis.repository.AbstractRepository}. + * This method delivers all non abstract classes which are available in the given jar, have the {@link kieker.analysis.repository.annotation.Repository}, and are + * compatible with {@link kieker.analysis.repository.AbstractRepository}. * * @param jarURL * The URL for the jar. @@ -76,8 +76,8 @@ public final class PluginFinder { } /** - * This method delivers all non abstract classes which are available in the given jar and have the Plugin-Annotation from the Kieker framework (And are correctly - * compatible with {@link kieker.analysis.plugin.reader.AbstractReaderPlugin}). + * This method delivers all non abstract classes which are available in the given jar, have the {@link kieker.analysis.plugin.annotation.Plugin}, and are + * compatible with {@link kieker.analysis.plugin.reader.AbstractReaderPlugin}. * * @param jarURL * The URL for the jar. @@ -98,8 +98,8 @@ public final class PluginFinder { } /** - * This method delivers all non abstract classes which are available in the given jar and have the Plugin-Annotation from the Kieker framework (And are correctly - * compatible with {@link kieker.analysis.plugin.filter.AbstractFilterPlugin}). + * This method delivers all non abstract classes which are available in the given jar, have the {@link kieker.analysis.plugin.annotation.Plugin}, and are + * compatible with {@link kieker.analysis.plugin.filter.AbstractFilterPlugin}. * * @param jarURL * The URL for the jar. @@ -130,7 +130,7 @@ public final class PluginFinder { * @return A list containing all available classes. * * @throws IOException - * If something went wrong during the opening of the jar file. + * If something went wrong while opening of the jar file. */ private Collection<Class<?>> getAllClassesWithinJar(final URL jarURL, final ClassLoader classLoader) throws IOException { JarInputStream stream = null; @@ -245,7 +245,6 @@ public final class PluginFinder { return (elem != null) && elem.isAnnotationPresent(this.classContainer.getPluginAnnotationClass()) && this.classContainer.getAbstractFilterPluginClass().isAssignableFrom(elem); } - } /** diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java index e3ee322286248c3bcc508283a9dbc62f46594cfa..e3e1af9501b2ff9d9065efa5e294c54198c71dc4 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java @@ -21,7 +21,6 @@ import java.util.List; import kieker.analysis.AnalysisController.STATE; import kieker.analysis.model.analysisMetaModel.MIProject; -import kieker.webgui.common.ClassContainer; import kieker.webgui.common.exception.AnalysisDisplayReloadException; import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.DisplayNotFoundException; @@ -155,24 +154,6 @@ public interface IProjectService { @PreAuthorize("isAuthenticated()") public MIProject loadProject(final String projectName) throws ProjectNotExistingException, IOException; - /** - * This method loads the kax-file for the given project name and delivers an initializes instance of {@link MIProject} - but instead of using the "normal" class - * loader, it uses the methods and classes stored in the given instance of {@link ClassContainer}. This means that this method <b>does</b> return an - * instance of {@link MIProject}, but the one defined in the container. This is also the reason why this method has to return an {@link Object}-instance. - * - * @param projectName - * The name of the project to be loaded. - * @param classAndMethodContainer - * The container, which will be used to load the project instance. - * @return The model instance as defined by the corresponding kax-file. - * @throws ProjectNotExistingException - * If a project with the given (source) name doesn't exist. - * @throws IOException - * If something went wrong during the opening of the project. This can also mean that the given {@link ClassContainer} is somehow invalid. - */ - @PreAuthorize("isAuthenticated()") - public Object loadProject(final String projectName, final ClassContainer classAndMethodContainer) throws ProjectNotExistingException, IOException; - /** * This method tries to save the given model instance for the given project. The given time stamp will be compared (if the corresponding flag says so) with the * current time stamp of the project. If the project on the file system has been modified in the meantime, a {@link NewerProjectException} will be thrown. If diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java index fed904d59898fd9bc9c3b0b9c0b6a0d0412ee42c..90ca2f1dfdfe56b1f33fc21c4432f812c62fb2d7 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java @@ -25,7 +25,6 @@ import javax.annotation.PostConstruct; import kieker.analysis.AnalysisController.STATE; import kieker.analysis.model.analysisMetaModel.MIProject; -import kieker.webgui.common.ClassContainer; import kieker.webgui.common.exception.AnalysisDisplayReloadException; import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.DisplayNotFoundException; @@ -176,17 +175,6 @@ public final class ProjectServiceImpl implements IProjectService { } } - @Override - public Object loadProject(final String projectName, final ClassContainer classAndMethodContainer) throws ProjectNotExistingException, IOException { - this.fileSystemLockManager.lock(projectName); - - try { - return this.projectDAO.loadProject(projectName, classAndMethodContainer); - } finally { - this.fileSystemLockManager.unlock(projectName); - } - } - @Override public void saveProject(final String projectName, final MIProject project, final long timeStamp, final boolean overwriteNewerProject, final String username, final String analysisLayout, final String cockpitLayout) throws ProjectNotExistingException, IOException, NewerProjectException { diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ThemeSwitcherBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ThemeSwitcherBean.java index b1ebf06fe31ead00223852026819f3fedb983a36..1c207f8987abed47d2fa31161573ea2a288cd7f5 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ThemeSwitcherBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/application/ThemeSwitcherBean.java @@ -23,15 +23,13 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * This is a {@code Spring} managed bean which is responsible to hold the map with all available themes (look and feels). The content is static, which means that it - * is not possible to add further themes during runtime. If you want to change the themes (or add new ones) take a look into the {@code Spring} configuration - * files.<br> + * This is a Spring managed bean responsible for holding a map with all available themes (look and feels). The content is static, which means that it is not possible + * (or at least not intended) to add further themes during runtime. If you want to change the themes (or add new ones) take a look into the configuration file + * {@code spring-bean-config.xml}. <br> * </br> * - * This class is a singleton scoped bean, as the list with the available themes is a static list.<br> - * </br> - * - * As this bean is {@code Spring} managed, it is <b>not</b> recommended to use the constructor or the setter methods. + * This class is a singleton scoped bean, as the list with the available themes is a static list. As this bean is Spring managed, it is <b>not</b> recommended to use + * the constructor or the setter methods. * * @author Nils Christian Ehmke */ diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CockpitBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CockpitBean.java index 37537aaa6deae44c57aa1dcc771c62e864b14385..9373aaac8595515c75d754780096e13b583bd9e1 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CockpitBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CockpitBean.java @@ -43,10 +43,10 @@ import kieker.webgui.domain.DisplayType; import kieker.webgui.service.IProjectService; import kieker.webgui.web.beans.application.GlobalPropertiesBean; import kieker.webgui.web.utility.CockpitLayout; -import kieker.webgui.web.utility.IDisplayConnectorSettings; -import kieker.webgui.web.utility.MeterGaugeDisplaySettings; -import kieker.webgui.web.utility.PieChartDisplaySettings; -import kieker.webgui.web.utility.XYPlotDisplaySettings; +import kieker.webgui.web.utility.displaySettings.IDisplayConnectorSettings; +import kieker.webgui.web.utility.displaySettings.MeterGaugeDisplaySettings; +import kieker.webgui.web.utility.displaySettings.PieChartDisplaySettings; +import kieker.webgui.web.utility.displaySettings.XYPlotDisplaySettings; import org.primefaces.model.chart.CartesianChartModel; import org.primefaces.model.chart.LineChartSeries; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/UserManagementBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/UserManagementBean.java index c2429bb873ff3735b41457d148bc88b44531e6ba..2f22302b189481eb971cf16bbab98c0f1cce641c 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/UserManagementBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/UserManagementBean.java @@ -38,9 +38,8 @@ import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; /** - * The {@link UserManagementBean} contains the necessary data behind an instance of the user management page. - * The class is a Spring managed bean with view scope to make sure that one user (even in one session) can open multiple instances of the page at a time without - * causing any problems. + * This class contains the necessary data behind an instance of the user management page. It is a Spring managed bean with view scope to make sure that one user + * (even in one session) can open multiple instances of the page at a time without causing any problems. * * @author Nils Christian Ehmke */ @@ -50,15 +49,15 @@ public final class UserManagementBean { private static final Log LOG = LogFactory.getLog(UserManagementBean.class); + private List<User> availableUsers = new ArrayList<User>(); + private User selectedUserCopy; + private User selectedUser; + @Autowired private GlobalPropertiesBean globalPropertiesBean; @Autowired private IUserService userService; - private List<User> availableUsers = new ArrayList<User>(); - private User selectedUserCopy; - private User selectedUser; - /** * Default constructor. <b>Do not call this constructor manually. It will only be accessed by Spring.</b> */ @@ -83,18 +82,21 @@ public final class UserManagementBean { public void addUser(final NewUserBean newUserBean) { final User user = new User(newUserBean.getUsername(), newUserBean.getPassword(), newUserBean.getRole(), newUserBean.isActive()); try { - // Add the user to the database and - if that didn't fail - to our list. + // Add the user to the database and - if that does not fail - to our list. this.userService.addUser(user); this.availableUsers.add(user); + GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgAddUser()); } catch (final DataAccessException ex) { - LOG.error("Could not add the user to the database.", ex); + LOG.error("Could not add the user to the database", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgAddUserException()); } catch (final UserAlreadyExistingException ex) { - LOG.error("Could not add the user to the database.", ex); + LOG.error("Could not add the user to the database", ex); + // If the user exists already, we use a specific callback. We provide the user the possibility to correct the problem without having to fill the form + // again. RequestContext.getCurrentInstance().addCallbackParam("fail", true); - GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgUserAlreadyExisting(), - newUserBean.getMessageTarget().getClientId()); + GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgUserAlreadyExisting(), newUserBean.getMessageTarget() + .getClientId()); } } @@ -105,9 +107,10 @@ public final class UserManagementBean { try { this.userService.deleteUser(this.selectedUser); this.availableUsers.remove(this.selectedUser); + GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgDeletedUser()); } catch (final DataAccessException ex) { - LOG.error("Could not delete the user from the database.", ex); + LOG.error("Could not delete the user from the database", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgDeleteUserException()); } } @@ -125,7 +128,7 @@ public final class UserManagementBean { GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgModifiedUser()); } catch (final DataAccessException ex) { - LOG.error("Could not modify the user within the database.", ex); + LOG.error("Could not modify the user within the database", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgModifyUserException()); } } @@ -141,7 +144,7 @@ public final class UserManagementBean { GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgModifiedUser()); } catch (final DataAccessException ex) { - LOG.error("Could not modify the user within the database.", ex); + LOG.error("Could not modify the user within the database", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgModifyUserException()); } } @@ -158,11 +161,11 @@ public final class UserManagementBean { this.selectedUserCopy.setEnabled(!this.selectedUserCopy.isEnabled()); this.selectedUserCopy.setPassword(null); this.userService.editUser(this.selectedUserCopy); - this.availableUsers.set(this.availableUsers.indexOf(this.selectedUser), this.selectedUserCopy); + GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgModifiedUser()); } catch (final DataAccessException ex) { - LOG.error("Could not modify the user within the database.", ex); + LOG.error("Could not modify the user within the database", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgModifyUserException()); } } @@ -174,23 +177,11 @@ public final class UserManagementBean { try { this.availableUsers = this.userService.getUsers(); } catch (final DataAccessException ex) { - LOG.error("An error occured while accessing the database.", ex); + LOG.error("An error occured while accessing the database", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, this.globalPropertiesBean.getMsgAccessDatabaseException()); } } - public List<User> getUsers() { - return this.availableUsers; - } - - public User getSelectedUser() { - return this.selectedUser; - } - - public User getSelectedUserCopy() { - return this.selectedUserCopy; - } - /** * Setter for the property {@link UserManagementBean#selectedUser}. * @@ -203,4 +194,17 @@ public final class UserManagementBean { this.selectedUser = selectedUser; this.selectedUserCopy = new User(selectedUser.getName(), null, selectedUser.getRole(), selectedUser.isEnabled()); } + + public List<User> getUsers() { + return this.availableUsers; + } + + public User getSelectedUser() { + return this.selectedUser; + } + + public User getSelectedUserCopy() { + return this.selectedUserCopy; + } + } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/converter/RoleStringConverter.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/converter/RoleStringConverter.java index ea0e71ca746c76a144214673114f60a418f1183c..9aae84b17d64c6e5eee4b761e1d0d775e423d8c0 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/converter/RoleStringConverter.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/converter/RoleStringConverter.java @@ -47,7 +47,7 @@ public final class RoleStringConverter implements Converter { try { return Role.valueOf(str); } catch (final IllegalArgumentException ex) { - throw new ConverterException("The given string is not a valid role", ex); + throw new ConverterException("The given string does not represent a valid role", ex); } } } @@ -59,7 +59,7 @@ public final class RoleStringConverter implements Converter { } else if (obj instanceof Role) { return ((Role) obj).toString(); } else { - throw new ConverterException("The class of the given object is invalid"); + throw new ConverterException("The given object is not an instance of " + Role.class.getName()); } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/ViewScope.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/ViewScope.java index 41371bdc94b7866e51e0d7c9d1a004e07e0d64c2..52990f1ce8ee54c9c074e7905ed8875f53dfeda5 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/ViewScope.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/ViewScope.java @@ -24,15 +24,17 @@ import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.config.Scope; /** - * This is an own implementation of the view scope of Java Server Faces. It is necessary as Spring doesn't provide this scope. The implementation is merely - * rudimentary. For example, it doesn't provide destruction callbacks or the resolving of contextual objects. + * This is an own implementation of the view scope of Java Server Faces. This is necessary as Spring does not provide this scope. The implementation is merely + * rudimentary. For example, it does not provide destruction callbacks or the resolving of contextual objects. The code originates from {@code blog.primefaces.org}. + * We register the scope in the configuration file {@code spring-common-config.xml}. It can be used as any other Spring scope using the + * {@link org.springframework.context.annotation.Scope} annotation with the value {@code view}. * * @author Nils Christian Ehmke */ public final class ViewScope implements Scope { /** - * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> + * Default constructor. <b>Do not use this constructor. This scope is Spring managed.</b> */ public ViewScope() { // No code necessary. @@ -64,7 +66,7 @@ public final class ViewScope implements Scope { @Override public void registerDestructionCallback(final String name, final Runnable callback) { // NOPMD (Threads are not used here) - // Not supported + // Destruction callback is not supported } @Override diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/IDisplayConnectorSettings.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/IDisplayConnectorSettings.java similarity index 94% rename from Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/IDisplayConnectorSettings.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/IDisplayConnectorSettings.java index 6e2f2b6246fc4a02202359875cb61fb633e85bee..8c72125cb730364b33fb55c13dc3bbf10f79a525 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/IDisplayConnectorSettings.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/IDisplayConnectorSettings.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.web.utility; +package kieker.webgui.web.utility.displaySettings; /** * This interface marks classes containing settings for display connectors within the cockpit. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/MeterGaugeDisplaySettings.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/MeterGaugeDisplaySettings.java similarity index 96% rename from Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/MeterGaugeDisplaySettings.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/MeterGaugeDisplaySettings.java index 5bf61f42518c0eae661b89eeb1b71fb2d8f55232..eeb0fe41e51c491a4dfcb470aba0e6fb0fcc0f8d 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/MeterGaugeDisplaySettings.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/MeterGaugeDisplaySettings.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.web.utility; +package kieker.webgui.web.utility.displaySettings; import java.util.Collections; import java.util.Map; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/PieChartDisplaySettings.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/PieChartDisplaySettings.java similarity index 97% rename from Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/PieChartDisplaySettings.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/PieChartDisplaySettings.java index 345fc729d5e8660ca255e98e980a0f27c8541d33..aa5e06a0fe3172a94cde7b0e39e014e45ea85dee 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/PieChartDisplaySettings.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/PieChartDisplaySettings.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.web.utility; +package kieker.webgui.web.utility.displaySettings; /** * This is a settings container for a pie chart within the cockpit. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/XYPlotDisplaySettings.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/XYPlotDisplaySettings.java similarity index 98% rename from Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/XYPlotDisplaySettings.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/XYPlotDisplaySettings.java index f25229179d52873766b326440ac11db9c829eae1..fc17c9e78f0fba52906f9b58a12a85243f2cd817 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/XYPlotDisplaySettings.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/XYPlotDisplaySettings.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.web.utility; +package kieker.webgui.web.utility.displaySettings; import java.util.Collection; import java.util.Collections; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..b12752a96d57b88055767ab4b3984206b955e000 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/web/utility/displaySettings/package-info.java @@ -0,0 +1,21 @@ +/*************************************************************************** + * Copyright 2013 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +/** + * @author Nils Christian Ehmke + * + */ +package kieker.webgui.web.utility.displaySettings; \ No newline at end of file