new SubscribeAction() {
@Override
public Collection<LiveDataSubscriptionResponse> subscribe(StandardLiveDataServer server, Collection<LiveDataSpecification> specifications) {
LiveDataSubscriptionRequest liveDataSubscriptionRequest = buildSubRequest(subscriptionRequest, specifications);
//NOTE: we call up to subscriptionRequestMade to get the exception catching
LiveDataSubscriptionResponseMsg response = server.subscriptionRequestMade(liveDataSubscriptionRequest);
//Check that we know how to combine these responses
if (response.getRequestingUser() != subscriptionRequest.getUser()) {
throw new OpenGammaRuntimeException("Unexpected user in response " + response.getRequestingUser());
}
return response.getResponses();
}
@Override
public String getName() {
return "SubscriptionRequestMade";
}
});
return new LiveDataSubscriptionResponseMsg(subscriptionRequest.getUser(), responses);
}