Package io.agora.rtm
Class RtmLock
java.lang.Object
io.agora.rtm.RtmLock
The RtmLock class.
This class provides the rtm lock methods that can be invoked by your app.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidacquireLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, boolean retry, ResultCallback<Void> resultCallback) acquires a lockabstract voidgetLocks(String channelName, RtmConstants.RtmChannelType channelType, ResultCallback<ArrayList<LockDetail>> resultCallback) gets locks in the channel.abstract voidreleaseLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, ResultCallback<Void> resultCallback) releases a lockabstract voidremoveLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, ResultCallback<Void> resultCallback) removes a lock.abstract voidrevokeLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, String owner, ResultCallback<Void> resultCallback) disables a lockabstract voidsetLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, long ttl, ResultCallback<Void> resultCallback) sets a lock.
-
Constructor Details
-
RtmLock
public RtmLock()
-
-
Method Details
-
setLock
public abstract void setLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, long ttl, ResultCallback<Void> resultCallback) sets a lock.- Parameters:
channelName- The name of the channel.channelType- The type of the channel.lockName- The name of the lock.ttl- The lock ttl.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
getLocks
public abstract void getLocks(String channelName, RtmConstants.RtmChannelType channelType, ResultCallback<ArrayList<LockDetail>> resultCallback) gets locks in the channel.- Parameters:
channelName- The name of the channel.channelType- The type of the channel.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
removeLock
public abstract void removeLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, ResultCallback<Void> resultCallback) removes a lock.- Parameters:
channelName- The name of the channel.channelType- The type of the channel.lockName- The name of the lock.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
acquireLock
public abstract void acquireLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, boolean retry, ResultCallback<Void> resultCallback) acquires a lock- Parameters:
channelName- The name of the channel.channelType- The type of the channel.lockName- The name of the lock.retry- Whether to automatically retry when acquires lock failedresultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
releaseLock
public abstract void releaseLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, ResultCallback<Void> resultCallback) releases a lock- Parameters:
channelName- The name of the channel.channelType- The type of the channel.lockName- The name of the lock.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-
revokeLock
public abstract void revokeLock(String channelName, RtmConstants.RtmChannelType channelType, String lockName, String owner, ResultCallback<Void> resultCallback) disables a lock- Parameters:
channelName- The name of the channel.channelType- The type of the channel.lockName- The name of the lock.owner- The lock owner.resultCallback- AResultCallbackobject. - Success: will receives theResultCallback.onSuccess(Object)callback. - Failure: will receives theResultCallback.onFailure(ErrorInfo)callback.
-