Interface MessageService
-
- All Known Implementing Classes:
MessageServiceImpl
public interface MessageService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddAttachmentToMessageByLoggedUser(java.lang.String messageId, Attachment attachment)Adds attachment to message.java.util.Optional<Chat>clearActiveUsers(java.lang.String chatId)This method returns a database entity.java.util.Optional<Chat>closeChat(java.lang.String chatId)This method returns a database entity.java.util.Optional<Chat>createChat(Chat chat)This method creates a database entity.java.util.Optional<Chat>createChat(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chatAsMap)This method creates a database entity.java.util.Optional<Chat>createChatAndNotify(Chat chat)This method creates a database entity.java.util.Optional<Chat>createChatAndNotify(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chatAsMap)This method creates a database entity.java.util.Optional<Message>createMessage(Message message)This method creates a database entity.java.util.Optional<Message>createMessage(java.util.LinkedHashMap<java.lang.String,java.lang.Object> messageAsMap)This method creates a database entity.java.util.Optional<Message>createMessageAndNotify(Message message)This method creates a database entity.java.util.Optional<Message>createMessageAndNotify(java.util.LinkedHashMap<java.lang.String,java.lang.Object> messageAsMap)This method creates a database entity.java.util.List<Profile>getActiveContacts(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)This method returns list database entities.java.util.List<Attachment>getChatDocumentUrls(java.lang.String chatId, java.lang.String sellerId)This method returns data as list.java.util.List<Message>getConversationByChatId(java.lang.String chatId)This method returns list database entities.java.util.Map<java.lang.String,java.lang.Object>getConversationPartner(java.lang.String chatId)This method returns data as map.MessagegetLastMessageInChat(java.lang.String chatId)This method returns a database entity.java.util.Map<java.lang.String,java.lang.Object>getMessagesCountByChat(java.lang.String chatId)This method does return count a database entities.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>getMessagesTimeline(java.lang.String queryExpression, java.lang.String searchTerm, java.lang.String sortName, java.lang.Integer offset, java.lang.Integer limit)This method retrieves a map, which can be processed in a templates.java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>getPaginationChats(java.lang.String requestJson)This method does calculation for a pages based on the request.java.util.Map<java.lang.String,java.lang.String>getUnreadMessagesCount(java.lang.String chatId)This method does return count a database entities.java.util.Map<java.lang.String,java.lang.String>getUnreadMessagesCountForLoggedUser()This method does return count a database entities.java.util.Map<java.lang.String,java.lang.String>getUnreadMessagesCountForUser(java.lang.String chatId, java.lang.String profileId)This method does return count a database entities.booleanisAttachmentExist(java.lang.String messageId)This method checks a database entity had attachment.booleanisContactOnline(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)This method does check a database entity is online.booleanisContainsInboxUnreadMessages(java.lang.String chatId)This method does check a database entity contains to other database entity.booleanisContainsUnreadMessages(java.lang.String chatId)This method does check a database entity contains to other database entity.booleanisNotContactOnline(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)This method does check a database entity is not online.booleanisReplyMessage(java.lang.String login)This method check a database entity status.booleanisRightSidedMessageAdmin(java.lang.String messageId)This method checks a database entity belongs to other database entity.booleanisSentMessage(java.lang.String login)This method check a database entity status.ChatDTOmapChatToDto(Chat chat, boolean optimal)This method does map product entity to dto objectjava.util.Optional<Chat>readChat(java.lang.String chatId)This method returns a database entity.voidremoveAttachmentFromMessage(java.lang.String messageId)This method removes relationship between database entities.booleanremoveAttachmentFromMessageByLoggedUser(java.lang.String messageId)Removes attachment from message.voidremoveChatAndClean(java.lang.String chatId)This method removes a database entity and clean all relationships from another entities.voidremoveMessageAndClean(java.lang.String messageId)This method removes a database entity and clean all relationships from another entities.voidremoveMessageFromChatById(java.lang.String messageId)This method removes database entity.voidremoveMessagesFromChat(java.lang.String chatId)This method removes relationship between database entities.java.util.LinkedHashSet<ChatDTO>searchAllChats(java.lang.String requestJson)This method does search requests and returns data as list.org.springframework.data.domain.Page<Chat>searchAllChatsPaged(java.lang.String requestJson)This method does search requests and returns data as pages.java.util.List<ChatDTO>searchChats(java.lang.String requestJson)This method does search requests and returns data as list.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>searchMessages(java.lang.String requestJson)This method retrieves a map, which can be processed in a templates.
-
-
-
Method Detail
-
getPaginationChats
java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationChats(java.lang.String requestJson)
This method does calculation for a pages based on the request.- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
searchAllChats
java.util.LinkedHashSet<ChatDTO> searchAllChats(java.lang.String requestJson)
This method does search requests and returns data as list.- Parameters:
requestJson- search request- Returns:
- data transport entities as list
-
searchAllChatsPaged
org.springframework.data.domain.Page<Chat> searchAllChatsPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.- Parameters:
requestJson- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
searchChats
java.util.List<ChatDTO> searchChats(java.lang.String requestJson)
This method does search requests and returns data as list.- Parameters:
requestJson- search json- Returns:
- database entities as list
-
searchMessages
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> searchMessages(java.lang.String requestJson)
This method retrieves a map, which can be processed in a templates.- Parameters:
requestJson- search json- Returns:
- map-representation of data
-
createChatAndNotify
java.util.Optional<Chat> createChatAndNotify(Chat chat)
This method creates a database entity.- Parameters:
chat- database entity- Returns:
- optional value to externally interaction
-
createChatAndNotify
java.util.Optional<Chat> createChatAndNotify(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chatAsMap)
This method creates a database entity.- Parameters:
chatAsMap- map-representation of database entity- Returns:
- database entity
-
createChat
java.util.Optional<Chat> createChat(Chat chat)
This method creates a database entity.- Parameters:
chat- database entity- Returns:
- optional value to externally interaction
-
createChat
java.util.Optional<Chat> createChat(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chatAsMap)
This method creates a database entity.- Parameters:
chatAsMap- map-representation of database entity- Returns:
- database entity
-
createMessageAndNotify
java.util.Optional<Message> createMessageAndNotify(Message message)
This method creates a database entity.- Parameters:
message- database entity- Returns:
- optional value to externally interaction
-
createMessageAndNotify
java.util.Optional<Message> createMessageAndNotify(java.util.LinkedHashMap<java.lang.String,java.lang.Object> messageAsMap)
This method creates a database entity.- Parameters:
messageAsMap- map-representation of database entity- Returns:
- database entity
-
createMessage
java.util.Optional<Message> createMessage(java.util.LinkedHashMap<java.lang.String,java.lang.Object> messageAsMap)
This method creates a database entity.- Parameters:
messageAsMap- map-representation of database entity- Returns:
- database entity
-
createMessage
java.util.Optional<Message> createMessage(Message message)
This method creates a database entity.- Parameters:
message- database entity- Returns:
- optional value to externally interaction
-
readChat
java.util.Optional<Chat> readChat(java.lang.String chatId)
This method returns a database entity.- Parameters:
chatId- database entity which will be checked and returned- Returns:
- optional value to externally interaction
-
closeChat
java.util.Optional<Chat> closeChat(java.lang.String chatId)
This method returns a database entity.- Parameters:
chatId- database entity which will be checked and returned- Returns:
- optional value to externally interaction
-
clearActiveUsers
java.util.Optional<Chat> clearActiveUsers(java.lang.String chatId)
This method returns a database entity.- Parameters:
chatId- database entity which will be checked and returned- Returns:
- optional value to externally interaction
-
getConversationByChatId
java.util.List<Message> getConversationByChatId(java.lang.String chatId)
This method returns list database entities.- Parameters:
chatId- identification for database entity from which will be filtered and returned other database entity- Returns:
- database entities as list
-
getActiveContacts
java.util.List<Profile> getActiveContacts(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)
This method returns list database entities.- Parameters:
dbName- name for database where will be checkedcollection- name for database collection where will be checkedpropertyName- field for database entity which will be added in JSON-Object for checkedfilter- field for database entity which will be filtered- Returns:
- database entities as list
-
getConversationPartner
java.util.Map<java.lang.String,java.lang.Object> getConversationPartner(java.lang.String chatId)
This method returns data as map.- Parameters:
chatId- identification for filter and return data- Returns:
- data as map
-
getMessagesTimeline
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getMessagesTimeline(java.lang.String queryExpression, java.lang.String searchTerm, java.lang.String sortName, java.lang.Integer offset, java.lang.Integer limit)This method retrieves a map, which can be processed in a templates.- Parameters:
queryExpression- search query expressionsearchTerm- field name for database entity which will be filtered and searchedsortName- value for database entity which will be sortedoffset- offset for returned itemslimit- limit for returned items- Returns:
- map-representation of data
-
getLastMessageInChat
Message getLastMessageInChat(java.lang.String chatId)
This method returns a database entity.- Parameters:
chatId- database entity which will be filtered and returned- Returns:
- database entity
-
isSentMessage
boolean isSentMessage(java.lang.String login)
This method check a database entity status.- Parameters:
login- identification for database entity which will be checked- Returns:
- value as boolean
-
isReplyMessage
boolean isReplyMessage(java.lang.String login)
This method check a database entity status.- Parameters:
login- identification for database entity which will be checked- Returns:
- value as boolean
-
isAttachmentExist
boolean isAttachmentExist(java.lang.String messageId)
This method checks a database entity had attachment.- Parameters:
messageId- identification for database entity which will be checked- Returns:
- value as boolean
-
removeChatAndClean
void removeChatAndClean(java.lang.String chatId)
This method removes a database entity and clean all relationships from another entities.- Parameters:
chatId- identification for database entity which will be removed
-
removeAttachmentFromMessage
void removeAttachmentFromMessage(java.lang.String messageId)
This method removes relationship between database entities.- Parameters:
messageId- identification for database entity which will be removed
-
removeMessagesFromChat
void removeMessagesFromChat(java.lang.String chatId)
This method removes relationship between database entities.- Parameters:
chatId- identification for database entity which will be removed
-
removeMessageFromChatById
void removeMessageFromChatById(java.lang.String messageId)
This method removes database entity.- Parameters:
messageId- database entity which will be removed
-
removeMessageAndClean
void removeMessageAndClean(java.lang.String messageId)
This method removes a database entity and clean all relationships from another entities.- Parameters:
messageId- identification for database entity which will be removed
-
isRightSidedMessageAdmin
boolean isRightSidedMessageAdmin(java.lang.String messageId)
This method checks a database entity belongs to other database entity.- Parameters:
messageId- identification for database entity which will be checked- Returns:
- value as boolean
-
isContainsUnreadMessages
boolean isContainsUnreadMessages(java.lang.String chatId)
This method does check a database entity contains to other database entity.- Parameters:
chatId- identification for database entity which will be checked- Returns:
- value as boolean
-
isContainsInboxUnreadMessages
boolean isContainsInboxUnreadMessages(java.lang.String chatId)
This method does check a database entity contains to other database entity.- Parameters:
chatId- identification for database entity which will be checked- Returns:
- value as boolean
-
isContactOnline
boolean isContactOnline(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)This method does check a database entity is online.- Parameters:
dbName- name for database where will be checkedcollection- name for database collection where will be checkedpropertyName- field for database entity which will be added in JSON-Object for checkedfilter- field for database entity which will be filtered- Returns:
- value as boolean
-
isNotContactOnline
boolean isNotContactOnline(java.lang.String dbName, java.lang.String collection, java.lang.String propertyName, java.lang.String filter)This method does check a database entity is not online.- Parameters:
dbName- name for database where will be checkedcollection- name for database collection where will be checkedpropertyName- field for database entity which will be added in JSON-Object for checkedfilter- field for database entity which will be filtered- Returns:
- value as boolean
-
getUnreadMessagesCount
java.util.Map<java.lang.String,java.lang.String> getUnreadMessagesCount(java.lang.String chatId)
This method does return count a database entities.- Parameters:
chatId- identification for database which will be checked and calculated- Returns:
- value as map
-
getUnreadMessagesCountForUser
java.util.Map<java.lang.String,java.lang.String> getUnreadMessagesCountForUser(java.lang.String chatId, java.lang.String profileId)This method does return count a database entities.- Parameters:
chatId- identification for database which will be checked and calculatedprofileId- identification for database for which will be checked and calculated other database entity- Returns:
- value as map
-
getUnreadMessagesCountForLoggedUser
java.util.Map<java.lang.String,java.lang.String> getUnreadMessagesCountForLoggedUser()
This method does return count a database entities.- Returns:
- value as map
-
getMessagesCountByChat
java.util.Map<java.lang.String,java.lang.Object> getMessagesCountByChat(java.lang.String chatId)
This method does return count a database entities.- Parameters:
chatId- identification for database which will be checked and calculated- Returns:
- value as map
-
mapChatToDto
ChatDTO mapChatToDto(Chat chat, boolean optimal)
This method does map product entity to dto object- Parameters:
chat- database entity which be used to map to dtooptimal- this pointer optimises the data transfer object- Returns:
- data transport object
-
addAttachmentToMessageByLoggedUser
boolean addAttachmentToMessageByLoggedUser(java.lang.String messageId, Attachment attachment)Adds attachment to message.- Parameters:
messageId- id of the orderattachment- attachment- Returns:
- success or not
-
removeAttachmentFromMessageByLoggedUser
boolean removeAttachmentFromMessageByLoggedUser(java.lang.String messageId)
Removes attachment from message.- Parameters:
messageId- id of the order- Returns:
- success or not
-
getChatDocumentUrls
java.util.List<Attachment> getChatDocumentUrls(java.lang.String chatId, java.lang.String sellerId)
This method returns data as list.- Parameters:
chatId- identification for database entity which related beans list be returnedsellerId- identification for seller entity- Returns:
- database beans as list
-
-