ctx.setRequestLogExtension(new BaselineLogExtension(null, null, null));
List<ReceivedEvent> ret = new ArrayList<ReceivedEvent>();
if (event == GetReceivedEventsEventEnum.TimeTick) {
Iterator<TimeTick> it = timeTicks.iterator();
while (it.hasNext()) {
TimeTick next = it.next();
ReceivedEvent re = new ReceivedEvent();
re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
re.setTimeTick(next.getTime());
ret.add(re);
it.remove();
}
timeTicks.clear();
}
else if (event == GetReceivedEventsEventEnum.MatchedBet) {
Iterator<MatchedBet> it = matchedBets.iterator();
while (it.hasNext()) {
MatchedBet next = it.next();
ReceivedEvent re = new ReceivedEvent();
re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
re.setMatchedBet(next.getBody());
ret.add(re);
it.remove();
}
matchedBets.clear();
}
else if (event == GetReceivedEventsEventEnum.LogMessage) {
Iterator<LogMessage> it = logMessages.iterator();
while (it.hasNext()) {
LogMessage next = it.next();
ReceivedEvent re = new ReceivedEvent();
re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
re.setLogMessage(next.getBody());
ret.add(re);
it.remove();
}
logMessages.clear();
}
else if (event == GetReceivedEventsEventEnum.ListEvent) {
Iterator<ListEvent> it = listEvents.iterator();
while (it.hasNext()) {
ListEvent next = it.next();
ReceivedEvent re = new ReceivedEvent();
re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
re.setListEvent(next.getMessageList());
ret.add(re);
it.remove();
}
listEvents.clear();
}
else if (event == GetReceivedEventsEventEnum.SetEvent) {
Iterator<SetEvent> it = setEvents.iterator();
while (it.hasNext()) {
SetEvent next = it.next();
ReceivedEvent re = new ReceivedEvent();
re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
re.setSetEvent(next.getMessageSet());
ret.add(re);
it.remove();
}
setEvents.clear();
}
else if (event == GetReceivedEventsEventEnum.MapEvent) {
Iterator<MapEvent> it = mapEvents.iterator();
while (it.hasNext()) {
MapEvent next = it.next();
ReceivedEvent re = new ReceivedEvent();
re.setEventName(ReceivedEventEventNameEnum.valueOf(event.name()));
re.setMapEvent(next.getMessageMap());
ret.add(re);
it.remove();
}
mapEvents.clear();
}