Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtm.RtmLock Class Referenceabstract

Public Member Functions

abstract void setLock (String channelName, RtmChannelType channelType, String lockName, long ttl, ResultCallback< Void > resultCallback)
 
abstract void getLocks (String channelName, RtmChannelType channelType, ResultCallback< ArrayList< LockDetail >> resultCallback)
 
abstract void removeLock (String channelName, RtmChannelType channelType, String lockName, ResultCallback< Void > resultCallback)
 
abstract void acquireLock (String channelName, RtmChannelType channelType, String lockName, boolean retry, ResultCallback< Void > resultCallback)
 
abstract void releaseLock (String channelName, RtmChannelType channelType, String lockName, ResultCallback< Void > resultCallback)
 
abstract void revokeLock (String channelName, RtmChannelType channelType, String lockName, String owner, ResultCallback< Void > resultCallback)
 

Detailed Description

The RtmLock class.

This class provides the rtm lock methods that can be invoked by your app.

Member Function Documentation

◆ setLock()

abstract void io.agora.rtm.RtmLock.setLock ( String  channelName,
RtmChannelType  channelType,
String  lockName,
long  ttl,
ResultCallback< Void >  resultCallback 
)
abstract

sets a lock.

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
ttlThe lock ttl.
resultCallbackA ResultCallback object.

◆ getLocks()

abstract void io.agora.rtm.RtmLock.getLocks ( String  channelName,
RtmChannelType  channelType,
ResultCallback< ArrayList< LockDetail >>  resultCallback 
)
abstract

gets locks in the channel.

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
resultCallbackA ResultCallback object.

◆ removeLock()

abstract void io.agora.rtm.RtmLock.removeLock ( String  channelName,
RtmChannelType  channelType,
String  lockName,
ResultCallback< Void >  resultCallback 
)
abstract

removes a lock.

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
resultCallbackA ResultCallback object.

◆ acquireLock()

abstract void io.agora.rtm.RtmLock.acquireLock ( String  channelName,
RtmChannelType  channelType,
String  lockName,
boolean  retry,
ResultCallback< Void >  resultCallback 
)
abstract

acquires a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
retryWhether to automatically retry when acquires lock failed
resultCallbackA ResultCallback object.

◆ releaseLock()

abstract void io.agora.rtm.RtmLock.releaseLock ( String  channelName,
RtmChannelType  channelType,
String  lockName,
ResultCallback< Void >  resultCallback 
)
abstract

releases a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
resultCallbackA ResultCallback object.

◆ revokeLock()

abstract void io.agora.rtm.RtmLock.revokeLock ( String  channelName,
RtmChannelType  channelType,
String  lockName,
String  owner,
ResultCallback< Void >  resultCallback 
)
abstract

disables a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
ownerThe lock owner.
resultCallbackA ResultCallback object.