Class ReplicationServerRoomsService
Public API to interface with Rooms from a self-hosted Replication Server. If you wish to create, delete or fetch rooms in the coherence Cloud, you can instantiate a CloudService instead to access the CloudRooms API.
public class ReplicationServerRoomsService : IRoomsService
- Inheritance
-
ReplicationServerRoomsService
- Implements
Constructors
ReplicationServerRoomsService(string, int?, IRequestFactory, IRuntimeSettings)
public ReplicationServerRoomsService(string ip = null, int? apiPort = null, IRequestFactory requestFactory = null, IRuntimeSettings runtimeSettings = null)
Parameters
ip
stringapiPort
int?requestFactory
IRequestFactoryruntimeSettings
IRuntimeSettings
Properties
CachedRooms
List of cached Rooms that were fetched by the FetchRooms method.
public IReadOnlyList<RoomData> CachedRooms { get; }
Property Value
Methods
CreateRoom(Action<RequestResponse<RoomData>>, RoomCreationOptions)
Create a room with the given options in the Replication Server.
public void CreateRoom(Action<RequestResponse<RoomData>> onRequestFinished, RoomCreationOptions roomCreationOptions)
Parameters
onRequestFinished
Action<RequestResponse<RoomData>>Callback that will be invoked when the request finished, it includes the created room.
roomCreationOptions
RoomCreationOptionsInstance of all the room options that you wish to create the room with.
CreateRoomAsync(RoomCreationOptions)
Create a room with the given options in the Replication Server asynchronously.
public Task<RoomData> CreateRoomAsync(RoomCreationOptions roomCreationOptions)
Parameters
roomCreationOptions
RoomCreationOptionsInstance of all the room options that you wish to create the room with.
Returns
FetchRooms(Action<RequestResponse<IReadOnlyList<RoomData>>>, string[])
Fetch the available rooms in the Replication Server.
public void FetchRooms(Action<RequestResponse<IReadOnlyList<RoomData>>> onRequestFinished, string[] tags = null)
Parameters
onRequestFinished
Action<RequestResponse<IReadOnlyList<RoomData>>>Callback that will be invoked when the request finished, it includes the fetched rooms.
tags
string[]Filter the results by a list of tags.
FetchRoomsAsync(string[])
Fetch the available rooms in the Replication Server asynchronously.
public Task<IReadOnlyList<RoomData>> FetchRoomsAsync(string[] tags = null)
Parameters
tags
string[]Filter the results by a list of tags.
Returns
IsOnline()
public Task<bool> IsOnline()
Returns
RemoveRoom(ulong, string, Action<RequestResponse<string>>)
Remove an existing room that you have created in the Replication Server.
public void RemoveRoom(ulong uniqueID, string secret, Action<RequestResponse<string>> onRequestFinished)
Parameters
uniqueID
ulongUnique ID of the room you wish to remove. Can be found in RoomData.UniqueId
secret
stringToken that will allow you to remove the room. Can be found in RoomData.Secret
onRequestFinished
Action<RequestResponse<string>>Callback that will be invoked when the request finished.
RemoveRoomAsync(ulong, string)
Remove an existing room that you have created in the Replication Server asynchronously.
public Task RemoveRoomAsync(ulong uniqueID, string secret)
Parameters
uniqueID
ulongUnique ID of the room you wish to remove. Can be found in RoomData.UniqueId
secret
stringToken that will allow you to remove the room. Can be found in RoomData.Secret