AMPS C# Client  5.3.5.0
AMPS C# Client for .NET
AMPS.Client.MemorySubscriptionManager Class Reference

An in-memory implementation of SubscriptionManager. Used by HAClient. More...

+ Inheritance diagram for AMPS.Client.MemorySubscriptionManager:

Public Member Functions

 MemorySubscriptionManager ()
 Initializes a new instance of the MemorySubscriptionManager class. More...
 
void subscribe (MessageHandler messageHandler, Message message)
 Adds a subscription to be resubscribed with the given handler based on the subscribe Message being sent to the server. More...
 
void unsubscribe (CommandId subId)
 Removes the subscription with the specified subscription ID so it not get resubscribed in the future. More...
 
bool isExistingSub (Field subId)
 Checks if a subscription with the specified subscription ID exists. More...
 
void clear ()
 Clears all subscriptions. More...
 
void resubscribe (Client client)
 Called by the Client after reconneting to resubscribe all subscriptions on the given client. More...
 
void setResubscriptionTimeout (long timeout)
 Sets the resubscription timeout in milliseconds. More...
 
long getResubscriptionTimeout ()
 Gets the resubscription timeout in milliseconds. More...
 
void setFailedResubscribeHandler (FailedResubscribeHandler failureHandler)
 Sets the FailedResubscribeHandler. More...
 
FailedResubscribeHandler getFailedResubscribeHandler ()
 Gets the FailedResubscribeHandler. More...
 

Static Public Member Functions

static void setDefaultResubscriptionTimeout (long timeout)
 Sets the default resubscription timeout for all instances of this class in milliseconds. More...
 
static long getDefaultResubscriptionTimeout ()
 Gets the default resubscription timeout for all instances of this class in milliseconds. More...
 

Detailed Description

An in-memory implementation of SubscriptionManager. Used by HAClient.

Constructor & Destructor Documentation

◆ MemorySubscriptionManager()

AMPS.Client.MemorySubscriptionManager.MemorySubscriptionManager ( )
inline

Initializes a new instance of the MemorySubscriptionManager class.

Member Function Documentation

◆ clear()

void AMPS.Client.MemorySubscriptionManager.clear ( )
inline

Clears all subscriptions.

Implements AMPS.Client.SubscriptionManager.

◆ getDefaultResubscriptionTimeout()

static long AMPS.Client.MemorySubscriptionManager.getDefaultResubscriptionTimeout ( )
inlinestatic

Gets the default resubscription timeout for all instances of this class in milliseconds.

Returns
The default timeout for resubscription calls.

◆ getFailedResubscribeHandler()

FailedResubscribeHandler AMPS.Client.MemorySubscriptionManager.getFailedResubscribeHandler ( )
inline

Gets the FailedResubscribeHandler.

Returns
The FailedResubscribeHandler or null if not set.

Implements AMPS.Client.SubscriptionManager.

◆ getResubscriptionTimeout()

long AMPS.Client.MemorySubscriptionManager.getResubscriptionTimeout ( )
inline

Gets the resubscription timeout in milliseconds.

Returns
The timeout for resubscription calls.

◆ isExistingSub()

bool AMPS.Client.MemorySubscriptionManager.isExistingSub ( Field  subId)
inline

Checks if a subscription with the specified subscription ID exists.

Parameters
subIdThe subscription ID to check.
Returns
True if the subscription exists, otherwise false.

◆ resubscribe()

void AMPS.Client.MemorySubscriptionManager.resubscribe ( Client  client)
inline

Called by the Client after reconneting to resubscribe all subscriptions on the given client.

Parameters
clientThe client on which to resubscribe.

Implements AMPS.Client.SubscriptionManager.

◆ setDefaultResubscriptionTimeout()

static void AMPS.Client.MemorySubscriptionManager.setDefaultResubscriptionTimeout ( long  timeout)
inlinestatic

Sets the default resubscription timeout for all instances of this class in milliseconds.

Parameters
timeoutThe default timeout for resubscription calls.

◆ setFailedResubscribeHandler()

void AMPS.Client.MemorySubscriptionManager.setFailedResubscribeHandler ( FailedResubscribeHandler  failureHandler)
inline

Sets the FailedResubscribeHandler.

Parameters
failureHandlerA FailedResubscribeHandler to call if a resubscribe fails.

Implements AMPS.Client.SubscriptionManager.

◆ setResubscriptionTimeout()

void AMPS.Client.MemorySubscriptionManager.setResubscriptionTimeout ( long  timeout)
inline

Sets the resubscription timeout in milliseconds.

Parameters
timeoutThe timeout for resubscription calls.

◆ subscribe()

void AMPS.Client.MemorySubscriptionManager.subscribe ( MessageHandler  messageHandler,
Message  message 
)
inline

Adds a subscription to be resubscribed with the given handler based on the subscribe Message being sent to the server.

Parameters
messageHandlerThe message handler to subscribe.
messageThe message to subscribe to.

Implements AMPS.Client.SubscriptionManager.

◆ unsubscribe()

void AMPS.Client.MemorySubscriptionManager.unsubscribe ( CommandId  subId)
inline

Removes the subscription with the specified subscription ID so it not get resubscribed in the future.

Parameters
subIdThe subscription ID to unsubscribe from.

Implements AMPS.Client.SubscriptionManager.


The documentation for this class was generated from the following file: