kieker.webgui.persistence.impl
Class DerbyUserDAOImpl

java.lang.Object
  extended by kieker.webgui.persistence.impl.DerbyUserDAOImpl
All Implemented Interfaces:
IUserDAO

@Service
public final class DerbyUserDAOImpl
extends Object
implements IUserDAO

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 data source uses pools for the connections and the prepared statements. The configuration can be found in the file spring-database-config.xml.

Author:
Nils Christian Ehmke

Constructor Summary
DerbyUserDAOImpl()
          Default constructor.
 
Method Summary
 void addUser(User user)
          Adds a user to the system.
 void deleteUser(User user)
          Deletes a user from the system.
 void editUserWithoutPassword(User user)
          Edits a given user, but does not change the password.
 void editUserWithPassword(User user)
          Edits a given user and changes the password as well.
 List<User> getUsers()
          Delivers a list containing the available users within the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyUserDAOImpl

public DerbyUserDAOImpl()
Default constructor. Do not use this constructor. This bean is Spring managed.

Method Detail

addUser

@Transactional
public void addUser(User user)
             throws DataAccessException
Description copied from interface: IUserDAO
Adds a user to the system.

Specified by:
addUser in interface IUserDAO
Parameters:
user - The domain object used to extract the necessary data to create the user. It is assumed that all fields are filled.
Throws:
DataAccessException - If it was not possible to add the user to the system. Either because a constraint was violated or because the connection to the database has somehow been damaged.

deleteUser

@Transactional
public void deleteUser(User user)
                throws DataAccessException
Description copied from interface: IUserDAO
Deletes a user from the system.

Specified by:
deleteUser in interface IUserDAO
Parameters:
user - The domain object used to extract the necessary data to delete the user. It is only necessary that the name field is filled.
Throws:
DataAccessException - If it was not possible to delete the user. Either because a constraint was violated or because the connection to the database has somehow been damaged.

editUserWithPassword

@Transactional
public void editUserWithPassword(User user)
                          throws DataAccessException
Description copied from interface: IUserDAO
Edits a given user and changes the password as well.

Specified by:
editUserWithPassword in interface IUserDAO
Parameters:
user - The domain object used to extract the necessary data to edit the user. It is assumed that all fields are filled.
Throws:
DataAccessException - If it was not possible to edit the user. Either because a constraint was violated or because the connection to the database has somehow been damaged.

editUserWithoutPassword

@Transactional
public void editUserWithoutPassword(User user)
                             throws DataAccessException
Description copied from interface: IUserDAO
Edits a given user, but does not change the password.

Specified by:
editUserWithoutPassword in interface IUserDAO
Parameters:
user - The domain object used to extract the necessary data to edit the user. It is assumed that all fields are filled (except for the password field).
Throws:
DataAccessException - If it was not possible to edit the user. Either because a constraint was violated or because the connection to the database has somehow been damaged.

getUsers

@Transactional(readOnly=true)
public List<User> getUsers()
                    throws DataAccessException
Description copied from interface: IUserDAO
Delivers a list containing the available users within the system. The password fields of the returned domain objects will be empty. The list is always a fresh copy and can be modified at will.

Specified by:
getUsers in interface IUserDAO
Returns:
A list with the available users.
Throws:
DataAccessException - If something went wrong during the reading. This happens probably if the connection to the database has somehow been damaged.


Copyright © 2015. All rights reserved.