Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
subscription.h
Go to the documentation of this file.
1
/* $Id$
2
*
3
* OpenMAMA: The open middleware agnostic messaging API
4
* Copyright (C) 2011 NYSE Technologies, Inc.
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
* 02110-1301 USA
20
*/
21
22
#ifndef MamaSubscriptionH__
23
#define MamaSubscriptionH__
24
25
/* *************************************************** */
26
/* Includes. */
27
/* *************************************************** */
28
#include "
mama/marketdata.h
"
29
#include "
mama/msg.h
"
30
#include "
mama/quality.h
"
31
#include "
mama/servicelevel.h
"
32
#include "
mama/status.h
"
33
#include "
mama/subscriptiontype.h
"
34
#include "
mama/transport.h
"
35
#include "
mama/types.h
"
36
37
#if defined (__cplusplus)
38
extern
"C"
{
39
#endif
40
41
/* *************************************************** */
42
/* Enumerations. */
43
/* *************************************************** */
44
57
typedef
enum
58
{
59
PRE_INITIAL_SCHEME_ON_GAP
,
60
PRE_INITIAL_SCHEME_ON_INITIAL
61
62
}
preInitialScheme
;
63
70
typedef
enum
71
{
72
/* The state of the subscription is unknown. */
73
MAMA_SUBSCRIPTION_UNKNOWN
= 0,
74
75
/* The subscription has been allocated in memory. */
76
MAMA_SUBSCRIPTION_ALLOCATED
= 1,
77
78
/* Initial setup work has been done, mamaSubscription_activate must still be called. Note that this state is only valid
79
* for market data subscriptions.
80
*/
81
MAMA_SUBSCRIPTION_SETUP
= 2,
82
83
/* The subscription is now on the throttle queue waiting to be fully activated. */
84
MAMA_SUBSCRIPTION_ACTIVATING
= 3,
85
86
/* The subscription is now fully activated and is processing messages. */
87
MAMA_SUBSCRIPTION_ACTIVATED
= 4,
88
89
/* The subscription is being de-activated, it will not be fully deactivated until the middleware removal of the listener is complete */
90
MAMA_SUBSCRIPTION_DEACTIVATING
= 5,
91
92
/* The subscription has been de-activated, messages are no longer being processed. */
93
MAMA_SUBSCRIPTION_DEACTIVATED
= 6,
94
95
/* The subscription is being destroyed, but waiting on deactivation to complete*/
96
MAMA_SUBSCRIPTION_DESTROYING
= 7,
97
98
/* The subscription has been fully destroyed. */
99
MAMA_SUBSCRIPTION_DESTROYED
= 8,
100
101
/* The subscription is in the process of being de-allocated, but waiting on deactivation to complete*/
102
MAMA_SUBSCRIPTION_DEALLOCATING
= 9,
103
104
/* The subscription has been de-allocated. This state is only temporary and exists until such point as the subscription's
105
* memory is freed. It is provided so that a log entry will be written out.
106
*/
107
MAMA_SUBSCRIPTION_DEALLOCATED
= 10,
108
109
/* The subscription is being re-activated, it will not be fully reactivated until deactivation complete */
110
MAMA_SUBSCRIPTION_REACTIVATING
= 11
111
112
}
mamaSubscriptionState
;
113
114
typedef
enum
115
{
116
DQ_SCHEME_DELIVER_ALL
,
117
DQ_SCHEME_INGORE_DUPS
118
}
dqStartegyScheme
;
119
120
121
typedef
enum
122
{
123
DQ_FT_DO_NOT_WAIT_FOR_RECAP
,
124
DQ_FT_WAIT_FOR_RECAP
125
}
dqftStrategyScheme
;
126
/* *************************************************** */
127
/* Type Defines. */
128
/* *************************************************** */
129
137
typedef
void
(MAMACALLTYPE *
wombat_subscriptionCreateCB
)(
138
mamaSubscription
subscription,
139
void
*
closure
);
140
149
typedef
void
(MAMACALLTYPE *
wombat_subscriptionDestroyCB
)(
150
mamaSubscription
subscription,
151
void
*
closure
);
152
169
typedef
void
(MAMACALLTYPE *
wombat_subscriptionErrorCB
)(
170
mamaSubscription
subscription,
171
mama_status
status
,
172
void
*platformError,
173
const
char
*subject,
174
void
*
closure
);
175
185
typedef
void
(MAMACALLTYPE *
wombat_subscriptionGapCB
)(
186
mamaSubscription
subscription,
187
void
*
closure
);
188
198
typedef
void
(MAMACALLTYPE *
wombat_subscriptionOnMsgCB
)(
199
mamaSubscription
subscription,
200
mamaMsg
msg
,
201
void
*
closure
,
202
void
*itemClosure);
203
220
typedef
void
(MAMACALLTYPE *
wombat_subscriptionQualityCB
)(
221
mamaSubscription
subscription,
222
mamaQuality
quality,
223
const
char
*symbol,
224
short
cause,
225
const
void
*platformInfo,
226
void
*
closure
);
227
235
typedef
void
(MAMACALLTYPE *
wombat_subscriptionRecapCB
)(
236
mamaSubscription
subscription,
237
void
*
closure
);
238
248
typedef
void
(MAMACALLTYPE *
wombat_subscriptionWildCardOnMsgCB
)(
249
mamaSubscription
subscription,
250
mamaMsg
msg
,
251
const
char
*topic,
252
void
*
closure
,
253
void
*itemClosure);
254
255
/* *************************************************** */
256
/* Structures. */
257
/* *************************************************** */
258
263
typedef
struct
mamaMsgCallbacks_
264
{
265
wombat_subscriptionCreateCB
onCreate
;
266
wombat_subscriptionErrorCB
onError
;
267
wombat_subscriptionOnMsgCB
onMsg
;
268
wombat_subscriptionQualityCB
onQuality
;
269
wombat_subscriptionGapCB
onGap
;
270
wombat_subscriptionRecapCB
onRecapRequest
;
271
wombat_subscriptionDestroyCB
onDestroy
;
272
}
mamaMsgCallbacks
;
273
278
typedef
struct
mamaWildCardMsgCallbacks_
279
{
280
wombat_subscriptionCreateCB
onCreate
;
281
wombat_subscriptionErrorCB
onError
;
282
wombat_subscriptionWildCardOnMsgCB
onMsg
;
283
wombat_subscriptionDestroyCB
onDestroy
;
284
}
mamaWildCardMsgCallbacks
;
285
286
/* *************************************************** */
287
/* Public Function Prototypes. */
288
/* *************************************************** */
289
310
MAMAExpDLL
311
extern
mama_status
312
mamaSubscription_activate
(
313
mamaSubscription
subscription);
314
329
MAMAExpDLL
330
extern
mama_status
331
mamaSubscription_allocate
(
332
mamaSubscription
*result);
333
344
MAMAExpDLL
345
extern
int
346
mamaSubscription_checkDebugLevel
(
347
mamaSubscription
subscription,
348
MamaLogLevel
level);
349
370
MAMAExpDLL
371
extern
mama_status
372
mamaSubscription_create
(
373
mamaSubscription
subscription,
374
mamaQueue
queue,
375
const
mamaMsgCallbacks
* callbacks,
376
mamaSource
source
,
377
const
char
* symbol,
378
void
* closure);
379
400
MAMAExpDLL
401
extern
mama_status
402
mamaSubscription_createBasic
(
403
mamaSubscription
subscription,
404
mamaTransport
transport,
405
mamaQueue
queue,
406
const
mamaMsgCallbacks
* callbacks,
407
const
char
* symbol,
408
void
* closure);
409
448
MAMAExpDLL
449
extern
mama_status
450
mamaSubscription_createBasicWildCard
(
451
mamaSubscription
subscription,
452
mamaTransport
transport,
453
mamaQueue
queue,
454
const
mamaWildCardMsgCallbacks
* callbacks,
455
const
char
*
source
,
456
const
char
* symbol,
457
void
* closure);
458
480
MAMAExpDLL
481
extern
mama_status
482
mamaSubscription_createSnapshot
(
483
mamaSubscription
subscription,
484
mamaQueue
queue,
485
const
mamaMsgCallbacks
* callbacks,
486
mamaSource
source
,
487
const
char
* symbol,
488
void
* closure);
489
506
MAMAExpDLL
507
extern
mama_status
508
mamaSubscription_deactivate
(
509
mamaSubscription
subscription);
510
524
MAMAExpDLL
525
extern
mama_status
526
mamaSubscription_deallocate
(
527
mamaSubscription
subscription);
528
548
MAMAExpDLL
549
extern
mama_status
550
mamaSubscription_destroy
(
551
mamaSubscription
subscription);
552
567
MAMAExpDLL
568
extern
mama_status
569
mamaSubscription_destroyEx
(
570
mamaSubscription
subscription);
571
582
MAMAExpDLL
583
extern
mama_status
584
mamaSubscription_getAppDataType
(
585
mamaSubscription
subscription,
586
uint8_t *appDataType);
587
598
MAMAExpDLL
599
extern
mama_status
600
mamaSubscription_getClosure
(
601
mamaSubscription
subscription,
602
void
**closure);
603
611
MAMAExpDLL
612
extern
MamaLogLevel
613
mamaSubscription_getDebugLevel
(
614
mamaSubscription
subscription);
615
616
628
MAMAExpDLL
629
extern
mama_status
630
mamaSubscription_getItemClosure
(
631
mamaSubscription
subscription,
632
void
**closure);
633
659
MAMAExpDLL
660
mama_status
661
mamaSubscription_getMsgQualifierFilter
(
662
mamaSubscription
subscription,
663
int
*ignoreDefinitelyDuplicate,
664
int
*ignorePossiblyDuplicate,
665
int
*ignoreDefinitelyDelayed,
666
int
*ignorePossiblyDelayed,
667
int
*ignoreOutOfSequence);
668
682
MAMAExpDLL
683
extern
mama_status
684
mamaSubscription_getPlatformError
(
685
mamaSubscription
subsc,
686
void
**error);
687
698
MAMAExpDLL
699
extern
mama_status
700
mamaSubscription_getPreIntitialCacheSize
(
701
mamaSubscription
subscription,
702
int
*result);
703
714
MAMAExpDLL
715
extern
mama_status
716
mamaSubscription_getQueue
(
717
mamaSubscription
subscription,
718
mamaQueue
*queue);
719
731
MAMAExpDLL
732
extern
mama_status
733
mamaSubscription_getReceivedInitial
(
734
mamaSubscription
subscription,
735
int
*receivedInitial);
736
748
MAMAExpDLL
749
extern
mama_status
750
mamaSubscription_getRecoverGaps
(
751
mamaSubscription
subscription,
752
int
*doesRecover);
753
765
MAMAExpDLL
766
extern
mama_status
767
mamaSubscription_getRequiresInitial
(
768
mamaSubscription
subscription,
769
int
*requiresInitial);
770
781
MAMAExpDLL
782
extern
mama_status
783
mamaSubscription_getRetries
(
784
mamaSubscription
subscription,
785
int
*retries);
786
798
MAMAExpDLL
799
extern
mama_status
800
mamaSubscription_getServiceLevel
(
801
mamaSubscription
subscription,
802
mamaServiceLevel
*serviceLevel);
803
815
MAMAExpDLL
816
extern
mama_status
817
mamaSubscription_getServiceLevelOpt
(
818
mamaSubscription
subscription,
819
long
*serviceLevel);
820
821
834
MAMAExpDLL
835
extern
mama_status
836
mamaSubscription_getSource
(
837
mamaSubscription
subscription,
838
const
char
**
source
);
839
853
MAMAExpDLL
854
extern
mama_status
855
mamaSubscription_getState
(
856
mamaSubscription
subscription,
857
mamaSubscriptionState
*
state
);
858
870
MAMAExpDLL
871
extern
mama_status
872
mamaSubscription_getSubscriptionType
(
873
mamaSubscription
subscription,
874
mamaSubscriptionType
*type);
875
889
MAMAExpDLL
890
extern
mama_status
891
mamaSubscription_getSubscSymbol
(
892
mamaSubscription
subscription,
893
const
char
**symbol);
894
907
MAMAExpDLL
908
extern
mama_status
909
mamaSubscription_getSymbol
(
910
mamaSubscription
subscription,
911
const
char
**symbol);
912
923
MAMAExpDLL
924
extern
mama_status
925
mamaSubscription_getTimeout
(
926
mamaSubscription
subscription,
927
double
*timeout);
928
939
MAMAExpDLL
940
extern
mama_status
941
mamaSubscription_getTransport
(
942
mamaSubscription
subscription,
943
mamaTransport
*transport);
944
953
MAMAExpDLL
954
extern
mamaMsgCallbacks
*
955
mamaSubscription_getUserCallbacks
(
956
mamaSubscription
subscription);
957
966
MAMAExpDLL
967
extern
int
968
mamaSubscription_isActive
(
969
mamaSubscription
subscription);
970
979
MAMAExpDLL
980
extern
int
981
mamaSubscription_isValid
(
982
mamaSubscription
subscription);
983
1000
MAMAExpDLL
1001
extern
mama_status
1002
mamaSubscription_muteCurrentTopic
(
1003
mamaSubscription
subscription);
1004
1016
MAMAExpDLL
1017
extern
mama_status
1018
mamaSubscription_setAppDataType
(
1019
mamaSubscription
subscription,
1020
uint8_t appDataType);
1021
1032
MAMAExpDLL
1033
extern
mama_status
1034
mamaSubscription_setDebugLevel
(
1035
mamaSubscription
subscription,
1036
MamaLogLevel
level);
1037
1048
MAMAExpDLL
1049
extern
mama_status
1050
mamaSubscription_setGroupSizeHint
(
1051
mamaSubscription
subscription,
1052
int
groupSizeHint);
1053
1074
MAMAExpDLL
1075
extern
mama_status
1076
mamaSubscription_setItemClosure
(
1077
mamaSubscription
subscription,
1078
void
*closure);
1079
1104
MAMAExpDLL
1105
mama_status
1106
mamaSubscription_setMsgQualifierFilter
(
1107
mamaSubscription
subscription,
1108
int
ignoreDefinitelyDuplicate,
1109
int
ignorePossiblyDuplicate,
1110
int
ignoreDefinitelyDelayed,
1111
int
ignorePossiblyDelayed,
1112
int
ignoreOutOfSequence);
1113
1130
MAMAExpDLL
1131
extern
mama_status
1132
mamaSubscription_setPreIntitialCacheSize
(
1133
mamaSubscription
subscription,
1134
int
cacheSize);
1135
1148
MAMAExpDLL
1149
extern
mama_status
1150
mamaSubscription_setRecoverGaps
(
1151
mamaSubscription
subscription,
1152
int
doesRecover);
1153
1167
MAMAExpDLL
1168
extern
mama_status
1169
mamaSubscription_setRequiresInitial
(
1170
mamaSubscription
subscription,
1171
int
requiresInitial);
1172
1187
MAMAExpDLL
1188
extern
mama_status
1189
mamaSubscription_setServiceLevel
(
1190
mamaSubscription
subscription,
1191
mamaServiceLevel
serviceLevel,
1192
long
serviceLevelOpt);
1193
1204
MAMAExpDLL
1205
extern
mama_status
1206
mamaSubscription_setRetries
(
1207
mamaSubscription
subscription,
1208
int
retries);
1209
1222
MAMAExpDLL
1223
extern
mama_status
1224
mamaSubscription_setSubscriptionType
(
1225
mamaSubscription
subscription,
1226
mamaSubscriptionType
type);
1227
1239
MAMAExpDLL
1240
extern
mama_status
1241
mamaSubscription_setSymbol
(
1242
mamaSubscription
subscription,
1243
const
char
*symbol);
1244
1256
MAMAExpDLL
1257
extern
mama_status
1258
mamaSubscription_setTimeout
(
1259
mamaSubscription
subscription,
1260
double
timeout);
1261
1285
MAMAExpDLL
1286
extern
mama_status
1287
mamaSubscription_setup
(
1288
mamaSubscription
subscription,
1289
mamaQueue
queue,
1290
const
mamaMsgCallbacks
* callbacks,
1291
mamaSource
source
,
1292
const
char
* symbol,
1293
void
* closure);
1294
1319
MAMAExpDLL
1320
extern
mama_status
1321
mamaSubscription_setup2
(
1322
mamaSubscription
subscription,
1323
mamaTransport
transport,
1324
mamaQueue
queue,
1325
const
mamaMsgCallbacks
*callbacks,
1326
const
char
*sourceName,
1327
const
char
*symbol,
1328
void
*closure);
1329
1364
MAMAExpDLL
1365
extern
mama_status
1366
mamaSubscription_setupBasicWildCard
(
1367
mamaSubscription
subscription,
1368
mamaTransport
transport,
1369
mamaQueue
queue,
1370
const
mamaWildCardMsgCallbacks
* callbacks,
1371
const
char
*
source
,
1372
const
char
* symbol,
1373
void
* closure);
1374
1383
MAMAExpDLL
1384
extern
const
char
*
1385
mamaSubscription_stringForState
(
1386
mamaSubscriptionState
state
);
1387
1388
#if defined (__cplusplus)
1389
}
1390
#endif
1391
1392
#endif
© 2012 Linux Foundation