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()));
}