PageRenderTime 58ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://mobicents.googlecode.com/
Java | 381 lines | 52 code | 44 blank | 285 comment | 0 complexity | 89e3f1bd4e008f2e11c2e0c2075f7865 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.DiameterMessage;
  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.MediaComponentDescriptionAvp;
  31. /**
  32. *
  33. * The RAA command, indicated by the Command-Code field set to 258 and the 'R'
  34. * bit cleared in the Command Flags field, is sent by the AF to the PCRF in
  35. * response to the RAR command. Message Format:
  36. *
  37. * <pre>
  38. * <RA-Answer> ::= < Diameter Header: 258, PXY >
  39. * < Session-Id >
  40. * { Origin-Host }
  41. * { Origin-Realm }
  42. * [ Result-Code ]
  43. * [ Experimental-Result ]
  44. * *[ Media-Component-Description ]
  45. * [ Service-URN ]
  46. * [ Origin-State-Id ]
  47. * *[ Class ]
  48. * [ Error-Message ]
  49. * [ Error-Reporting-Host ]
  50. * *[ Redirect-Host ]
  51. * [ Redirect-Host-Usage ]
  52. * [ Redirect-Max-Cache-Time ]
  53. * *[ Failed-AVP ]
  54. * *[ Proxy-Info ]
  55. * </pre>
  56. *
  57. * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a>
  58. * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a>
  59. * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a>
  60. */
  61. public interface ReAuthAnswer extends DiameterMessage {
  62. static final int commandCode = 258;
  63. /**
  64. * Returns true if the Experimental-Result AVP is present in the message.
  65. */
  66. boolean hasExperimentalResult();
  67. /**
  68. * Returns the value of the Experimental-Result AVP, of type
  69. * ExperimentalResultAvp.
  70. *
  71. * @return the value of the Experimental-Result AVP or null if it has not
  72. * been set on this message
  73. */
  74. ExperimentalResultAvp getExperimentalResult();
  75. /**
  76. * Sets the value of the Experimental-Result AVP, of type
  77. * ExperimentalResultAvp.
  78. *
  79. * @throws IllegalStateException
  80. * if setErrorReportingHost has already been called
  81. */
  82. void setExperimentalResult(ExperimentalResultAvp experimentalResult) throws IllegalStateException;
  83. /**
  84. * Check if the we have a Result-Code AVP in this message.
  85. *
  86. * @return true if the Result-Code AVP is present in the message.
  87. */
  88. boolean hasResultCode();
  89. /**
  90. * Returns the value of the Result-Code AVP, of type Unsigned32. Use
  91. * {@link #hasResultCode()} to check the existence of this AVP.
  92. *
  93. * @return the value of the Result-Code AVP
  94. */
  95. long getResultCode();
  96. /**
  97. * Sets the value of the Result-Code AVP, of type Unsigned32.
  98. *
  99. * @param resultCode
  100. * the result code to set.
  101. */
  102. void setResultCode(long resultCode);
  103. /**
  104. * Check if Media-Component-Description AVP (AVP code 517) is present in
  105. * message. Returns true in case it is.
  106. *
  107. * @return
  108. */
  109. public boolean hasMediaComponentDescription();
  110. /**
  111. * The Media-Component-Description AVP (AVP code 517) is of type Grouped,
  112. * and it contains service information for a single media component within
  113. * an AF session or the AF signalling information. The service information
  114. * may be based on the SDI exchanged between the AF and the AF session
  115. * client in the UE. The information may be used by the PCRF to determine
  116. * authorized QoS and IP flow classifiers for bearer authorization and PCC
  117. * rule selection.
  118. *
  119. * @param mcd
  120. */
  121. public void setMediaComponentDescription(MediaComponentDescriptionAvp mcd);
  122. public void setMediaComponentDescriptions(MediaComponentDescriptionAvp[] mcds);
  123. public MediaComponentDescriptionAvp[] getMediaComponentDescriptions();
  124. /**
  125. * Checks if the Service-URN AVP (AVP code 525) is present in message. In
  126. * case it is, method returns true.
  127. *
  128. * @return
  129. */
  130. public boolean hasServiceURN();
  131. /**
  132. * Sets value of the Service-URN AVP (AVP code 525), of type OctetString. It
  133. * indicates that an AF session is used for emergency traffic.
  134. *
  135. * @param serviceURN
  136. */
  137. public void setServiceURN(byte[] serviceURN);
  138. /**
  139. * Fetches value of the Service-URN AVP (AVP code 525).
  140. *
  141. * @return
  142. */
  143. public byte[] getServiceURN();
  144. /**
  145. * Returns true if the Origin-State-Id AVP is present in the message.
  146. */
  147. public boolean hasOriginStateId();
  148. /**
  149. * Returns the value of the Origin-State-Id AVP, of type Unsigned32. Use
  150. * {@link #hasOriginStateId()} to check the existence of this AVP.
  151. *
  152. * @return the value of the Origin-State-Id AVP
  153. * @throws IllegalStateException
  154. * if the Origin-State-Id AVP has not been set on this message
  155. */
  156. public long getOriginStateId();
  157. /**
  158. * Sets the value of the Origin-State-Id AVP, of type Unsigned32.
  159. *
  160. * @throws IllegalStateException
  161. * if setOriginStateId has already been called
  162. */
  163. public void setOriginStateId(long originStateId);
  164. /**
  165. * Returns true if the Error-Message AVP is present in the message.
  166. */
  167. boolean hasErrorMessage();
  168. /**
  169. * Returns the value of the Error-Message AVP, of type UTF8String.
  170. *
  171. * @return the value of the Error-Message AVP or null if it has not been set
  172. * on this message
  173. */
  174. String getErrorMessage();
  175. /**
  176. * Sets the value of the Error-Message AVP, of type UTF8String.
  177. *
  178. * @throws IllegalStateException
  179. * if setErrorMessage has already been called
  180. */
  181. void setErrorMessage(String errorMessage) throws IllegalStateException;
  182. /**
  183. * Returns true if the Error-Reporting-Host AVP is present in the message.
  184. */
  185. boolean hasErrorReportingHost();
  186. /**
  187. * Returns the value of the Error-Reporting-Host AVP, of type
  188. * DiameterIdentity.
  189. *
  190. * @return the value of the Error-Reporting-Host AVP or null if it has not
  191. * been set on this message
  192. */
  193. DiameterIdentity getErrorReportingHost();
  194. /**
  195. * Sets the value of the Error-Reporting-Host AVP, of type DiameterIdentity.
  196. *
  197. * @throws IllegalStateException
  198. * if setErrorReportingHost has already been called
  199. */
  200. void setErrorReportingHost(DiameterIdentity errorReportingHost) throws IllegalStateException;
  201. /**
  202. * Returns the set of Failed-AVP AVPs. The returned array contains the AVPs
  203. * in the order they appear in the message. A return value of null implies
  204. * that no Failed-AVP AVPs have been set. The elements in the given array
  205. * are FailedAvp objects.
  206. */
  207. FailedAvp[] getFailedAvps();
  208. /**
  209. * Sets a single Failed-AVP AVP in the message, of type Grouped.
  210. *
  211. * @throws IllegalStateException
  212. * if setFailedAvp or setFailedAvps has already been called
  213. */
  214. void setFailedAvp(FailedAvp failedAvp);
  215. /**
  216. * Sets the set of Failed-AVP AVPs, with all the values in the given array.
  217. * The AVPs will be added to message in the order in which they appear in
  218. * the array.
  219. *
  220. * Note: the array must not be altered by the caller following this call,
  221. * and getFailedAvps() is not guaranteed to return the same array instance,
  222. * e.g. an "==" check would fail.
  223. *
  224. * @throws IllegalStateException
  225. * if setFailedAvp or setFailedAvps has already been called
  226. */
  227. void setFailedAvps(FailedAvp[] failedAvps);
  228. /**
  229. * Returns the set of Redirect-Host AVPs. The returned array contains the
  230. * AVPs in the order they appear in the message. A return value of null
  231. * implies that no Redirect-Host AVPs have been set. The elements in the
  232. * given array are DiameterURI objects.
  233. */
  234. DiameterURI[] getRedirectHosts();
  235. /**
  236. * Sets a single Redirect-Host AVP in the message, of type DiameterURI.
  237. *
  238. * @throws IllegalStateException
  239. * if setRedirectHost or setRedirectHosts has already been
  240. * called
  241. */
  242. void setRedirectHost(DiameterURI redirectHost);
  243. /**
  244. * Sets the set of Redirect-Host AVPs, with all the values in the given
  245. * array. The AVPs will be added to message in the order in which they
  246. * appear in the array.
  247. *
  248. * Note: the array must not be altered by the caller following this call,
  249. * and getRedirectHosts() is not guaranteed to return the same array
  250. * instance, e.g. an "==" check would fail.
  251. *
  252. * @throws IllegalStateException
  253. * if setRedirectHost or setRedirectHosts has already been
  254. * called
  255. */
  256. void setRedirectHosts(DiameterURI[] redirectHosts);
  257. /**
  258. * Returns true if the Redirect-Host-Usage AVP is present in the message.
  259. */
  260. boolean hasRedirectHostUsage();
  261. /**
  262. * Returns the value of the Redirect-Host-Usage AVP, of type Enumerated.
  263. *
  264. * @return the value of the Redirect-Host-Usage AVP or null if it has not
  265. * been set on this message
  266. */
  267. RedirectHostUsageType getRedirectHostUsage();
  268. /**
  269. * Sets the value of the Redirect-Host-Usage AVP, of type Enumerated.
  270. *
  271. * @throws IllegalStateException
  272. * if setRedirectHostUsage has already been called
  273. */
  274. void setRedirectHostUsage(RedirectHostUsageType redirectHostUsage);
  275. /**
  276. * Returns true if the Redirect-Max-Cache-Time AVP is present in the
  277. * message.
  278. */
  279. boolean hasRedirectMaxCacheTime();
  280. /**
  281. * Returns the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32.
  282. * Use {@link #hasRedirectMaxCacheTime()} to check the existence of this
  283. * AVP.
  284. *
  285. * @return the value of the Redirect-Max-Cache-Time AVP
  286. * @throws IllegalStateException
  287. * if the Redirect-Max-Cache-Time AVP has not been set on this
  288. * message
  289. */
  290. long getRedirectMaxCacheTime();
  291. /**
  292. * Sets the value of the Redirect-Max-Cache-Time AVP, of type Unsigned32.
  293. *
  294. * @throws IllegalStateException
  295. * if setRedirectMaxCacheTime has already been called
  296. */
  297. void setRedirectMaxCacheTime(long redirectMaxCacheTime);
  298. /**
  299. * Returns the set of Proxy-Info AVPs. The returned array contains the AVPs
  300. * in the order they appear in the message. A return value of null implies
  301. * that no Proxy-Info AVPs have been set. The elements in the given array
  302. * are ProxyInfo objects.
  303. */
  304. ProxyInfoAvp[] getProxyInfos();
  305. /**
  306. * Sets a single Proxy-Info AVP in the message, of type Grouped.
  307. *
  308. * @throws IllegalStateException
  309. * if setProxyInfo or setProxyInfos has already been called
  310. */
  311. void setProxyInfo(ProxyInfoAvp proxyInfo);
  312. /**
  313. * Sets the set of Proxy-Info AVPs, with all the values in the given array.
  314. * The AVPs will be added to message in the order in which they appear in
  315. * the array.
  316. *
  317. * Note: the array must not be altered by the caller following this call,
  318. * and getProxyInfos() is not guaranteed to return the same array instance,
  319. * e.g. an "==" check would fail.
  320. *
  321. * @throws IllegalStateException
  322. * if setProxyInfo or setProxyInfos has already been called
  323. */
  324. void setProxyInfos(ProxyInfoAvp[] proxyInfos);
  325. /**
  326. * Returns true if the Proxy-Info AVP is present in the message.
  327. */
  328. boolean hasProxyInfo();
  329. /**
  330. * Returns true if the Redirect-Hosts AVP is present in the message.
  331. */
  332. boolean hasRedirectHosts();
  333. /**
  334. * Returns true if the Failed-AVP AVP is present in the message.
  335. */
  336. boolean hasFailedAvp();
  337. }