Skip to content
Snippets Groups Projects
Commit d718fc15 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Refactoring

parent f2686eeb
No related branches found
No related tags found
No related merge requests found
...@@ -31,10 +31,10 @@ import kieker.common.logging.Log; ...@@ -31,10 +31,10 @@ import kieker.common.logging.Log;
import kieker.common.logging.LogFactory; import kieker.common.logging.LogFactory;
import kieker.webgui.beans.view.CurrentProjectOverviewBean; import kieker.webgui.beans.view.CurrentProjectOverviewBean;
import kieker.webgui.common.IProjectManagerFacade; import kieker.webgui.common.IProjectManagerFacade;
import kieker.webgui.common.ProjectManagerFacade;
import kieker.webgui.common.exception.ProjectAlreadyExistingException; import kieker.webgui.common.exception.ProjectAlreadyExistingException;
import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectLoadException;
import kieker.webgui.common.exception.ProjectNotExistingException; import kieker.webgui.common.exception.ProjectNotExistingException;
import kieker.webgui.common.impl.ProjectManagerFacadeImpl;
/** /**
* The {@link ProjectsBean} is a Spring managed bean to manage a list with all application wide available projects. It provides methods to receive this list as well * The {@link ProjectsBean} is a Spring managed bean to manage a list with all application wide available projects. It provides methods to receive this list as well
...@@ -148,7 +148,7 @@ public final class ProjectsBean { ...@@ -148,7 +148,7 @@ public final class ProjectsBean {
/** /**
* This method can be used to open an already existing project. This means that the current state of the project on the file system is loaded into an instance of * This method can be used to open an already existing project. This means that the current state of the project on the file system is loaded into an instance of
* {@link MIProject}. This instance can be modified at will and for example later saved by the {@link ProjectManagerFacade}. * {@link MIProject}. This instance can be modified at will and for example later saved by the {@link ProjectManagerFacadeImpl}.
* *
* @param project * @param project
* The name of the project to be opened. * The name of the project to be opened.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
***************************************************************************/ ***************************************************************************/
package kieker.webgui.common; package kieker.webgui.common.impl;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
...@@ -29,6 +29,8 @@ import kieker.analysis.model.analysisMetaModel.MIDependency; ...@@ -29,6 +29,8 @@ import kieker.analysis.model.analysisMetaModel.MIDependency;
import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIProject;
import kieker.analysis.plugin.AbstractPlugin; import kieker.analysis.plugin.AbstractPlugin;
import kieker.analysis.repository.AbstractRepository; import kieker.analysis.repository.AbstractRepository;
import kieker.webgui.common.ClassAndMethodContainer;
import kieker.webgui.common.IProjectManagerFacade;
import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.AnalysisInitializationException;
import kieker.webgui.common.exception.AnalysisStateException; import kieker.webgui.common.exception.AnalysisStateException;
import kieker.webgui.common.exception.DisplayNotFoundException; import kieker.webgui.common.exception.DisplayNotFoundException;
...@@ -48,7 +50,7 @@ import org.primefaces.model.UploadedFile; ...@@ -48,7 +50,7 @@ import org.primefaces.model.UploadedFile;
* *
* @author Nils Christian Ehmke * @author Nils Christian Ehmke
*/ */
public final class ProjectManagerFacade implements IProjectManagerFacade { public final class ProjectManagerFacadeImpl implements IProjectManagerFacade {
private final ConcurrentHashMap<String, Object> fileSystemLocks = new ConcurrentHashMap<String, Object>(); private final ConcurrentHashMap<String, Object> fileSystemLocks = new ConcurrentHashMap<String, Object>();
private final ConcurrentHashMap<String, Object> analysesLocks = new ConcurrentHashMap<String, Object>(); private final ConcurrentHashMap<String, Object> analysesLocks = new ConcurrentHashMap<String, Object>();
...@@ -62,12 +64,12 @@ public final class ProjectManagerFacade implements IProjectManagerFacade { ...@@ -62,12 +64,12 @@ public final class ProjectManagerFacade implements IProjectManagerFacade {
/** /**
* Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b>
*/ */
public ProjectManagerFacade() { public ProjectManagerFacadeImpl() {
// No code necessary. // No code necessary.
} }
/** /**
* The setter for the property {@link ProjectManagerFacade#acManager}. <b>Do not use this method. This property is Spring managed.</b> * The setter for the property {@link ProjectManagerFacadeImpl#acManager}. <b>Do not use this method. This property is Spring managed.</b>
* *
* @param acManager * @param acManager
*/ */
...@@ -76,7 +78,7 @@ public final class ProjectManagerFacade implements IProjectManagerFacade { ...@@ -76,7 +78,7 @@ public final class ProjectManagerFacade implements IProjectManagerFacade {
} }
/** /**
* The setter for the property {@link ProjectManagerFacade#fsManager}. <b>Do not use this method. This property is Spring managed.</b> * The setter for the property {@link ProjectManagerFacadeImpl#fsManager}. <b>Do not use this method. This property is Spring managed.</b>
* *
* @param fsManager * @param fsManager
*/ */
...@@ -85,7 +87,7 @@ public final class ProjectManagerFacade implements IProjectManagerFacade { ...@@ -85,7 +87,7 @@ public final class ProjectManagerFacade implements IProjectManagerFacade {
} }
/** /**
* The setter for the property {@link ProjectManagerFacade#pluginFinder}. <b>Do not use this method. This property is Spring managed.</b> * The setter for the property {@link ProjectManagerFacadeImpl#pluginFinder}. <b>Do not use this method. This property is Spring managed.</b>
* *
* @param pluginFinder * @param pluginFinder
*/ */
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
***************************************************************************/ ***************************************************************************/
package kieker.webgui.common; package kieker.webgui.common.impl;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
...@@ -32,11 +32,13 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -32,11 +32,13 @@ import org.springframework.security.access.prepost.PreAuthorize;
import kieker.common.logging.Log; import kieker.common.logging.Log;
import kieker.common.logging.LogFactory; import kieker.common.logging.LogFactory;
import kieker.webgui.common.IUserManagerFacade;
import kieker.webgui.common.Role;
import kieker.webgui.common.User;
// FIXME @PreAuthorize annotations are not used as it seems! public class UserManagerFacadeImpl implements IUserManagerFacade {
public class UserManagerFacade implements IUserManagerFacade {
private static final Log LOG = LogFactory.getLog(UserManagerFacade.class); private static final Log LOG = LogFactory.getLog(UserManagerFacadeImpl.class);
@Autowired @Autowired
private DataSource dataSource; private DataSource dataSource;
private Connection connection; private Connection connection;
...@@ -44,7 +46,7 @@ public class UserManagerFacade implements IUserManagerFacade { ...@@ -44,7 +46,7 @@ public class UserManagerFacade implements IUserManagerFacade {
/** /**
* Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b>
*/ */
public UserManagerFacade() { public UserManagerFacadeImpl() {
// No code necessary // No code necessary
} }
...@@ -55,7 +57,7 @@ public class UserManagerFacade implements IUserManagerFacade { ...@@ -55,7 +57,7 @@ public class UserManagerFacade implements IUserManagerFacade {
try { try {
this.connection = this.dataSource.getConnection(); this.connection = this.dataSource.getConnection();
} catch (final SQLException ex) { } catch (final SQLException ex) {
UserManagerFacade.LOG.error("Could not establish database connection.", ex); UserManagerFacadeImpl.LOG.error("Could not establish database connection.", ex);
} }
} }
...@@ -80,7 +82,7 @@ public class UserManagerFacade implements IUserManagerFacade { ...@@ -80,7 +82,7 @@ public class UserManagerFacade implements IUserManagerFacade {
roleCmd.execute(); roleCmd.execute();
} }
} catch (final SQLException ex) { } catch (final SQLException ex) {
UserManagerFacade.LOG.error("Could not add user to the database.", ex); UserManagerFacadeImpl.LOG.error("Could not add user to the database.", ex);
} }
} }
...@@ -132,14 +134,14 @@ public class UserManagerFacade implements IUserManagerFacade { ...@@ -132,14 +134,14 @@ public class UserManagerFacade implements IUserManagerFacade {
// Now convert the map to the list // Now convert the map to the list
result.addAll(tempMap.values()); result.addAll(tempMap.values());
} catch (final SQLException ex) { } catch (final SQLException ex) {
UserManagerFacade.LOG.error("Could not receive user list.", ex); UserManagerFacadeImpl.LOG.error("Could not receive user list.", ex);
} finally { } finally {
try { try {
if (queryResult != null) { if (queryResult != null) {
queryResult.close(); queryResult.close();
} }
} catch (final SQLException ex) { } catch (final SQLException ex) {
UserManagerFacade.LOG.error("Could not close query result.", ex); UserManagerFacadeImpl.LOG.error("Could not close query result.", ex);
} }
} }
......
/***************************************************************************
* Copyright 2012 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.common.impl;
\ No newline at end of file
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<bean id="acManager" class="kieker.webgui.common.util.ACManager"> <bean id="acManager" class="kieker.webgui.common.util.ACManager">
<property name="fsManager" ref="fsManager" /> <property name="fsManager" ref="fsManager" />
</bean> </bean>
<bean id="projectManagerFacade" class="kieker.webgui.common.ProjectManagerFacade"> <bean id="projectManagerFacade" class="kieker.webgui.common.impl.ProjectManagerFacadeImpl">
<property name="fsManager" ref="fsManager" /> <property name="fsManager" ref="fsManager" />
<property name="acManager" ref="acManager" /> <property name="acManager" ref="acManager" />
<property name="pluginFinder" ref="pluginFinder" /> <property name="pluginFinder" ref="pluginFinder" />
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
</map> </map>
</property> </property>
</bean> </bean>
<bean init-method="initialize" id="userManagerFacade" class="kieker.webgui.common.UserManagerFacade"> <bean init-method="initialize" id="userManagerFacade" class="kieker.webgui.common.impl.UserManagerFacadeImpl">
<property name="dataSource" ref="userDataSource" /> <property name="dataSource" ref="userDataSource" />
</bean> </bean>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment