Package com.opengamma.livedata.msg

Examples of com.opengamma.livedata.msg.EntitlementRequest


  //-------------------------------------------------------------------------
  @Override
  @Transactional
  public FudgeMsg requestReceived(FudgeDeserializer deserializer, FudgeMsgEnvelope requestEnvelope) {
    FudgeMsg requestFudgeMsg = requestEnvelope.getMessage();
    EntitlementRequest entitlementRequest = EntitlementRequest.fromFudgeMsg(deserializer, requestFudgeMsg);
    s_logger.debug("Received entitlement request {}", entitlementRequest);
   
    Map<LiveDataSpecification, Boolean> isEntitledMap = _delegate.isEntitled(entitlementRequest.getUser(), entitlementRequest.getLiveDataSpecifications());
   
    ArrayList<EntitlementResponse> responses = new ArrayList<EntitlementResponse>();
    for (LiveDataSpecification spec : entitlementRequest.getLiveDataSpecifications()) {
      boolean isEntitled = isEntitledMap.get(spec);
      EntitlementResponse response;
      if (isEntitled) {
        response = new EntitlementResponse(spec, true);
      } else {
        response = new EntitlementResponse(spec, false, entitlementRequest.getUser() + " is not entitled to " + spec);
      }
      responses.add(response);
    }
    EntitlementResponseMsg response = new EntitlementResponseMsg(responses);
    return response.toFudgeMsg(new FudgeSerializer(deserializer.getFudgeContext()));
View Full Code Here


    return entitlements.get(specification);
  }

  private FudgeMsg composeRequestMessage(UserPrincipal user,
      Collection<LiveDataSpecification> specifications) {
    EntitlementRequest request = new EntitlementRequest(user, specifications);
    return request.toFudgeMsg(new FudgeSerializer(_fudgeContext));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.livedata.msg.EntitlementRequest

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.