public abstract class RemoteChangesClientBase<TChangesApi extends IConnectableChanges,TConnectionState extends IChangesConnectionState> extends Object implements CleanCloseable, IObserver<String>, IConnectableChanges
Modifier and Type | Field and Description |
---|---|
protected Convention |
conventions |
protected AtomicDictionary<DatabaseConnectionState> |
counters |
protected static ILog |
logger |
Constructor and Description |
---|
RemoteChangesClientBase(String url,
String apiKey,
HttpJsonRequestFactory jsonRequestFactory,
Convention conventions,
IReplicationInformerBase replicationInformer,
Action0 onDispose) |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionStatusChanged(EventHandler<VoidArgs> handler) |
protected void |
clientSideHeartbeat() |
void |
close() |
void |
establishConnection() |
boolean |
isConnected() |
protected void |
logOnConnectionStatusChanged(Object sender,
EventArgs eventArgs) |
protected abstract void |
notifySubscribers(String type,
RavenJObject value,
Iterable<Map.Entry<String,DatabaseConnectionState>> counters) |
void |
onCompleted() |
void |
onError(Exception error) |
void |
onNext(String dataFromConnection) |
void |
removeConnectionStatusChanges(EventHandler<VoidArgs> handler) |
protected void |
send(String command,
String value) |
protected abstract void |
subscribeOnServer() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
waitForAllPendingSubscriptions
protected static final ILog logger
protected final Convention conventions
protected final AtomicDictionary<DatabaseConnectionState> counters
public RemoteChangesClientBase(String url, String apiKey, HttpJsonRequestFactory jsonRequestFactory, Convention conventions, IReplicationInformerBase replicationInformer, Action0 onDispose)
public void addConnectionStatusChanged(EventHandler<VoidArgs> handler)
addConnectionStatusChanged
in interface IConnectableChanges
public void removeConnectionStatusChanges(EventHandler<VoidArgs> handler)
removeConnectionStatusChanges
in interface IConnectableChanges
public boolean isConnected()
isConnected
in interface IConnectableChanges
protected void logOnConnectionStatusChanged(Object sender, EventArgs eventArgs)
public void establishConnection()
protected void clientSideHeartbeat()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface CleanCloseable
public void onNext(String dataFromConnection)
protected abstract void notifySubscribers(String type, RavenJObject value, Iterable<Map.Entry<String,DatabaseConnectionState>> counters)
protected abstract void subscribeOnServer()
public void onCompleted()
onCompleted
in interface IObserver<String>
Copyright © 2016. All Rights Reserved.