Package org.jresearch.flexess.core.model

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


    return null;
  }

  public PObject getPObjectById(String modelId, String id) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    return (PObject) getObjectById(modelDao.getSecurityModel(modelId), UamPackage.eINSTANCE.getPObject(), id);
  }
View Full Code Here


    return (PObject) getObjectById(modelDao.getSecurityModel(modelId), UamPackage.eINSTANCE.getPObject(), id);
  }

  public Permission getPermissionById(String modelId, String id) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    return (Permission) getObjectById(modelDao.getSecurityModel(modelId), UamPackage.eINSTANCE.getPermission(), id);
  }
View Full Code Here

    return (Permission) getObjectById(modelDao.getSecurityModel(modelId), UamPackage.eINSTANCE.getPermission(), id);
  }

  public Role getRoleById(String modelId, String id) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    return (Role) getObjectById(modelDao.getSecurityModel(modelId), UamPackage.eINSTANCE.getRole(), id);
  }
View Full Code Here

    return (Role) getObjectById(modelDao.getSecurityModel(modelId), UamPackage.eINSTANCE.getRole(), id);
  }

  public Collection<PObject> getAllPObjects(String modelId) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    return EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPObject());
  }
View Full Code Here

    return EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPObject());
  }

  public Collection<Permission> getAllPermissions(String modelId) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    return EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPermission());
  }
View Full Code Here

    return EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPermission());
  }

  public Collection<Role> getAllRoles(String modelId) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    Collection<Role> roles = EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getRole());
    TreeSet<Role> set = new TreeSet<Role>(new RoleComparator());
    set.addAll(roles);
View Full Code Here

  @Override
  public IDynamicRoleMetaInfo getDynamicRoleImpl(String modelId) throws ObjectNotFoundException {
    ModelMetaInfo mm = (ModelMetaInfo) modelService.getSerializedModel(modelId);
    if (mm == null) {
      throw new ObjectNotFoundException(MessageFormat.format("Model {0} is not found", modelId), modelId); //$NON-NLS-1$
    }
    DynamicRoleMetaInfo newRole = new DynamicRoleMetaInfo();
    newRole.setModelId(modelId);
    return newRole;
  }
View Full Code Here

  @Override
  public void assignPermissions(String roleId, Set<IPermissionMetaInfo> permissions) throws ObjectNotFoundException {
    DynamicRoleMetaInfo role = (DynamicRoleMetaInfo) getDynamicRole(roleId);
    if (role == null) {
      throw new ObjectNotFoundException("Dynamic role is not found", roleId); //$NON-NLS-1$
    }
    String modelId = role.getModelId();
    List<IRoleInstanceMetaInfo> instances = roleInstanceService.getRoleInstances(modelId, role.getId());
    Set<PermissionRole> oldPermissions = role.getPermissionRoles();
    if (permissions == null) {
View Full Code Here

  @Override
  public void assignUserRoles(String userId, String applicationId, List<IRoleInstanceMetaInfo> rm) throws ObjectNotFoundException {
    ApplicationMetaInfo applicationMetaInfo = (ApplicationMetaInfo) appDao.getApplication(applicationId);
    if (applicationMetaInfo == null) {
      throw new ObjectNotFoundException("Application not found", applicationId); //$NON-NLS-1$
    }
    List<UserRole> userRole = getRolesForUser(userId, applicationId);
    if (rm == null) {
      List<IRoleInstanceMetaInfo> roles = getUserRoles(userId, applicationId);
      for (IRoleInstanceMetaInfo role : roles) {
View Full Code Here

  @Override
  public List<String> getCategories(String modelId) throws ObjectNotFoundException {
    SecurityModel model = getModelById(modelId);
    if (model == null) {
      throw new ObjectNotFoundException("Model is not found", modelId);
    }
    return CategoryManager.getInstance().getCategories(model);
  }
View Full Code Here

TOP

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

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.