OnixS CME Drop Copy Handler C++ library  5.6.0
API documentation
Handler.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable OnixS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
20 #pragma once
21 
22 #include "OnixS/CME/DropCopy/Export.h"
24 
30 
31 namespace OnixS { namespace CME { namespace DropCopy {
32 
33 /// CME Drop Copy Handler.
34 class ONIXS_CME_DROP_COPY_EXPORT Handler
35 {
36 public:
37  /// Initialize instance.
38  ///
39  /// \param settings Handler settings.
40  Handler (const HandlerSettings& settings);
41 
42  /// Finalize instance.
43  ~Handler();
44 
45  /// Log a debug message.
46  ///
47  /// \param message Message.
48  void logDebug (const std::string& message);
49 
50  /// Log an error message.
51  ///
52  /// \param message Message.
53  void logError (const std::string& message);
54 
55  /// Log an information message.
56  ///
57  /// \param message Message.
58  void logMessage (const std::string& message);
59 
60  /// Log a warning message.
61  ///
62  /// \param message Message.
63  void logWarning (const std::string& message);
64 
65  /// Register the error listener.
66  ///
67  /// \param listener Error listener.
68  void registerErrorListener (ErrorListener* listener);
69 
70  /// Register the warning listener.
71  ///
72  /// \param listener Warning listener.
73  void registerWarningListener (WarningListener* listener);
74 
75  /// Register the Handler state change listener.
76  ///
77  /// \param listener Handler state change listener.
78  void registerHandlerStateChangeListener (HandlerStateChangeListener* listener);
79 
80  /// Register the Handler state change listener.
81  ///
82  /// \param listener DropCopy service listener.
83  void registerDropCopyServiceListener (DropCopyServiceListener* listener);
84 
85  /// Logon to CME DropCopy session.
86  ///
87  /// \param host CME Session host.
88  /// \param port CME Session port.
89  /// \param accessKeyId CME access key ID.
90  /// \param secretKey CME secret key.
91  void logon (
92  const std::string& host
93  , int port
94  , const std::string& accessKeyId
95  , const std::string& secretKey
96  );
97 
98  /// Logout from CME drop copy session.
99  void logout();
100 
101  /// Reset session sequence numbers and stored application feed IDs.
102  void reset ();
103 
104  /**
105  * Gets an expected sequence number of the next incoming message.
106  *
107  * \returns The expected sequence number of the next incoming message.
108  */
109  int inSeqNum() const;
110 
111  /**
112  * Sets an expected sequence number of the next incoming message.
113  *
114  * \param seqNum The expected sequence number of the next incoming message.
115  */
116  void inSeqNum(int seqNum);
117 
118  /**
119  * Gets a sequence number of the next outgoing message.
120  *
121  * \returns The sequence number of the next outgoing message.
122  */
123  int outSeqNum() const;
124 
125  /**
126  * Sets a sequence number of the next outgoing message.
127  *
128  * \param seqNum The sequence number of the next outgoing message.
129  */
130  void outSeqNum(int seqNum);
131 
132  /// Returns Handler's version.
133  static const std::string& version();
134 
135 private:
136  Handler(const Handler&); //no implementation
137  Handler& operator=(const Handler&); //no implementation
138 
139 private:
140  struct Impl;
141  Impl* impl_;
142 };
143 
144 }}}
Handler's configuration settings.
CME Drop Copy Handler.
Definition: Handler.h:34