PageRenderTime 51ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/servers/jain-slee/resources/diameter-rx/events/src/main/java/net/java/slee/resource/diameter/rx/events/AAAnswer.java

http://mobicents.googlecode.com/
Java | 417 lines | 64 code | 54 blank | 299 comment | 0 complexity | 54f85b6c804e0aeadc1bbafb0fcf223d MD5 | raw file
Possible License(s): LGPL-3.0, GPL-3.0, LGPL-2.1, GPL-2.0, CC-BY-SA-3.0, CC0-1.0, Apache-2.0, BSD-3-Clause
  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and individual contributors
  4. * by the @authors tag. See the copyright.txt in the distribution for a
  5. * full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package net.java.slee.resource.diameter.rx.events;
  23. import net.java.slee.resource.diameter.base.events.avp.Address;
  24. import net.java.slee.resource.diameter.base.events.avp.DiameterIdentity;
  25. import net.java.slee.resource.diameter.base.events.avp.DiameterURI;
  26. import net.java.slee.resource.diameter.base.events.avp.ExperimentalResultAvp;
  27. import net.java.slee.resource.diameter.base.events.avp.FailedAvp;
  28. import net.java.slee.resource.diameter.base.events.avp.ProxyInfoAvp;
  29. import net.java.slee.resource.diameter.base.events.avp.RedirectHostUsageType;
  30. import net.java.slee.resource.diameter.rx.events.avp.AcceptableServiceInfoAvp;
  31. import net.java.slee.resource.diameter.rx.events.avp.AccessNetworkChargingIdentifierAvp;
  32. import net.java.slee.resource.diameter.rx.events.avp.IPCANType;
  33. import net.java.slee.resource.diameter.rx.events.avp.RATType;
  34. /**
  35. * The AAA command, indicated by the Command-Code field set to 265 and the 'R'
  36. * bit cleared in the Command Flags field, is sent by the PCRF to the AF in
  37. * response to the AAR command.
  38. *
  39. * <pre>
  40. *
  41. * < AA-Answer> ::= < Diameter Header: 265, PXY >
  42. * < Session-Id >
  43. * { Auth-Application-Id }
  44. * { Origin-Host }
  45. * { Origin-Realm }
  46. * [ Result-Code ]
  47. * [ Experimental-Result ]
  48. * *[ Access-Network-Charging-Identifier ]
  49. * [ Access-Network-Charging-Address ]
  50. * [ Acceptable-Service-Info ]
  51. * [ IP-CAN-Type ]
  52. * [ RAT-Type ]
  53. * *[ Supported-Features ]
  54. * *[ Class ]
  55. * [ Error-Message ]
  56. * [ Error-Reporting-Host ]
  57. * *[ Failed-AVP ]
  58. * [ Origin-State-Id ]
  59. * *[ Redirect-Host ]
  60. * [ Redirect-Host-Usage ]
  61. * [ Redirect-Max-Cache-Time ]
  62. * *[ Proxy-Info ]
  63. * *[ AVP ]
  64. * </pre>
  65. *
  66. * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a>
  67. * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a>
  68. * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a>
  69. */
  70. public interface AAAnswer extends AAMessage {
  71. static final int commandCode = 265;
  72. /**
  73. * Check if the we have a Result-Code AVP in this message.
  74. * @return true if the Result-Code AVP is present in the message.
  75. */
  76. boolean hasResultCode();
  77. /**
  78. * Returns the value of the Result-Code AVP, of type Unsigned32. Use
  79. * {@link #hasResultCode()} to check the existence of this AVP.
  80. *
  81. * @return the value of the Result-Code AVP
  82. */
  83. long getResultCode();
  84. /**
  85. * Sets the value of the Result-Code AVP, of type Unsigned32.
  86. * @param resultCode the result code to set.
  87. */
  88. void setResultCode(long resultCode);
  89. /**
  90. * Returns true if the Error-Message AVP is present in the message.
  91. */
  92. boolean hasErrorMessage();
  93. /**
  94. * Returns the value of the Error-Message AVP, of type UTF8String.
  95. * @return the value of the Error-Message AVP or null if it has not been set on this message
  96. */
  97. String getErrorMessage();
  98. /**
  99. * Sets the value of the Error-Message AVP, of type UTF8String.
  100. * @throws IllegalStateException if setErrorMessage has already been called
  101. */
  102. void setErrorMessage(String errorMessage) throws IllegalStateException;
  103. /**
  104. * Returns true if the Error-Reporting-Host AVP is present in the message.
  105. */
  106. boolean hasErrorReportingHost();
  107. /**
  108. * Returns the value of the Error-Reporting-Host AVP, of type DiameterIdentity.
  109. * @return the value of the Error-Reporting-Host AVP or null if it has not been set on this message
  110. */
  111. DiameterIdentity getErrorReportingHost();
  112. /**
  113. * Sets the value of the Error-Reporting-Host AVP, of type DiameterIdentity.
  114. * @throws IllegalStateException if setErrorReportingHost has already been called
  115. */
  116. void setErrorReportingHost(DiameterIdentity errorReportingHost) throws IllegalStateException;
  117. /**
  118. * Returns true if the Experimental-Result AVP is present in the message.
  119. */
  120. boolean hasExperimentalResult();
  121. /**
  122. * Returns the value of the Experimental-Result AVP, of type ExperimentalResultAvp.
  123. * @return the value of the Experimental-Result AVP or null if it has not been set on this message
  124. */
  125. ExperimentalResultAvp getExperimentalResult();
  126. /**
  127. * Sets the value of the Experimental-Result AVP, of type ExperimentalResultAvp.
  128. * @throws IllegalStateException if setErrorReportingHost has already been called
  129. */
  130. void setExperimentalResult(ExperimentalResultAvp experimentalResult) throws IllegalStateException;
  131. /**
  132. * Returns true if the Origin-State-Id AVP is present in the message.
  133. */
  134. boolean hasOriginStateId();
  135. /**
  136. * Returns the value of the Origin-State-Id AVP, of type Unsigned32.
  137. * Use {@link #hasOriginStateId()} to check the existence of this AVP.
  138. * @return the value of the Origin-State-Id AVP
  139. * @throws IllegalStateException if the Origin-State-Id AVP has not been set on this message
  140. */
  141. long getOriginStateId();
  142. /**
  143. * Sets the value of the Origin-State-Id AVP, of type Unsigned32.
  144. * @throws IllegalStateException if setOriginStateId has already been called
  145. */
  146. void setOriginStateId(long originStateId);
  147. /**
  148. * Returns true if the Failed-AVP AVP is present in the message.
  149. */
  150. boolean hasFailedAvp();
  151. /**
  152. * Returns the set of Failed-AVP AVPs. The returned array contains
  153. * the AVPs in the order they appear in the message.
  154. * A return value of null implies that no Failed-AVP AVPs have been set.
  155. * The elements in the given array are FailedAvp objects.
  156. */
  157. FailedAvp[] getFailedAvps();
  158. /**
  159. * Sets a single Failed-AVP AVP in the message, of type Grouped.
  160. * @throws IllegalStateException if setFailedAvp or setFailedAvps
  161. * has already been called
  162. */
  163. void setFailedAvp(FailedAvp failedAvp);
  164. /**
  165. * Sets the set of Failed-AVP AVPs, with all the values in the given array.
  166. * The AVPs will be added to message in the order in which they appear in the array.
  167. *
  168. * Note: the array must not be altered by the caller following this call, and
  169. * getFailedAvps() is not guaranteed to return the same array instance,
  170. * e.g. an "==" check would fail.
  171. *
  172. * @throws IllegalStateException if setFailedAvp or setFailedAvps
  173. * has already been called
  174. */
  175. void setFailedAvps(FailedAvp[] failedAvps);
  176. /**
  177. * Returns true if the Redirect-Hosts AVP is present in the message.
  178. */
  179. boolean hasRedirectHosts();
  180. /**
  181. * Returns the set of Redirect-Host AVPs. The returned array contains
  182. * the AVPs in the order they appear in the message.
  183. * A return value of null implies that no Redirect-Host AVPs have been set.
  184. * The elements in the given array are DiameterURI objects.
  185. */
  186. DiameterURI[] getRedirectHosts();
  187. /**
  188. * Sets a single Redirect-Host AVP in the message, of type DiameterURI.
  189. * @throws IllegalStateException if setRedirectHost or setRedirectHosts
  190. * has already been called
  191. */
  192. void setRedirectHost(DiameterURI redirectHost);
  193. /**
  194. * Sets the set of Redirect-Host AVPs, with all the values in the given array.
  195. * The AVPs will be added to message in the order in which they appear in the array.
  196. *
  197. * Note: the array must not be altered by the caller following this call, and
  198. * getRedirectHosts() is not guaranteed to return the same array instance,
  199. * e.g. an "==" check would fail.
  200. *
  201. * @throws IllegalStateException if setRedirectHost or setRedirectHosts
  202. * has already been called
  203. */
  204. void setRedirectHosts(DiameterURI[] redirectHosts);
  205. /**
  206. * Returns true if the Redirect-Host-Usage AVP is present in the message.
  207. */
  208. boolean hasRedirectHostUsage();
  209. /**
  210. * Returns the value of the Redirect-Host-Usage AVP, of type Enumerated.
  211. * @return the value of the Redirect-Host-Usage AVP or null if it has not been set on this message
  212. */
  213. RedirectHostUsageType getRedirectHostUsage();
  214. /**
  215. * Sets the value of the Redirect-Host-Usage AVP, of type Enumerated.
  216. * @throws IllegalStateException if setRedirectHostUsage has already been called
  217. */
  218. void setRedirectHostUsage(RedirectHostUsageType redirectHostUsage);
  219. /**
  220. * Returns true if the Redirect-Max-Cache-Time AVP is present in the message.
  221. */
  222. boolean hasRedirectMaxCacheTime();
  223. /**
  224. * Returns the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32.
  225. * Use {@link #hasRedirectMaxCacheTime()} to check the existence of this AVP.
  226. * @return the value of the Redirect-Max-Cache-Time AVP
  227. * @throws IllegalStateException if the Redirect-Max-Cache-Time AVP has not been set on this message
  228. */
  229. long getRedirectMaxCacheTime();
  230. /**
  231. * Sets the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32.
  232. * @throws IllegalStateException if setRedirectMaxCacheTime has already been called
  233. */
  234. void setRedirectMaxCacheTime(long redirectMaxCacheTime);
  235. /**
  236. * Returns true if the Proxy-Info AVP is present in the message.
  237. */
  238. boolean hasProxyInfo();
  239. /**
  240. * Returns the set of Proxy-Info AVPs. The returned array contains
  241. * the AVPs in the order they appear in the message.
  242. * A return value of null implies that no Proxy-Info AVPs have been set.
  243. * The elements in the given array are ProxyInfo objects.
  244. */
  245. ProxyInfoAvp[] getProxyInfos();
  246. /**
  247. * Sets a single Proxy-Info AVP in the message, of type Grouped.
  248. * @throws IllegalStateException if setProxyInfo or setProxyInfos
  249. * has already been called
  250. */
  251. void setProxyInfo(ProxyInfoAvp proxyInfo);
  252. /**
  253. * Sets the set of Proxy-Info AVPs, with all the values in the given array.
  254. * The AVPs will be added to message in the order in which they appear in the array.
  255. *
  256. * Note: the array must not be altered by the caller following this call, and
  257. * getProxyInfos() is not guaranteed to return the same array instance,
  258. * e.g. an "==" check would fail.
  259. *
  260. * @throws IllegalStateException if setProxyInfo or setProxyInfos
  261. * has already been called
  262. */
  263. void setProxyInfos(ProxyInfoAvp[] proxyInfos);
  264. /**
  265. * Checks if the Access-Network-Charging-Identifier AVP (AVP code 502) is present in message. In case it is, method returns true;
  266. * @return
  267. */
  268. public boolean hasAccessNetworkChargingIdentifier();
  269. /**
  270. * Fetches values of the Access-Network-Charging-Identifier AVP (AVP code 502) from the message.
  271. * @return
  272. */
  273. public AccessNetworkChargingIdentifierAvp[] getAccessNetworkChargingIdentifiers();
  274. /**
  275. * Sets the value of the Access-Network-Charging-Identifier AVP (AVP code
  276. * 502), of type Grouped. It contains a charging identifier (e.g. GCID)
  277. * within the Access-Network-Charging-Identifier-Value AVP along with
  278. * information about the flows transported within the corresponding bearer
  279. * within the Flows AVP. If no Flows AVP is provided, the Access Network
  280. * Charging-Identifier-Value applies for all flows within the AF session.
  281. * The Access-Network-Charging-Identifier AVP can be sent from the PCRF to
  282. * the AF. The AF may use this information for charging correlation with
  283. * session layer.
  284. *
  285. * @param accessNetowrkChargingId
  286. */
  287. public void setAccessNetworkChargingIdentifier(AccessNetworkChargingIdentifierAvp accessNetowrkChargingId);
  288. public void setAccessNetworkChargingIdentifiers(AccessNetworkChargingIdentifierAvp[] accessNetowrkChargingIds);
  289. /**
  290. * Checks if the Access-Network-Charging-Address AVP (AVP code 501) is
  291. * present in message. In case it is, method returns true;
  292. *
  293. * @return
  294. */
  295. public boolean hasAccessNetworkChargingAddress();
  296. /**
  297. * Fetches value of the Access-Network-Charging-Address AVP (AVP code 501)
  298. * ,of type Address. It indicates the IP Address of the network entity
  299. * within the access network performing charging (e.g. the GGSN IP address).
  300. * The Access Network Charging-Address AVP should not be forwarded over an
  301. * inter-operator interface.
  302. *
  303. * @return
  304. */
  305. public Address getAccessNetworkChargingAddress();
  306. /**
  307. * Sets value of the Access-Network-Charging-Address AVP (AVP code 501).
  308. * @param address
  309. */
  310. public void setAccessNetworkChargingAddress(Address address);
  311. /**
  312. * Checks if the Acceptable-Service-Info AVP (AVP code 526) is present in message. In case it is, method returns true;
  313. * @return
  314. */
  315. public boolean hasAcceptableServiceInfo();
  316. /**
  317. * Sets value of the Acceptable-Service-Info AVP (AVP code 526),of type Grouped;
  318. * @param asi
  319. */
  320. public void setAcceptableServiceInfo(AcceptableServiceInfoAvp asi);
  321. /**
  322. * Fetches value of the Acceptable-Service-Info AVP (AVP code 526);
  323. * @return
  324. */
  325. public AcceptableServiceInfoAvp getAcceptableServiceInfo();
  326. /**
  327. * Checks if the IP-CAN-Type AVP (AVP code 1027) is present in message. In case it is, method returns true;
  328. * @return
  329. */
  330. public boolean hasIPCANType();
  331. /**
  332. * Sets value of the IP-CAN-Type AVP (AVP code 1027), of type Enumerated. It
  333. * indicates the type of Connectivity Access Network in which the user is
  334. * connected. The IP-CAN-Type AVP shall always be present during the IP-CAN
  335. * session establishment. During an IP-CAN session modification, this AVP
  336. * shall be present when there has been a change in the IP-CAN type and the
  337. * PCRF requested to be informed of this event. The Event-Trigger AVP with
  338. * value IP-CAN-CHANGE shall be provided together with the IP-CAN-Type AVP.
  339. *
  340. * @param ipCanType
  341. */
  342. public void setIPCANType(IPCANType ipCanType);
  343. /**
  344. * Fetches value of the IP-CAN-Type AVP (AVP code 1027);
  345. * @return
  346. */
  347. public IPCANType getIPCANType();
  348. /**
  349. * Checks if the RAT-Type AVP (AVP code 1032) is present in message. In case it is, method returns true;
  350. * @return
  351. */
  352. public boolean hasRATType();
  353. /**
  354. * Sets the value of the RAT-Type AVP (AVP code 1032), of type enumerated. It is used to identify the radio access technology that is serving the UE.
  355. * @param ratType
  356. */
  357. public void setRATType(RATType ratType);
  358. /**
  359. * Fetches value of the RAT-Type AVP (AVP code 1032);
  360. * @return
  361. */
  362. public RATType getRATType();
  363. }