Package org.jresearch.flexess.core.model

Examples of org.jresearch.flexess.core.model.DataModelException


  @Override
  public void addPermission(String dynamicRoleId, String permissionId) throws ObjectNotFoundException, DataModelException {
    List<PermissionRole> pr = dynamicRoleDAO.getPermissionRoles(dynamicRoleId, permissionId);
    if (pr != null && pr.size() > 0) {
      throw new DataModelException("This permission is already assigned"); //$NON-NLS-1$
    }
    dynamicRoleDAO.addPermission(dynamicRoleId, permissionId);
  }
View Full Code Here


  @Override
  public IDynamicRoleMetaInfo saveDynamicRole(IDynamicRoleMetaInfo dynamicRole) throws DataModelException, ObjectNotFoundException {
    if (dynamicRole.getId() == null || (getDynamicRole(dynamicRole.getId()) == null)) {
      if (findDynamicRole(dynamicRole.getId(), dynamicRole.getName()) != null) {
        throw new DataModelException("Dynamic role with such name already exists"); //$NON-NLS-1$
      }
    }
    return dynamicRoleDAO.saveDynamicRole(dynamicRole);
  }
View Full Code Here

  @Override
  public IApplicationMetaInfo saveApplication(IApplicationMetaInfo application) throws DataModelException {
    if (application.getId() == null) {
      if (findApplication(application.getName()) != null) {
        throw new DataModelException("Application with such name already exists");
      }
    }
    return applicationDAO.saveApplication(application);
  }
View Full Code Here

  @Override
  public void addUserRole(String userId, IApplicationMetaInfo application, IRoleInstanceMetaInfo rm) throws DataModelException {
    IUserRole role = userRoleDao.findRole(userId, application.getId(), rm.getId());
    if (role != null) {
      throw new DataModelException("Role is already assigned"); //$NON-NLS-1$
    }
    UserRole ur = new UserRole();
    ur.setRoleInstanceMetaInfo(rm);
    ur.setUserID(userId);
    ur.setApplicationInfo(application);
View Full Code Here

  @Override
  public IRoleInstanceMetaInfo saveRoleInstance(IRoleInstanceMetaInfo rmeta) throws DataModelException {
    if (rmeta.getId() == null) {
      IRoleInstanceMetaInfo ri = findRoleInstance(rmeta.getModelId(), rmeta.getRoleId(), rmeta.getName());
      if (ri != null) {
        throw new DataModelException("Name of the role must be unique within the model"); //$NON-NLS-1$
      }
    }
    return roleInstDAO.saveRoleInstance(rmeta);
  }
View Full Code Here

TOP

Related Classes of org.jresearch.flexess.core.model.DataModelException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.