Join us on LinkedIn Read our Blog

Isode SOM API

queue.h

Go to the documentation of this file.
00001 /*  Copyright (c) 2004-2009, Isode Limited, London, England.
00002  *  All rights reserved.
00003  *                                                                       
00004  *  Acquisition and use of this software and related materials for any      
00005  *  purpose requires a written licence agreement from Isode Limited,
00006  *  or a written licence from an organisation licenced by Isode Limited
00007  *  to grant such a licence.
00008  *
00009  */
00010 
00011 #ifndef _SOM_QUEUE_H
00012 #define _SOM_QUEUE_H
00013 
00014 #include "session.h"
00015 #include "queueatt.h"
00016 
00033 #define SOM_FACILITY_QUEUE (1<<1) 
00035 /* Object types */
00036 
00037 struct SOMQchannel;
00038 struct SOMQmta;
00039 struct SOMQmessage;
00040 struct SOMQrecip;
00041 struct SOMQinmsg;
00042 struct SOMQassoc;
00043 
00058 typedef void SOMQueueCallback (struct SOMSession *session,
00059                                void *ophandle,
00060                                void *clientdata,
00061                                int status);
00062 
00075 typedef void SOMQchannelCallback (struct SOMSession *session,
00076                                   void *ophandle,
00077                                   void *clientdata,
00078                                   struct SOMQchannel *channel);
00079 
00080 
00093 typedef void SOMQmtaCallback (struct SOMSession *session,
00094                               void *ophandle,
00095                               void *clientdata,
00096                               struct SOMQmta *mta);
00097 
00098 
00113 typedef void SOMQmessageCallback (struct SOMSession *session,
00114                                   void *ophandle,
00115                                   void *clientdata,
00116                                   struct SOMQmessage *message);
00117 
00118 
00119 /* Callback setting functions */
00120 
00132 SOMAPI_CDECL int SOMQueueSetCallback (struct SOMSession *session,
00133                                       SOMQueueCallback *callback,
00134                                       SOMQueueCallback **oldvalue);
00135 
00136 
00137 
00149 SOMAPI_CDECL int SOMQueueSetChannelCallback (struct SOMSession *session,
00150                                              SOMQchannelCallback *callback,
00151                                              SOMQchannelCallback **oldvalue);
00152 
00153 
00154 
00166 SOMAPI_CDECL int SOMQueueSetMtaCallback (struct SOMSession *session,
00167                                          SOMQmtaCallback *callback,
00168                                          SOMQmtaCallback **oldvalue);
00169 
00170 
00171 
00183 SOMAPI_CDECL int SOMQueueSetMessageCallback (struct SOMSession *session,
00184                                              SOMQmessageCallback *callback,
00185                                              SOMQmessageCallback **oldvalue);
00186 
00187 
00188 /* \} */
00189 
00207 SOMAPI_CDECL int SOMQmanagerGetStrParam (struct SOMSession *session,
00208                                          int paramtype,
00209                                          char *buffer,
00210                                          size_t buflen,
00211                                          size_t *paramlenp);
00212 
00213 
00222 SOMAPI_CDECL int SOMQmanagerGetIntParam (struct SOMSession *session,
00223                                          int paramtype,
00224                                          int *valp);
00225 
00236 SOMAPI_CDECL int SOMQchannelGetStrParam (struct SOMQchannel *channel,
00237                                          int paramtype,
00238                                          char *buffer,
00239                                          size_t buflen,
00240                                          size_t *paramlenp);
00241 
00242 
00251 SOMAPI_CDECL int SOMQchannelGetIntParam (struct SOMQchannel *channel,
00252                                          int paramtype,
00253                                          int *valp);
00254 
00265 SOMAPI_CDECL int SOMQmtaGetStrParam (struct SOMQmta *mta,
00266                                      int paramtype,
00267                                      char *buffer,
00268                                      size_t buflen,
00269                                      size_t *paramlenp);
00270 
00271 
00280 SOMAPI_CDECL int SOMQmtaGetIntParam (struct SOMQmta *mta,
00281                                      int paramtype,
00282                                      int *valp);
00283 
00298 SOMAPI_CDECL int SOMQmtaGetInmsg (struct SOMQmta *mta,
00299                                   int number,
00300                                   int getnext,
00301                                   struct SOMQinmsg **inmpp);
00302 
00316 SOMAPI_CDECL int SOMQmtaGetAssoc (struct SOMQmta *mta,
00317                                   int assocnum,
00318                                   int getnext,
00319                                   struct SOMQassoc **aspp);
00320 
00331 SOMAPI_CDECL int SOMQmessageGetStrParam (struct SOMQmessage *message,
00332                                          int paramtype,
00333                                          char *buffer,
00334                                          size_t buflen,
00335                                          size_t *paramlenp);
00336 
00337 
00346 SOMAPI_CDECL int SOMQmessageGetIntParam (struct SOMQmessage *message,
00347                                          int paramtype,
00348                                          int *valp);
00349 
00350 
00361 SOMAPI_CDECL int SOMQmessageGetRecip (struct SOMQmessage *message,
00362                                       int number,
00363                                       struct SOMQrecip **rpp);
00364 
00375 SOMAPI_CDECL int SOMQrecipGetStrParam (struct SOMQrecip *recip,
00376                                        int paramtype,
00377                                        char *buffer,
00378                                        size_t buflen,
00379                                        size_t *paramlenp);
00380 
00381 
00390 SOMAPI_CDECL int SOMQrecipGetIntParam (struct SOMQrecip *recip,
00391                                        int paramtype,
00392                                        int *valp);
00393 
00404 SOMAPI_CDECL int SOMQinmsgGetStrParam (struct SOMQinmsg *inmsg,
00405                                        int paramtype,
00406                                        char *buffer,
00407                                        size_t buflen,
00408                                        size_t *paramlenp);
00409 
00410 
00419 SOMAPI_CDECL int SOMQinmsgGetIntParam (struct SOMQinmsg *inmsg,
00420                                        int paramtype,
00421                                        int *valp);
00422 
00433 SOMAPI_CDECL int SOMQassocGetStrParam (struct SOMQassoc *assoc,
00434                                        int paramtype,
00435                                        char *buffer,
00436                                        size_t buflen,
00437                                        size_t *paramlenp);
00438 
00439 
00448 SOMAPI_CDECL int SOMQassocGetIntParam (struct SOMQassoc *assoc,
00449                                        int paramtype,
00450                                        int *valp);
00451 
00452 /* \} */
00453 
00465 struct SOMQfilterSet;
00466 struct SOMQfilter;
00467 struct SOMQselector;
00468 
00474 SOMAPI_CDECL struct SOMQfilter *SOMQfilterNew (void);
00475 
00483 SOMAPI_CDECL struct SOMQfilter *SOMQfilterChain (struct SOMQfilter *fp,
00484                                                  struct SOMQfilter *newp);
00485 
00491 SOMAPI_CDECL struct SOMQselector *SOMQselectorNew (void);
00492 
00493 
00502 SOMAPI_CDECL int SOMQfilterDelete (struct SOMQfilter *fp);
00503 
00510 SOMAPI_CDECL int SOMQselectorDelete (struct SOMQselector *fp);
00511 
00521 SOMAPI_CDECL int SOMQfilterAddStrParam (struct SOMQfilter *fp,
00522                                         int paramtype,
00523                                         const char *value,
00524                                         size_t length);
00525  
00535 SOMAPI_CDECL int SOMQfilterAddIntParam (struct SOMQfilter *fp,
00536                                         int paramtype,
00537                                         int value);
00538 
00555 SOMAPI_CDECL int SOMQselectorAddStrParam (struct SOMQselector *fp,
00556                                           int paramtype,
00557                                           const char *value,
00558                                           size_t length);
00559  
00575 SOMAPI_CDECL int SOMQselectorAddIntParam (struct SOMQselector *fp,
00576                                           int paramtype,
00577                                           int value);
00578 
00579 /* \} */
00580 
00581 
00591 enum som_qmcontrol {
00592     SOM_QM_ABORT,               
00593     SOM_QM_SHUTDOWN,            
00594     SOM_QM_RESTART,             
00595     SOM_QM_REREADQUEUE,         
00596     SOM_QM_DISABLE_SUBMISSION,  
00597     SOM_QM_ENABLE_SUBMISSION,   
00598     SOM_QM_DISABLE_ALL,         
00599     SOM_QM_ENABLE_ALL,          
00600     SOM_QM_INCREASE_MAXCHANS,   
00601     SOM_QM_DECREASE_MAXCHANS,   
00602     SOM_QM_LOAD_CONFIG          
00603 };
00604 
00606 enum som_qocontrol {
00607     SOM_QO_STOP,          
00608     SOM_QO_START,         
00609     SOM_QO_DISABLE_IN,    
00610     SOM_QO_ENABLE_IN,     
00611     SOM_QO_DELAY_CLEAR,   
00612     SOM_QO_DELAY_SET,     
00615     SOM_QO_MINIMISE,      
00623     SOM_QO_DELETE,        
00624     SOM_QO_CONNECT,       
00625     SOM_QO_DISCONNECT,    
00626     SOM_QO_TIMEOUT,       
00627     SOM_QO_NONDELIVER,    
00630     SOM_QO_REDIRECT,      
00631     SOM_QO_REPROCESS,     
00632     SOM_QO_RELOAD,        
00633     SOM_QO_ABORT,         
00634     SOM_QO_PAUSE,         
00635     SOM_QO_RESUME         
00636 };
00637 
00648 SOMAPI_CDECL int SOMQueueControl (struct SOMSession *session,
00649                                   enum som_qmcontrol control,
00650                                   void              *ophandle,
00651                                   int                async);
00652 
00653 
00666 SOMAPI_CDECL int SOMQueueStatus (struct SOMSession *session,
00667                                  void              *ophandle,
00668                                  int                async);
00669 
00670 
00686 SOMAPI_CDECL int SOMQchannelControl (struct SOMSession   *session,
00687                                      struct SOMQselector *selector,
00688                                      enum som_qocontrol   control,
00689                                      const char          *data,
00690                                      int                  datalen,
00691                                      void                *ophandle,
00692                                      int                  async);
00693 
00694 
00707 SOMAPI_CDECL int SOMQchannelRead (struct SOMSession   *session,
00708                                   struct SOMQselector *selector,
00709                                   void                *ophandle,
00710                                   int                  async);
00711 
00727 SOMAPI_CDECL int SOMQmtaControl (struct SOMSession   *session,
00728                                  struct SOMQselector *selector,
00729                                  enum som_qocontrol   control,
00730                                  const char          *data,
00731                                  int                  datalen,
00732                                  void                *ophandle,
00733                                  int                  async);
00734 
00735 
00753 SOMAPI_CDECL int SOMQmtaRead (struct SOMSession   *session,
00754                               struct SOMQselector *selector,
00755                               int                  limit,
00756                               void                *ophandle,
00757                               int                  async);
00758 
00774 SOMAPI_CDECL int SOMQmessageControl (struct SOMSession   *session,
00775                                      struct SOMQselector *selector,
00776                                      enum som_qocontrol   control,
00777                                      const char          *data,
00778                                      int                  datalen,
00779                                      void                *ophandle,
00780                                      int                  async);
00781 
00782 
00796 SOMAPI_CDECL int SOMQmessageRead (struct SOMSession   *session,
00797                                   struct SOMQselector *selector,
00798                                   int                  limit,
00799                                   void                *ophandle,
00800                                   int                  async);
00801 
00802 
00815 SOMAPI_CDECL int SOMQmessageSearch (struct SOMSession   *session,
00816                                     struct SOMQfilter   *filter,
00817                                     void                *ophandle,
00818                                     int                  async);
00819 
00820 
00821 /* \} */
00822 
00823 #endif /* _SOM_QUEUE_H */