dxFeed .Net API  7.1.0
dxFeed .Net API library intended to provide market data access for DX clients
com.dxfeed.api.IDXFeedSubscription< E > Interface Template Reference

Subscription for a set of symbols and event types. More...

Inheritance diagram for com.dxfeed.api.IDXFeedSubscription< E >:
[legend]

Public Member Functions

void Attach (IDXFeed feed)
 Attaches subscription to the specified feed. More...
 
void Detach (IDXFeed feed)
 Detaches subscription from the specified feed. More...
 
void Close ()
 
bool ContainsEventType (Type eventType)
 Returns true if this subscription contains the corresponding event type. More...
 
void Clear ()
 
ISet< object > GetSymbols ()
 Returns a set of subscribed symbols. The resulting set cannot be modified. The contents of the resulting set are undefined if the set of symbols is changed after invocation of this method, but the resulting set is safe for concurrent reads from any threads. The resulting set maybe either a snapshot of the set of the subscribed symbols at the time of invocation or a weakly consistent view of the set. More...
 
void SetSymbols (ICollection< object > symbols)
 
void SetSymbols (params object[] symbols)
 
void AddSymbols (ICollection< object > symbols)
 
void AddSymbols (params object[] symbols)
 
void AddSymbols (object symbol)
 
void RemoveSymbols (ICollection< object > symbols)
 
void RemoveSymbols (params object[] symbols)
 
void AddEventListener (IDXFeedEventListener< E > listener)
 Adds listener for events. Newly added listeners start receiving only new events. This method does nothing if this subscription is IsClosed. More...
 
void RemoveEventListener (IDXFeedEventListener< E > listener)
 Removes listener for events. More...
 

Properties

bool IsClosed [get]
 Returns true if this subscription is closed.

See also
Close()
More...
 
ISet< Type > EventTypes [get]
 Returns a set of subscribed event types. The resulting set cannot be modified. More...
 

Events

DXFeedSymbolsUpdateEventHandler OnSymbolsAdded
 Event calls when any symbols is added to subscription. More...
 
DXFeedSymbolsUpdateEventHandler OnSymbolsRemoved
 Event calls when any symbols is removed from subscription. More...
 
DXFeedSubscriptionClosedEventHandler OnSubscriptionClosed
 Event calls when subscription is closing. More...
 

Detailed Description

Subscription for a set of symbols and event types.

Template Parameters
EThe type of events.
Type Constraints
E :IDxEventType 

Member Function Documentation

◆ AddEventListener()

void com.dxfeed.api.IDXFeedSubscription< E >.AddEventListener ( IDXFeedEventListener< E >  listener)

Adds listener for events. Newly added listeners start receiving only new events. This method does nothing if this subscription is IsClosed.

Parameters
listenerThe event listener.
Exceptions
ArgumentNullExceptionIf listener is null.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ AddSymbols() [1/3]

void com.dxfeed.api.IDXFeedSubscription< E >.AddSymbols ( ICollection< object >  symbols)

Adds the specified collection of symbols to the set of subscribed symbols. To conveniently add one or few symbols you can use AddSymbols(object[]) method. All registered event listeners will receive update on the last events for all newly added symbols.

Implementation notes.

This method notifies all subscribed OnSymbolsAdded events on symbols changing for this subscription.

Parameters
symbolsSymbols the collection of symbols.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ AddSymbols() [2/3]

void com.dxfeed.api.IDXFeedSubscription< E >.AddSymbols ( params object []  symbols)

Adds the specified array of symbols to the set of subscribed symbols. This is a convenience method to subscribe to one or few symbols at a time. When subscribing to multiple symbols at once it is preferable to use AddSymbols(ICollection<object>) method. All registered event listeners will receive update on the last events for all newly added symbols.

Implementation notes.

This method notifies all subscribed OnSymbolsAdded events on symbols changing for this subscription.

Parameters
symbolsThe array of symbols.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ AddSymbols() [3/3]

void com.dxfeed.api.IDXFeedSubscription< E >.AddSymbols ( object  symbol)

Adds the specified symbol to the set of subscribed symbols. This is a convenience method to subscribe to one symbol at a time that has a return fast-path for a case when the symbol is already in the set. When subscribing to multiple symbols at once it is preferable to use AddSymbols(ICollection<object>) method. All registered event listeners will receive update on the last events for all newly added symbols.

Implementation notes.

This method notifies all subscribed OnSymbolsAdded events on symbols changing for this subscription.

Parameters
symbolThe symbol.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ Attach()

void com.dxfeed.api.IDXFeedSubscription< E >.Attach ( IDXFeed  feed)

Attaches subscription to the specified feed.

