Class AbstractRemoteClient<M extends com.google.protobuf.Message>
- Type Parameters:
M-
- All Implemented Interfaces:
RPCRemote<M>,org.openbase.jul.extension.type.iface.TransactionIdProvider,org.openbase.jul.iface.Activatable,org.openbase.jul.iface.Lockable,org.openbase.jul.iface.provider.PingProvider,org.openbase.jul.iface.Shutdownable,org.openbase.jul.pattern.controller.Remote<M>,org.openbase.jul.pattern.provider.DataProvider<M>
- Direct Known Subclasses:
AbstractIdentifiableRemote
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openbase.jul.iface.Shutdownable
org.openbase.jul.iface.Shutdownable.ShutdownDaemon -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longprotected final org.slf4j.Loggerprotected Objectstatic final longstatic final longstatic final doublestatic final longstatic final longstatic final longstatic final longstatic final longprotected org.openbase.type.communication.ScopeType.ScopeFields inherited from interface org.openbase.jul.extension.type.iface.TransactionIdProvider
TRANSACTION_ID_FIELD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()voidactivate(boolean waitForData) voidvoidaddConnectionStateObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.controller.Remote<?>, org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State> observer) voidaddDataObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.provider.DataProvider<M>, M> observer) voidaddHandler(kotlin.jvm.functions.Function2<org.openbase.type.communication.EventType.Event, Map<String, String>, kotlin.Unit> handler, boolean wait) Method adds an handler to the internal subscriber.protected MapplyEventUpdate(org.openbase.type.communication.EventType.Event event, Map<String, String> userProperties) <R> RcallMethod(String methodName, Class<R> returnClazz) Method synchronously calls the given method without any arguments on the main controller.<R> RcallMethod(String methodName, Class<R> returnClazz, long timeout) Method synchronously calls the given method on the main controller.<R,T> R callMethod(String methodName, Class<R> returnClazz, T argument) Method synchronously calls the given method on the main controller.<R,T> R callMethod(String methodName, Class<R> returnClazz, T argument, long timeout) Method synchronously calls the given method on the main controller.<R> Future<org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz) Method asynchronously calls the given method without any arguments on the main controller.<R,T> Future <org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz, T argument) Method asynchronously calls the given method on the main controller.voidvoiddeactivate(Object maintainer) Atomic deactivate which makes sure that the maintainer stays the same.protected kotlin.jvm.functions.Function2<org.openbase.type.communication.EventType.Event, Map<String, String>, kotlin.Unit> org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.StategetData()protected final ObjectgetDataField(String name) This observable notifies sequentially and prior to the normal dataObserver.getPing()Method returns the result of the latest connection ping between this remote and its main controller.protected org.openbase.jul.communication.iface.RPCClientorg.openbase.type.communication.ScopeType.ScopegetScope()Method returns the scope of this remote connection.longGet the latest transaction id.protected final booleanhasDataField(String name) voidInitialize the remote on a scope.voidinit(org.openbase.type.communication.ScopeType.Scope scope) Initialize the remote on the given scope.voidinit(org.openbase.type.communication.ScopeType.Scope scope, org.openbase.jul.communication.config.CommunicatorConfig communicatorConfig) Initialize the remote on the given scope.booleanisActive()booleanbooleanbooleanisLocked()booleanvoidping()protected voidpostInit()Method is called after communication initialization.protected voidreinit()Method reinitialize this remote.voidMethod reinitialize this remote.protected voidreinit(org.openbase.type.communication.ScopeType.Scope scope) Method reinitialize this remote.voidMethod reinitialize this remote.voidremoveConnectionStateObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.controller.Remote<?>, org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State> observer) voidremoveDataObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.provider.DataProvider<M>, M> observer) voidreset()protected voidprotected voidprotected voidsetMessageProcessor(org.openbase.jul.extension.protobuf.processing.MessageProcessor<com.google.protobuf.Message, M> messageProcessor) voidshutdown()This method deactivates the remote and cleans all resources.toString()Method prints a class instance representation.voidMethod unlocks this instance.voidbooleanvalidateAndUpdateEventTimestamp(Map<String, String> userProperties) voidvoidvoidvoidvoidwaitForConnectionState(org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State connectionState) Method blocks until the remote reaches the desired connection state.voidwaitForConnectionState(org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State connectionState, long timeout) Method blocks until the remote reaches the desired connection state.voidvoidwaitForData(long timeout, TimeUnit timeUnit) voidvoidwaitForMiddleware(long timeout, TimeUnit timeUnit) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openbase.jul.pattern.controller.Remote
getDataFuture
-
Field Details
-
REQUEST_TIMEOUT
public static final long REQUEST_TIMEOUT -
PING_TIMEOUT
public static final long PING_TIMEOUT -
PING_TEST_TIMEOUT
public static final long PING_TEST_TIMEOUT -
CONNECTION_TIMEOUT
public static final long CONNECTION_TIMEOUT -
RECONNECT_AFTER_CONNECTION_LOST_DELAY_OFFSET
public static final long RECONNECT_AFTER_CONNECTION_LOST_DELAY_OFFSET- See Also:
-
RECONNECT_AFTER_CONNECTION_LOST_DELAY_SEED
public static final long RECONNECT_AFTER_CONNECTION_LOST_DELAY_SEED- See Also:
-
METHOD_CALL_START_TIMEOUT
public static final long METHOD_CALL_START_TIMEOUT- See Also:
-
METHOD_CALL_TIMEOUT_MULTIPLIER
public static final double METHOD_CALL_TIMEOUT_MULTIPLIER- See Also:
-
METHOD_CALL_MAX_TIMEOUT
public static final long METHOD_CALL_MAX_TIMEOUT -
logger
protected final org.slf4j.Logger logger -
maintainer
-
scope
protected org.openbase.type.communication.ScopeType.Scope scope
-
-
Constructor Details
-
AbstractRemoteClient
-
-
Method Details
-
setMessageProcessor
protected void setMessageProcessor(org.openbase.jul.extension.protobuf.processing.MessageProcessor<com.google.protobuf.Message, M> messageProcessor) -
init
public void init(org.openbase.type.communication.ScopeType.Scope scope) throws org.openbase.jul.exception.InitializationException, InterruptedException Initialize the remote on the given scope.- Specified by:
initin interfaceRPCRemote<M extends com.google.protobuf.Message>- Parameters:
scope- the scope where the remote communicates- Throws:
org.openbase.jul.exception.InitializationException- if the initialization failsInterruptedException- if the initialization is interrupted
-
init
public void init(String scope) throws org.openbase.jul.exception.InitializationException, InterruptedException Initialize the remote on a scope.- Specified by:
initin interfaceRPCRemote<M extends com.google.protobuf.Message>- Parameters:
scope- the scope where the remote communicates- Throws:
org.openbase.jul.exception.InitializationException- if the initialization failsInterruptedException- if the initialization is interrupted
-
postInit
protected void postInit() throws org.openbase.jul.exception.InitializationException, InterruptedExceptionMethod is called after communication initialization. You can overwrite this method to trigger any component specific initialization.- Throws:
org.openbase.jul.exception.InitializationExceptionInterruptedException
-
init
public void init(org.openbase.type.communication.ScopeType.Scope scope, org.openbase.jul.communication.config.CommunicatorConfig communicatorConfig) throws org.openbase.jul.exception.InitializationException, InterruptedException Initialize the remote on the given scope.- Specified by:
initin interfaceRPCRemote<M extends com.google.protobuf.Message>- Parameters:
scope- the scope where the remote communicatescommunicatorConfig- the rsb communicator config which should be used for the connection.- Throws:
org.openbase.jul.exception.InitializationException- if the initialization failsInterruptedException- if the initialization is interrupted
-
verifyMaintainability
public void verifyMaintainability() throws org.openbase.jul.exception.VerificationFailedException- Specified by:
verifyMaintainabilityin interfaceorg.openbase.jul.iface.Lockable
-
isLocked
public boolean isLocked()- Specified by:
isLockedin interfaceorg.openbase.jul.iface.Lockable- Returns:
-
lock
- Specified by:
lockin interfaceorg.openbase.jul.iface.Lockable
-
unlock
Method unlocks this instance.- Specified by:
unlockin interfaceorg.openbase.jul.iface.Lockable- Parameters:
maintainer- the instance which currently holds the lock.- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown if the instance could not be unlocked.
-
getDataClass
-
addHandler
public void addHandler(kotlin.jvm.functions.Function2<org.openbase.type.communication.EventType.Event, Map<String, throws InterruptedException, org.openbase.jul.exception.CouldNotPerformExceptionString>, kotlin.Unit> handler, boolean wait) Method adds an handler to the internal subscriber.- Parameters:
handler-wait-- Throws:
InterruptedExceptionorg.openbase.jul.exception.CouldNotPerformException
-
generateHandler
-
activate
public void activate() throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException- Specified by:
activatein interfaceorg.openbase.jul.iface.Activatable
-
activate
public void activate(boolean waitForData) throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException - Specified by:
activatein interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>
-
activate
public void activate(Object maintainer) throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException - Specified by:
activatein interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>
-
deactivate
public void deactivate(Object maintainer) throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException, org.openbase.jul.exception.VerificationFailedException Atomic deactivate which makes sure that the maintainer stays the same.- Parameters:
maintainer- the current maintainer of this remote- Throws:
InterruptedException- if deactivation is interruptedorg.openbase.jul.exception.CouldNotPerformException- if deactivation failsorg.openbase.jul.exception.VerificationFailedException- is thrown if the given maintainer does not match the current one
-
deactivate
public void deactivate() throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException- Specified by:
deactivatein interfaceorg.openbase.jul.iface.Activatable
-
reset
public void reset() throws org.openbase.jul.exception.CouldNotPerformException- Throws:
org.openbase.jul.exception.CouldNotPerformException
-
reinit
protected void reinit() throws InterruptedException, org.openbase.jul.exception.CouldNotPerformExceptionMethod reinitialize this remote. If the remote was previously active the activation state will be recovered. This method can be used in case of a broken connection or if the communicator config has been changed.Note: After reinit the data remains the same but a new sync task is created. So to make sure to have new data it is necessary to call
requestData.get().- Throws:
InterruptedException- is thrown if the current thread was externally interrupted.org.openbase.jul.exception.CouldNotPerformException- is throws if the reinit has been failed.
-
reinit
protected void reinit(org.openbase.type.communication.ScopeType.Scope scope) throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException Method reinitialize this remote. If the remote was previously active the activation state will be recovered. This method can be used in case of a broken connection or if the communicator config has been changed.Note: After reinit the data remains the same but a new sync task is created. So to make sure to have new data it is necessary to call
requestData.get().- Parameters:
scope- the new scope to configure.- Throws:
InterruptedException- is thrown if the current thread was externally interrupted.org.openbase.jul.exception.CouldNotPerformException- is throws if the reinit has been failed.
-
reinit
public void reinit(Object maintainer) throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException, org.openbase.jul.exception.VerificationFailedException Method reinitialize this remote. If the remote was previously active the activation state will be recovered. This method can be used in case of a broken connection or if the communicator config has been changed.Note: After reinit the data remains the same but a new sync task is created. So to make sure to have new data it is necessary to call
requestData.get().- Parameters:
maintainer- the current maintainer of this remote- Throws:
InterruptedException- is thrown if the current thread was externally interrupted.org.openbase.jul.exception.CouldNotPerformException- is throws if the reinit has been failed.org.openbase.jul.exception.VerificationFailedException- is thrown if the given maintainerLock does not match the current maintainer
-
reinit
public void reinit(org.openbase.type.communication.ScopeType.Scope scope, Object maintainer) throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException, org.openbase.jul.exception.VerificationFailedException Method reinitialize this remote. If the remote was previously active the activation state will be recovered. This method can be used in case of a broken connection or if the communicator config has been changed.Note: After reinit the data remains the same but a new sync task is created. So to make sure to have new data it is necessary to call
requestData.get().- Parameters:
scope- the new scope to configure.maintainer- the current maintainer of this remote- Throws:
InterruptedException- is thrown if the current thread was externally interrupted.org.openbase.jul.exception.CouldNotPerformException- is throws if the reinit has been failed.org.openbase.jul.exception.VerificationFailedException- is thrown if the given maintainerLock does not match the current maintainer
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>
-
getConnectionState
public org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State getConnectionState()- Specified by:
getConnectionStatein interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceorg.openbase.jul.iface.Activatable
-
callMethodAsync
public <R> Future<org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz) Method asynchronously calls the given method without any arguments on the main controller.- Specified by:
callMethodAsyncin interfaceRPCRemote<M extends com.google.protobuf.Message>- Type Parameters:
R- the return type of the method declaration.- Parameters:
methodName- the method name.- Returns:
- a future instance which gives feedback about the asynchronously method call and when the result is available.
-
callMethod
public <R> R callMethod(String methodName, Class<R> returnClazz) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException Method synchronously calls the given method without any arguments on the main controller.The method call will block until the call is successfully processed. Even if the main controller instance is currently not reachable, successively retry will be triggered. The only way to cancel the call is an externally interruption of the invoking thread.
- Specified by:
callMethodin interfaceRPCRemote<M extends com.google.protobuf.Message>- Type Parameters:
R- the return type of the method declaration.- Parameters:
methodName- the method name.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethod
public <R,T> R callMethod(String methodName, Class<R> returnClazz, T argument) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException Method synchronously calls the given method on the main controller.The method call will block until the call is successfully processed. Even if the main controller instance is currently not reachable, successively retry will be triggered. The only way to cancel the call is an externally interruption of the invoking thread.
- Specified by:
callMethodin interfaceRPCRemote<M extends com.google.protobuf.Message>- Type Parameters:
R- the return type of the method declaration.T- the argument type of the method.- Parameters:
methodName- the method name.argument- the method argument.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethod
public <R> R callMethod(String methodName, Class<R> returnClazz, long timeout) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException Method synchronously calls the given method on the main controller.The method call will block until the call is successfully processed or the given timeout is expired. Even if the main controller instance is currently not reachable, successively retry will be triggered.
- Specified by:
callMethodin interfaceRPCRemote<M extends com.google.protobuf.Message>- Type Parameters:
R- the return type of the method declaration.- Parameters:
methodName- the method name.timeout- the RPC call timeout in milliseconds.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethod
public <R,T> R callMethod(String methodName, Class<R> returnClazz, T argument, long timeout) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException Method synchronously calls the given method on the main controller.The method call will block until the call is successfully processed or the given timeout is expired. Even if the main controller instance is currently not reachable, successively retry will be triggered.
- Specified by:
callMethodin interfaceRPCRemote<M extends com.google.protobuf.Message>- Type Parameters:
R- the return type of the method declaration.T- the argument type of the method.- Parameters:
methodName- the method name.argument- the method argument.timeout- the RPC call timeout in milliseconds.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethodAsync
public <R,T> Future<org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz, T argument) Method asynchronously calls the given method on the main controller.- Specified by:
callMethodAsyncin interfaceRPCRemote<M extends com.google.protobuf.Message>- Type Parameters:
R- the return type of the method declaration.T- the argument type of the method.- Parameters:
methodName- the method name.argument- the method argument.- Returns:
- a future instance which gives feedback about the asynchronously method call and when the result is available.
-
requestData
- Specified by:
requestDatain interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>- Returns:
-
getRpcClient
protected org.openbase.jul.communication.iface.RPCClient getRpcClient() -
internalRequestStatus
-
applyEventUpdate
protected M applyEventUpdate(org.openbase.type.communication.EventType.Event event, Map<String, String> userProperties) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException- Throws:
org.openbase.jul.exception.CouldNotPerformExceptionInterruptedException
-
validateAndUpdateEventTimestamp
public boolean validateAndUpdateEventTimestamp(Map<String, String> userProperties) throws org.openbase.jul.exception.CouldNotPerformException- Throws:
org.openbase.jul.exception.CouldNotPerformException
-
shutdown
public void shutdown()This method deactivates the remote and cleans all resources.- Specified by:
shutdownin interfaceorg.openbase.jul.iface.Shutdownable
-
getData
-
setData
-
isDataAvailable
public boolean isDataAvailable()- Specified by:
isDataAvailablein interfaceorg.openbase.jul.pattern.provider.DataProvider<M extends com.google.protobuf.Message>- Returns:
-
waitForData
public void waitForData() throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException -
waitForData
public void waitForData(long timeout, TimeUnit timeUnit) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException -
getDataField
protected final Object getDataField(String name) throws org.openbase.jul.exception.CouldNotPerformException - Throws:
org.openbase.jul.exception.CouldNotPerformException
-
hasDataField
protected final boolean hasDataField(String name) throws org.openbase.jul.exception.CouldNotPerformException - Throws:
org.openbase.jul.exception.CouldNotPerformException
-
validateInitialization
public void validateInitialization() throws org.openbase.jul.exception.InvalidStateException- Throws:
org.openbase.jul.exception.InvalidStateException
-
validateActivation
public void validateActivation() throws org.openbase.jul.exception.InvalidStateException- Throws:
org.openbase.jul.exception.InvalidStateException
-
validateMiddleware
public void validateMiddleware() throws org.openbase.jul.exception.InvalidStateException- Throws:
org.openbase.jul.exception.InvalidStateException
-
validateData
public void validateData() throws org.openbase.jul.exception.InvalidStateException- Specified by:
validateDatain interfaceorg.openbase.jul.pattern.provider.DataProvider<M extends com.google.protobuf.Message>- Throws:
org.openbase.jul.exception.InvalidStateException
-
waitForMiddleware
public void waitForMiddleware() throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException- Throws:
org.openbase.jul.exception.CouldNotPerformExceptionInterruptedException
-
waitForMiddleware
public void waitForMiddleware(long timeout, TimeUnit timeUnit) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException - Throws:
org.openbase.jul.exception.CouldNotPerformExceptionInterruptedException
-
waitForConnectionState
public void waitForConnectionState(org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State connectionState, long timeout) throws InterruptedException, org.openbase.jul.exception.TimeoutException, org.openbase.jul.exception.CouldNotPerformException Method blocks until the remote reaches the desired connection state. In case the timeout is expired an TimeoutException will be thrown.- Specified by:
waitForConnectionStatein interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>- Parameters:
connectionState- the desired connection statetimeout- the timeout in milliseconds until the method throw a TimeoutException in case the connection state was not reached.- Throws:
InterruptedException- is thrown in case the thread is externally interrupted.org.openbase.jul.exception.TimeoutException- is thrown in case the timeout is expired without reaching the connection state.org.openbase.jul.exception.CouldNotPerformException- is thrown in case the connection state does not match and the shutdown of this remote has been initialized
-
waitForConnectionState
public void waitForConnectionState(org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State connectionState) throws InterruptedException, org.openbase.jul.exception.CouldNotPerformException Method blocks until the remote reaches the desired connection state.- Parameters:
connectionState- the desired connection state- Throws:
InterruptedException- is thrown in case the thread is externally interrupted.org.openbase.jul.exception.CouldNotPerformException- is thrown in case the the remote is not active and the waiting condition is based on ConnectionState.State CONNECTED or CONNECTING.
-
getScope
public org.openbase.type.communication.ScopeType.Scope getScope() throws org.openbase.jul.exception.NotAvailableExceptionMethod returns the scope of this remote connection. -
getInternalPrioritizedDataObservable
protected org.openbase.jul.pattern.Observable<org.openbase.jul.pattern.provider.DataProvider<M>,M> getInternalPrioritizedDataObservable()This observable notifies sequentially and prior to the normal dataObserver. It should be used by remote services which need to do some things before external objects are notified.- Returns:
- the internal prioritized data observable.
-
addDataObserver
public void addDataObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.provider.DataProvider<M>, M> observer) - Specified by:
addDataObserverin interfaceorg.openbase.jul.pattern.provider.DataProvider<M extends com.google.protobuf.Message>
-
removeDataObserver
public void removeDataObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.provider.DataProvider<M>, M> observer) - Specified by:
removeDataObserverin interfaceorg.openbase.jul.pattern.provider.DataProvider<M extends com.google.protobuf.Message>
-
addConnectionStateObserver
public void addConnectionStateObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.controller.Remote<?>, org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State> observer) - Specified by:
addConnectionStateObserverin interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>
-
removeConnectionStateObserver
public void removeConnectionStateObserver(org.openbase.jul.pattern.Observer<org.openbase.jul.pattern.controller.Remote<?>, org.openbase.type.domotic.state.ConnectionStateType.ConnectionState.State> observer) - Specified by:
removeConnectionStateObserverin interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>
-
ping
- Specified by:
pingin interfaceorg.openbase.jul.iface.provider.PingProvider- Specified by:
pingin interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>- Returns:
-
getPing
Method returns the result of the latest connection ping between this remote and its main controller.- Specified by:
getPingin interfaceorg.openbase.jul.iface.provider.PingProvider- Specified by:
getPingin interfaceorg.openbase.jul.pattern.controller.Remote<M extends com.google.protobuf.Message>- Returns:
- the latest connection delay in milliseconds.
-
toString
Method prints a class instance representation. -
getTransactionId
public long getTransactionId() throws org.openbase.jul.exception.NotAvailableExceptionGet the latest transaction id. It will be updated every time after prioritized observers are notified.- Specified by:
getTransactionIdin interfaceorg.openbase.jul.extension.type.iface.TransactionIdProvider- Returns:
- the latest transaction id.
- Throws:
org.openbase.jul.exception.NotAvailableException- if no data has been received yet
-
isSyncRunning
public boolean isSyncRunning() -
restartSyncTask
protected void restartSyncTask() throws org.openbase.jul.exception.CouldNotPerformException- Throws:
org.openbase.jul.exception.CouldNotPerformException
-