Package org.jresearch.flexess.client.context

Examples of org.jresearch.flexess.client.context.UserContext


    return initUserContext(context.getUserId());
  }

  @Override
  public synchronized IUserContext initUserContext(final String userId) {
    final UserContext userContext = new UserContext(userId);
    UserContextManager.setContext(userContext);
    if (applicationIds.isEmpty()) {
      applicationIds.addAll(applicationService.getApplicationIds());
    }
    for (final String applicationId : applicationIds) {
      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) {
        logger.trace("Error while loading the application {}. Ignore it", applicationId, e); //$NON-NLS-1$
      }
    }
    return userContext;
View Full Code Here

TOP

Related Classes of org.jresearch.flexess.client.context.UserContext

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.