use of com.symphony.api.model.MessageSearchQuery in project spring-bot by finos.
the class SymphonyHistoryImpl method getEntityJsonFromHistory.
@Override
public List<EntityJson> getEntityJsonFromHistory(Tag t, Addressable address, Instant since) {
MessageSearchQuery msq = createMessageSearchQuery(null, address, since, t);
V4MessageList out = messageApi.v1MessageSearchPost(msq, null, null, 0, 50, null, null);
return out.stream().map(msg -> getEntityJson(msg)).filter(e -> e != null).collect(Collectors.toList());
}
use of com.symphony.api.model.MessageSearchQuery in project spring-bot by finos.
the class SymphonyHistoryImpl method getEntityJsonFromHistory.
@Override
public <X> List<EntityJson> getEntityJsonFromHistory(Class<X> type, Addressable address, Instant since) {
MessageSearchQuery msq = createMessageSearchQuery(type, address, since, null);
V4MessageList out = messageApi.v1MessageSearchPost(msq, null, null, 0, 50, null, null);
return out.stream().map(msg -> getEntityJson(msg)).filter(e -> e != null).collect(Collectors.toList());
}
use of com.symphony.api.model.MessageSearchQuery in project spring-bot by finos.
the class SymphonyHistoryImpl method getLastEntityJsonFromHistory.
@Override
public <X> Optional<EntityJson> getLastEntityJsonFromHistory(Class<X> type, Addressable address) {
MessageSearchQuery msq = createMessageSearchQuery(type, address, null, null);
V4MessageList out = messageApi.v1MessageSearchPost(msq, null, null, 0, 1, null, null);
return convertToOptionalEntityJson(out);
}
use of com.symphony.api.model.MessageSearchQuery in project spring-bot by finos.
the class SymphonyRoomSharedLog method performQuery.
protected List<Participant> performQuery(LogMessageType messageType, int count) {
long since = System.currentTimeMillis() - participationIntervalMillis - ONE_HOUR;
MessageSearchQuery msq = new MessageSearchQuery().hashtag(getHashTagId()).streamId(getStreamId()).fromDate(since).streamType("ROOM");
return messagesApi.v1MessageSearchPost(msq, null, null, 0, count, null, null).stream().map(m -> readMessage(m)).filter(o -> o.isPresent()).map(o -> o.get()).filter(cm -> cm.messageType == messageType).map(cm -> cm.getParticipant()).distinct().collect(Collectors.toList());
}
use of com.symphony.api.model.MessageSearchQuery in project spring-bot by finos.
the class SymphonyHistoryImpl method getLastEntityJsonFromHistory.
@Override
public <X> Optional<EntityJson> getLastEntityJsonFromHistory(Class<X> type, Tag t, Addressable address) {
MessageSearchQuery msq = createMessageSearchQuery(null, address, null, t);
V4MessageList out = messageApi.v1MessageSearchPost(msq, null, null, 0, 1, null, null);
return convertToOptionalEntityJson(out);
}
Aggregations