Table of Contents

Class ReplicationServerRoomsService

Namespace
Coherence.Cloud
Assembly
Coherence.Runtime.dll

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 string
apiPort int?
requestFactory IRequestFactory
runtimeSettings IRuntimeSettings

Properties

CachedRooms

List of cached Rooms that were fetched by the FetchRooms method.

public IReadOnlyList<RoomData> CachedRooms { get; }

Property Value

IReadOnlyList<RoomData>

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 RoomCreationOptions

Instance 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 RoomCreationOptions

Instance of all the room options that you wish to create the room with.

Returns

Task<RoomData>

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

Task<IReadOnlyList<RoomData>>

IsOnline()

public Task<bool> IsOnline()

Returns

Task<bool>

Returns true if the targeted Replication Server is online, false otherwise.

RemoveRoom(ulong, string, Action<RequestResponse<string>>)

Remove an existing room that you have created in the Replication Server.

public void RemoveRoom(ulong roomId, string secret, Action<RequestResponse<string>> onRequestFinished)

Parameters

roomId ulong

Room ID of the room you wish to remove. Can be found in RoomData.Id

secret string

Secret is ignored for removing rooms from locally hosted Replication Servers

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 roomId, string secret)

Parameters

roomId ulong

Room ID of the room you wish to remove. Can be found in RoomData.Id

secret string

Secret is ignored for removing rooms from locally hosted Replication Servers

Returns

Task