Package org.jresearch.flexess.client

Examples of org.jresearch.flexess.client.UamClientException


  private SecurityModel loadSecurityModel(final String applicationId) throws UamClientException {
    try {
      final IModelMetaInfo modelMetaInfo = applicationService.getModelMetaInfo(applicationId);
      if (modelMetaInfo == null) {
        throw new UamClientException(MessageFormat.format("Application {0} is not found or doesn't contain the model information.", applicationId)); //$NON-NLS-1$
      }
      final SecurityModel model = securityContainerFactory.getSecurityContainer(modelMetaInfo.getModel()).getModel();
      if (model == null) {
        throw new UamClientException(MessageFormat.format("Model {0} is not found", modelMetaInfo.getId())); //$NON-NLS-1$
      }
      return model;
    } catch (final RemoteAccessException e) {
      throw new FlexessConnectException(MessageFormat.format("Can't connect: {0}.", e.getLocalizedMessage()), e); //$NON-NLS-1$
    }
View Full Code Here


      checkObjectRequest(modelId, objectInstance, operation);
      return;
    }
    final Class<?> objectClass = request.getObjectClass();
    if (objectClass == null) {
      throw new UamClientException("Incomplete authorization request: both object and class are missing"); //$NON-NLS-1$
    }
    checkClassRequest(modelId, request.getAttributeMap(), objectClass, operation);
  }
View Full Code Here

      try {
        final SecurityModel securityModel = loadSecurityModel(applicationId);
        final String modelId = securityModel.getId();
        final String prevApplication = userContext.addApplication(modelId, applicationId);
        if (prevApplication != null) {
          throw new UamClientException(MessageFormat.format("Error in Flexess client initializing: the client can''t work with application ({0} and {1}), which contain the same model", applicationId, //$NON-NLS-1$
              prevApplication));
        }
        userContext.addSecurityModels(modelId, securityModel);
        userContext.setRoles(modelId, loadRoles(applicationId, modelId, userId));
      } catch (final UamClientException e) {
View Full Code Here

      Constraint constraint = helper.createInvariant(expession);
      Query<EClassifier, EClass, EObject> constraintEval = ocl.createQuery(constraint);
      return constraintEval.check(permissionInstance);
    } catch (ParserException e) {
      e.printStackTrace();
      throw new UamClientException(MessageFormat.format("Incorrect expression: {0}. {1}", expession, e.getLocalizedMessage()));
    }
  }
View Full Code Here

    EObject eObject = null;
    try {
      IInstanceMapper mapper = new GenericMapper();
      eObject = mapper.createPObjectInstance(attributes, po);
    } catch (Exception e) {
      throw new UamClientException("Unable to create EObject", e);
    }
    return eObject;
  }
View Full Code Here

   */
  public static IAuthorizationManager getAuthorizationManager() {
    try {
      return (IAuthorizationManager) getFactory().getBean(authorizationManagerID);
    } catch (BeansException e) {
      throw new UamClientException(MessageFormat.format("Error getting bean {0}: {1}", authorizationManagerID, e.getLocalizedMessage()), e); //$NON-NLS-1$
    }
  }
View Full Code Here

TOP

Related Classes of org.jresearch.flexess.client.UamClientException

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.