Class SubscriptionHolder<TSubcription, TSession, TRequestId>
- Namespace
- StockSharp.Server.Core
- Assembly
- StockSharp.Server.Core.dll
Subscription holder.
public class SubscriptionHolder<TSubcription, TSession, TRequestId> where TSubcription : SubscriptionInfo<TSession, TRequestId> where TSession : class, IMessageListenerSession
Type Parameters
TSubcription
Subscription type.
TSession
Session type.
TRequestId
Request identifier type.
- Inheritance
-
SubscriptionHolder<TSubcription, TSession, TRequestId>
- Inherited Members
- Extension Methods
Constructors
SubscriptionHolder(IMessageListener)
Initializes a new instance of the SubscriptionHolder<TSubcription, TSession, TRequestId>.
public SubscriptionHolder(IMessageListener server)
Parameters
server
IMessageListenerServer.
Methods
Add(TSubcription)
Add new subscription.
public void Add(TSubcription info)
Parameters
info
TSubcriptionSubscription.
AddUnsubscribeRequest(long, long)
Add unsubscribe request identifier.
public void AddUnsubscribeRequest(long transactionId, long originalTransactionId)
Parameters
transactionId
longRequest identifier.
originalTransactionId
longID of the original message TransactionId for which this message is a response.
Clear()
Clear state.
public void Clear()
GetSubscriptions(Message)
Get subscription for the specified message.
public IEnumerable<TSubcription> GetSubscriptions(Message message)
Parameters
message
MessageMessage.
Returns
- IEnumerable<TSubcription>
Subscriptions.
GetSubscriptions(IMessageListenerSession)
Get subscription for the specified session.
public IEnumerable<TSubcription> GetSubscriptions(IMessageListenerSession session)
Parameters
session
IMessageListenerSessionSession.
Returns
- IEnumerable<TSubcription>
Subscriptions.
HasSubscriptions(DataType, SecurityId)
Determines has subscription for the specified data type and security.
public bool HasSubscriptions(DataType dataType, SecurityId securityId)
Parameters
dataType
DataTypeData type info.
securityId
SecurityIdSecurity ID.
Returns
- bool
Check result.
Remove(TSubcription)
Remove subscription.
public void Remove(TSubcription info)
Parameters
info
TSubcriptionSubscription.
Remove(TSession)
Remove session.
public IEnumerable<TSubcription> Remove(TSession session)
Parameters
session
TSessionSession.
Returns
- IEnumerable<TSubcription>
Subscriptions.
TryGetById(long)
Try get subscription by the specified identifier.
public TSubcription TryGetById(long id)
Parameters
id
longIdentifier.
Returns
- TSubcription
Subscription.
TryGetSubscription(long, SubscriptionStates?)
Try get subscription by the specified identifier and swith into new state.
public TSubcription TryGetSubscription(long id, SubscriptionStates? state)
Parameters
id
longIdentifier.
state
SubscriptionStates?State.
Returns
- TSubcription
Subscription.
TryGetSubscriptionAndStop(long)
Try get and stop subscription by the specified identifier.
public TSubcription TryGetSubscriptionAndStop(long id)
Parameters
id
longIdentifier.
Returns
- TSubcription
Subscription.
Events
SubscriptionChanged
Subscription changed event.
public event Action<TSubcription> SubscriptionChanged
Event Type
- Action<TSubcription>