Replaced MessageCache by Cache<T>
This class will be used to implement the offline cache for both messages and events.
This commit is contained in:
@@ -10,6 +10,7 @@ import java.util.logging.Logger;
|
||||
import javax.naming.TimeLimitExceededException;
|
||||
|
||||
import envoy.client.Config;
|
||||
import envoy.client.data.Cache;
|
||||
import envoy.client.data.LocalDb;
|
||||
import envoy.client.util.EnvoyLog;
|
||||
import envoy.data.*;
|
||||
@@ -61,7 +62,7 @@ public class Client implements Closeable {
|
||||
* failed for some other reason
|
||||
* @since Envoy v0.2-alpha
|
||||
*/
|
||||
public MessageCache onlineInit(LoginCredentials credentials, LocalDb localDb) throws Exception {
|
||||
public Cache<Message> onlineInit(LoginCredentials credentials, LocalDb localDb) throws Exception {
|
||||
// Establish TCP connection
|
||||
logger.info(String.format("Attempting connection to server %s:%d...", config.getServer(), config.getPort()));
|
||||
socket = new Socket(config.getServer(), config.getPort());
|
||||
@@ -71,7 +72,7 @@ public class Client implements Closeable {
|
||||
receiver = new Receiver(socket.getInputStream());
|
||||
|
||||
// Create cache for unread messages
|
||||
final MessageCache cache = new MessageCache();
|
||||
final Cache<Message> cache = new Cache<>();
|
||||
|
||||
// Register user creation processor, contact list processor and message cache
|
||||
receiver.registerProcessor(User.class, sender -> { logger.info("Acquired user object " + sender); this.sender = sender; });
|
||||
|
Reference in New Issue
Block a user