Remove dynamic exceptions
[anna.git] / include / anna / diameter / app / dcca / huawei / Message.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_diameter_app_dcca_huawei_Message_hpp
10 #define anna_diameter_app_dcca_huawei_Message_hpp
11
12
13 // Local
14 #include <anna/diameter/app/dcca/Message.hpp>
15
16 // AVPID's
17 #include <anna/diameter/helpers/huawei/defines.hpp>
18
19 #include <anna/core/RuntimeException.hpp>
20
21
22 //------------------------------------------------------------------------------
23 //---------------------------------------------------------------------- #define
24 //------------------------------------------------------------------------------
25
26
27
28 namespace anna {
29
30 namespace diameter {
31
32 namespace codec {
33 using namespace basetypes;
34 }
35
36 namespace app {
37
38 namespace dcca {
39
40 namespace huawei {
41
42
43 /**
44 * Diameter message for Nokia DCCA (diameter credit control application)
45 */
46 class Message : public anna::diameter::app::dcca::Message {
47
48 public:
49
50   /**
51      Avp PS-Information pointer reference
52      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
53   */
54   const anna::diameter::codec::Avp * getPSInformation(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
55     ASSERT_APP_GETAVP(
56       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
57                getAvp(helpers::tgpp::AVPID__PS_Information);
58     );
59   }
60
61   /**
62      Avp Called-Station-Id data-part pointer reference
63      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
64   */
65   const UTF8String * getCalledStationId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
66     ASSERT_APP_GETAVP(
67       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
68                getAvp(helpers::tgpp::AVPID__PS_Information)->
69                getAvp(helpers::radius::AVPID__Called_Station_Id)->getUTF8String();
70     );
71   }
72
73   /**
74      Avp 3GPP-PDP-Type data-part pointer reference
75      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
76   */
77   const Unsigned32 * get3GPPPDPType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
78     ASSERT_APP_GETAVP(
79       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
80                getAvp(helpers::tgpp::AVPID__PS_Information)->
81                getAvp(helpers::tgpp::AVPID__3GPP_PDP_Type)->getUnsigned32();
82     );
83   }
84
85   /**
86      Avp 3GPP-SGSN-MCC-MNC data-part pointer reference
87      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
88   */
89   const UTF8String * get3GPPSGSNMCCMNC(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
90     ASSERT_APP_GETAVP(
91       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
92                getAvp(helpers::tgpp::AVPID__PS_Information)->
93                getAvp(helpers::tgpp::AVPID__3GPP_SGSN_MCC_MNC)->getUTF8String();
94     );
95   }
96
97   /**
98      Avp 3GPP-Charging-Characteristics data-part pointer reference
99      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
100   */
101   const UTF8String * get3GPPChargingCharacteristics(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
102     ASSERT_APP_GETAVP(
103       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
104                getAvp(helpers::tgpp::AVPID__PS_Information)->
105                getAvp(helpers::tgpp::AVPID__3GPP_Charging_Characteristics)->getUTF8String();
106     );
107   }
108
109   /**
110      Avp 3GPP-GPRS-Neg-QoS-Profile data-part pointer reference
111      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
112   */
113   const UTF8String * get3GPPGPRSNegQoSProfile(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
114     ASSERT_APP_GETAVP(
115       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
116                getAvp(helpers::tgpp::AVPID__PS_Information)->
117                getAvp(helpers::tgpp::AVPID__3GPP_GPRS_Neg_QoS_Profile)->getUTF8String();
118     );
119   }
120
121   /**
122      Avp CG-Address data-part pointer reference
123      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
124   */
125   const Address * getCGAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
126     ASSERT_APP_GETAVP(
127       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
128                getAvp(helpers::tgpp::AVPID__PS_Information)->
129                getAvp(helpers::tgpp::AVPID__CG_Address)->getAddress();
130     );
131   }
132
133   /**
134      Avp 3GPP-Rat-Type data-part pointer reference
135      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
136   */
137   const OctetString * get3GPPRatType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
138     ASSERT_APP_GETAVP(
139       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
140                getAvp(helpers::tgpp::AVPID__PS_Information)->
141                getAvp(helpers::tgpp::AVPID__3GPP_Rat_Type)->getOctetString();
142     );
143   }
144
145   /**
146      Avp SGSN-Address data-part pointer reference
147      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
148   */
149   const Address * getSGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
150     ASSERT_APP_GETAVP(
151       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
152                getAvp(helpers::tgpp::AVPID__PS_Information)->
153                getAvp(helpers::tgpp::AVPID__SGSN_Address)->getAddress();
154     );
155   }
156
157   /**
158      Avp GGSN-Address data-part pointer reference
159      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
160   */
161   const Address * getGGSNAddress(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
162     ASSERT_APP_GETAVP(
163       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
164                getAvp(helpers::tgpp::AVPID__PS_Information)->
165                getAvp(helpers::tgpp::AVPID__GGSN_Address)->getAddress();
166     );
167   }
168
169   /**
170      Avp 3GPP-Charging-Id data-part pointer reference
171      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
172   */
173   const Unsigned32 * get3GPPChargingId(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
174     ASSERT_APP_GETAVP(
175       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
176                getAvp(helpers::tgpp::AVPID__PS_Information)->
177                getAvp(helpers::tgpp::AVPID__3GPP_Charging_Id)->getUnsigned32();
178     );
179   }
180
181   /**
182      Avp Reporting-Reason data-part pointer reference
183      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
184   */
185   const Enumerated * getReportingReason(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
186     ASSERT_APP_GETAVP(return getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->getAvp(helpers::tgpp::AVPID__Reporting_Reason)->getEnumerated());
187   }
188
189   /**
190      Avp Trigger-Type data-part pointer reference
191      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
192   */
193   const Enumerated * getTriggerType(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
194     ASSERT_APP_GETAVP(
195       return   getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
196                getAvp(helpers::tgpp::AVPID__Trigger)->
197                getAvp(helpers::tgpp::AVPID__Trigger_Type)->getEnumerated();
198     );
199   }
200
201   /**
202      Avp PS-Furnish-Charging-Information pointer reference
203      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
204   */
205   const anna::diameter::codec::Avp * getPSFurnishChargingInformation(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
206     ASSERT_APP_GETAVP(
207       return   getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
208                getAvp(helpers::tgpp::AVPID__PS_Furnish_Charging_Information);
209     );
210   }
211
212   /**
213      Avp PS-Free-Format-Data data-part pointer reference
214      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
215   */
216   const OctetString * getPSFreeFormatData(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
217     ASSERT_APP_GETAVP(
218       return   getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
219                getAvp(helpers::tgpp::AVPID__PS_Furnish_Charging_Information)->
220                getAvp(helpers::tgpp::AVPID__PS_Free_Format_Data)->getOctetString();
221     );
222   }
223
224   /**
225      Avp PS-Append-Free-Format-Data data-part pointer reference
226      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
227   */
228   const Enumerated * getPSAppendFreeFormatData(anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
229     ASSERT_APP_GETAVP(
230       return   getAvp(helpers::dcca::AVPID__Multiple_Services_Credit_Control)->
231                getAvp(helpers::tgpp::AVPID__PS_Furnish_Charging_Information)->
232                getAvp(helpers::tgpp::AVPID__PS_Append_Free_Format_Data)->getEnumerated();
233     );
234   }
235
236   /**
237      Avp n-th PDP-Address pointer reference
238      @param ocurrence Select the n-th PDP-Address within the PS-Information. First by default.
239      @param emode Excepcion mode handling when avp is not found: Ignore (no action is taken but debug trace), Throw (exception launched, by default), Trace (trace warning).
240   */
241   const Address * getPDPAddress(int ocurrence = 1, anna::Exception::Mode::_v emode = anna::Exception::Mode::Throw) noexcept(false) {
242     ASSERT_APP_GETAVP(
243       return   getAvp(helpers::tgpp::AVPID__Service_Information)->
244                getAvp(helpers::tgpp::AVPID__PS_Information)->
245                getAvp(helpers::tgpp::AVPID__PDP_Address)->getAddress();
246     );
247   }
248 };
249
250 }
251 }
252 }
253 }
254 }
255
256 #endif