Parameters
feedFeed to attach to.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ Clear()

Clears the set of subscribed symbols.

Implementation notes.

This method notifies all subscribed OnSymbolsRemoved events on clear symbols from this subscription.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ Close()

Closes this subscription and makes it permanently detached. This method notifies attached IDXFeed by invoking Detach(IDXFeed) and IDXFeed.DetachSubscription<E>(IDXFeedSubscription<E>) methods while holding the lock for this subscription. This method clears lists of all installed event listeners and subscription change listeners and makes sure that no more listeners can be added.

This method ensures that subscription can be safely garbage-collected when all outside references to it are lost.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ ContainsEventType()

bool com.dxfeed.api.IDXFeedSubscription< E >.ContainsEventType ( Type  eventType)

Returns true if this subscription contains the corresponding event type.

Parameters
eventTypeType of event.
Returns
True if this subscription contains the corresponding event type.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ Detach()

void com.dxfeed.api.IDXFeedSubscription< E >.Detach ( IDXFeed  feed)

Detaches subscription from the specified feed.

Parameters
feedFeed to detach from.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ GetSymbols()

ISet<object> com.dxfeed.api.IDXFeedSubscription< E >.GetSymbols ( )

Returns a set of subscribed symbols. The resulting set cannot be modified. The contents of the resulting set are undefined if the set of symbols is changed after invocation of this method, but the resulting set is safe for concurrent reads from any threads. The resulting set maybe either a snapshot of the set of the subscribed symbols at the time of invocation or a weakly consistent view of the set.

Returns
Set of subscribed symbols.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ RemoveEventListener()

void com.dxfeed.api.IDXFeedSubscription< E >.RemoveEventListener ( IDXFeedEventListener< E >  listener)

Removes listener for events.

Parameters
listenerListener the event listener.
Exceptions
ArgumentNullExceptionIf listener is null.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ RemoveSymbols() [1/2]

void com.dxfeed.api.IDXFeedSubscription< E >.RemoveSymbols ( ICollection< object >  symbols)

Removes the specified collection of symbols from the set of subscribed symbols. To conveniently remove one or few symbols you can use RemoveSymbols(object[]) method.

Implementation notes.

This method notifies all subscribed OnSymbolsRemoved events on symbols changing for this subscription.

Parameters
symbolsThe collection of symbols.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ RemoveSymbols() [2/2]

void com.dxfeed.api.IDXFeedSubscription< E >.RemoveSymbols ( params object []  symbols)

Removes the specified array of symbols from the set of subscribed symbols. This is a convenience method to remove one or few symbols at a time. When removing multiple symbols at once it is preferable to use RemoveSymbols(ICollection<object>) method.

Implementation notes.

This method notifies all subscribed OnSymbolsRemoved events on symbols changing for this subscription.

Parameters
symbolsThe array of symbols.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ SetSymbols() [1/2]

void com.dxfeed.api.IDXFeedSubscription< E >.SetSymbols ( ICollection< object >  symbols)

Changes the set of subscribed symbols so that it contains just the symbols from the specified collection. To conveniently set subscription for just one or few symbols you can use SetSymbols(object[]) method. All registered event listeners will receive update on the last events for all newly added symbols.

Implementation notes.

This method notifies all subscribed OnSymbolsAdded and OnSymbolsRemoved events on symbols changing for this subscription.

Parameters
symbolsThe collection of symbols.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

◆ SetSymbols() [2/2]

void com.dxfeed.api.IDXFeedSubscription< E >.SetSymbols ( params object []  symbols)

Changes the set of subscribed symbols so that it contains just the symbols from the specified array. This is a convenience method to set subscription to one or few symbols at a time. When setting subscription to multiple symbols at once it is preferable to use SetSymbols(ICollection<object>) method. All registered event listeners will receive update on the last events for all newly added symbols.

Implementation notes.

This method notifies all subscribed OnSymbolsAdded and OnSymbolsRemoved events on symbols changing for this subscription.

Parameters
symbolsThe array of symbols.

Implemented in com.dxfeed.api.DXFeedSubscription< E >.

Property Documentation

◆ EventTypes

ISet<Type> com.dxfeed.api.IDXFeedSubscription< E >.EventTypes
get

Returns a set of subscribed event types. The resulting set cannot be modified.

◆ IsClosed

bool com.dxfeed.api.IDXFeedSubscription< E >.IsClosed
get

Returns true if this subscription is closed.

See also
Close()

Event Documentation

◆ OnSubscriptionClosed

Event calls when subscription is closing.

◆ OnSymbolsAdded

Event calls when any symbols is added to subscription.

◆ OnSymbolsRemoved

Event calls when any symbols is removed from subscription.


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