Search in sources :

Example 6 with LaserDefinitionDuplicationException

use of cern.laser.business.definition.LaserDefinitionDuplicationException in project ACS by ACS-Community.

the class AdminUserDefinitionServiceImpl method createAdminUser.

public String createAdminUser(String name, String password) throws LaserDefinitionException {
    LOGGER.info("creating admin user : " + name + "/" + password);
    AdminUser admin_user = adminUserDAO.getAdminUserByName(name);
    if (admin_user != null) {
        throw new LaserDefinitionDuplicationException("a user " + name + " already exists");
    }
    admin_user = new AdminUser(name, password);
    admin_user.addAdministeredCategory(categoryDAO.findByCategoryTreeRoot());
    adminUserDAO.saveAdminUser(admin_user);
    LOGGER.info("admin user " + name + "/" + password + " created");
    return admin_user.getUserId();
}
Also used : AdminUser(cern.laser.business.data.AdminUser) LaserDefinitionDuplicationException(cern.laser.business.definition.LaserDefinitionDuplicationException)

Aggregations

AdminUser (cern.laser.business.data.AdminUser)6 LaserDefinitionDuplicationException (cern.laser.business.definition.LaserDefinitionDuplicationException)6 Alarm (cern.laser.business.data.Alarm)4 LaserDefinitionNotValidException (cern.laser.business.definition.LaserDefinitionNotValidException)4 Category (cern.laser.business.data.Category)3 LaserDefinitionNotAllowedException (cern.laser.business.definition.LaserDefinitionNotAllowedException)3 LaserDefinitionNotFoundException (cern.laser.business.definition.LaserDefinitionNotFoundException)3 AlarmImpl (cern.laser.business.data.AlarmImpl)2 CategoryImpl (cern.laser.business.data.CategoryImpl)2 ResponsiblePerson (cern.laser.business.data.ResponsiblePerson)2 Source (cern.laser.business.data.Source)2 AlarmCacheException (cern.laser.business.cache.AlarmCacheException)1 Building (cern.laser.business.data.Building)1 AlarmDefinition (cern.laser.business.definition.data.AlarmDefinition)1 CategoryDefinition (cern.laser.business.definition.data.CategoryDefinition)1