Table of Contents

Class CloudRoomsService

Namespace
Coherence.Cloud
Assembly
Coherence.Runtime.dll

Public API to interface with Rooms from your Project in the coherence Cloud. If you wish to create, delete or fetch rooms in a self-hosted Replication Server, you can instantiate a ReplicationServerRoomsService instead.

public class CloudRoomsService : IRoomsService
Inheritance
CloudRoomsService
Implements
Extension Methods

Constructors

CloudRoomsService(string, CloudCredentialsPair, IRuntimeSettings)

public CloudRoomsService(string region, CloudCredentialsPair credentialsPair = null, IRuntimeSettings runtimeSettings = null)

Parameters

region string
credentialsPair CloudCredentialsPair
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 coherence Cloud.

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 coherence Cloud 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 coherence Cloud.

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 coherence Cloud asynchronously.

public Task<IReadOnlyList<RoomData>> FetchRoomsAsync(string[] tags = null)

Parameters

tags string[]

Filter the results by a list of tags.

Returns

Task<IReadOnlyList<RoomData>>

GetCreateRoomCooldown()

public TimeSpan GetCreateRoomCooldown()

Returns

TimeSpan

Returns the internal cooldown for the Create Room endpoint.

GetFetchRoomsCooldown()

public TimeSpan GetFetchRoomsCooldown()

Returns

TimeSpan

Returns the internal cooldown for the Fetch Rooms endpoint.

GetRemoveRoomCooldown()

public TimeSpan GetRemoveRoomCooldown()

Returns

TimeSpan

Returns the internal cooldown for the Remove Room endpoint.

MatchRoom(Action<RequestResponse<RoomMatchResponse>>, string[])

Match against a joinable room with the given options in the coherence Cloud.

public void MatchRoom(Action<RequestResponse<RoomMatchResponse>> onRequestFinished, string[] tags = null)

Parameters

onRequestFinished Action<RequestResponse<RoomMatchResponse>>

Callback that will be invoked when the request finished, it includes the matched room or null.

tags string[]

Filter the results by a list of tags.

MatchRoomAsync(string[])

Match a room with the given options in the coherence Cloud asynchronously.

public Task<RoomMatchResponse> MatchRoomAsync(string[] tags = null)

Parameters

tags string[]

Filter the results by a list of tags.

Returns

Task<RoomMatchResponse>

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

Remove an existing room that you have created in the coherence Cloud.

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

Parameters

uniqueID ulong

Unique ID of the room you wish to remove. Can be found in RoomData.UniqueId

secret string

Token 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 coherence Cloud.

public Task RemoveRoomAsync(ulong uniqueID, string secret)

Parameters

uniqueID ulong

Unique ID of the room you wish to remove. Can be found in RoomData.UniqueId

secret string

Token that will allow you to remove the room. Can be found in RoomData.Secret

Returns

Task

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

Unlist an existing room that you have created in the coherence Cloud.

public void UnlistRoom(ulong uniqueID, string secret, Action<RequestResponse<string>> onRequestFinished)

Parameters

uniqueID ulong

Unique ID of the room you wish to unlist. Can be found in RoomData.UniqueId

secret string

Token that will allow you to unlist the room. Can be found in RoomData.Secret

onRequestFinished Action<RequestResponse<string>>

Callback that will be invoked when the request finished.

UnlistRoomAsync(ulong, string)

Unlist an existing room that you have created in the coherence Cloud.

public Task UnlistRoomAsync(ulong uniqueID, string secret)

Parameters

uniqueID ulong

Unique ID of the room you wish to unlist. Can be found in RoomData.UniqueId

secret string

Token that will allow you to unlist the room. Can be found in RoomData.Secret

Returns

Task