Class MessageStore<TYPE extends org.teamapps.protocol.schema.MessageObject>
java.lang.Object
org.teamapps.universaldb.index.log.MessageStore<TYPE>
public class MessageStore<TYPE extends org.teamapps.protocol.schema.MessageObject>
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description MessageStore(java.io.File path, java.lang.String name, boolean withFileStore, org.teamapps.protocol.schema.PojoObjectDecoder<TYPE> pojoObjectDecoder, java.util.function.BiConsumer<TYPE,java.lang.Integer> messageIdHandler, java.util.function.Function<TYPE,java.lang.Integer> messageToIdFunction) -
Method Summary
Modifier and Type Method Description intaddMessage(TYPE message)voidclose()voiddeleteMessage(int id)voiddeleteMessage(TYPE message)voiddrop()intgetMessageCount()longgetStoreSize()java.util.List<TYPE>readAfterMessageId(int messageId)java.util.List<TYPE>readAfterMessageId(int messageId, int maxMessages)java.util.List<TYPE>readAllMessages()java.util.List<TYPE>readBeforeMessageId(int messageId, int messageCount)java.util.List<TYPE>readLastMessages(int messageCount)TYPEreadMessage(int id)voidsaveMessage(TYPE message)voidundeleteMessage(int id)voidundeleteMessage(TYPE message)voidupdateMessage(TYPE message)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MessageStore
public MessageStore(java.io.File path, java.lang.String name, boolean withFileStore, org.teamapps.protocol.schema.PojoObjectDecoder<TYPE> pojoObjectDecoder, java.util.function.BiConsumer<TYPE,java.lang.Integer> messageIdHandler, java.util.function.Function<TYPE,java.lang.Integer> messageToIdFunction)
-
-
Method Details
-
getMessageCount
public int getMessageCount() -
getStoreSize
public long getStoreSize() -
saveMessage
-
addMessage
-
updateMessage
-
deleteMessage
-
deleteMessage
public void deleteMessage(int id) -
undeleteMessage
-
undeleteMessage
public void undeleteMessage(int id) -
readMessage
-
readLastMessages
-
readAfterMessageId
-
readAfterMessageId
-
readBeforeMessageId
-
readAllMessages
-
close
public void close() -
drop
public void drop()
-