@Operation(httpMethods = "GET") public Future<?> get(SocialRequestItem request) throws ProtocolException { Set<UserId> userIds = request.getUsers(); String msgCollId = request.getParameter("msgCollId"); List<String> messageIds = request.getListParameter("messageIds"); CollectionOptions options = collectionOptionsFactory.create(request); HandlerPreconditions.requireNotEmpty(userIds, "No userId specified"); HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported"); UserId user = request.getUsers().iterator().next(); if (msgCollId == null) { // No message collection specified, return list of message collections Set<String> fields = request.getFields(MessageCollection.Field.ALL_FIELDS); return service.getMessageCollections(user, fields, options, request.getToken()); } // If messageIds are specified return them, otherwise return entries in the given collection. Set<String> fields = request.getFields(Message.Field.ALL_FIELDS); return service.getMessages(user, msgCollId, fields, messageIds, options, request.getToken()); }
@Operation(httpMethods = "GET") public Future<?> get(SocialRequestItem request) throws ProtocolException { Set<UserId> userIds = request.getUsers(); String msgCollId = request.getParameter("msgCollId"); List<String> messageIds = request.getListParameter("messageIds"); CollectionOptions options = collectionOptionsFactory.create(request); HandlerPreconditions.requireNotEmpty(userIds, "No userId specified"); HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported"); UserId user = request.getUsers().iterator().next(); if (msgCollId == null) { // No message collection specified, return list of message collections Set<String> fields = request.getFields(MessageCollection.Field.ALL_FIELDS); return service.getMessageCollections(user, fields, options, request.getToken()); } // If messageIds are specified return them, otherwise return entries in the given collection. Set<String> fields = request.getFields(Message.Field.ALL_FIELDS); return service.getMessages(user, msgCollId, fields, messageIds, options, request.getToken()); }
@Operation(httpMethods = "GET") public Future<?> get(SocialRequestItem request) throws ProtocolException { Set<UserId> userIds = request.getUsers(); String msgCollId = request.getParameter("msgCollId"); List<String> messageIds = request.getListParameter("messageIds"); CollectionOptions options = new CollectionOptions(request); HandlerPreconditions.requireNotEmpty(userIds, "No userId specified"); HandlerPreconditions.requireSingular(userIds, "Multiple userIds not supported"); UserId user = request.getUsers().iterator().next(); if (msgCollId == null) { // No message collection specified, return list of message collections Set<String> fields = request.getFields(MessageCollection.Field.ALL_FIELDS); return service.getMessageCollections(user, fields, options, request.getToken()); } // If messageIds are specified return them, otherwise return entries in the given collection. Set<String> fields = request.getFields(Message.Field.ALL_FIELDS); return service.getMessages(user, msgCollId, fields, messageIds, options, request.getToken()); }