PageRenderTime 170ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://mobicents.googlecode.com/
Java | 184 lines | 62 code | 13 blank | 109 comment | 1 complexity | a2c6459963819a8eba553caa222a2f0d 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.avp;
  23. import java.io.StreamCorruptedException;
  24. import net.java.slee.resource.diameter.base.events.avp.Enumerated;
  25. /**
  26. * The Specific-Action AVP (AVP code 513) is of type Enumerated. Within a PCRF
  27. * initiated Re-Authorization Request, the Specific-Action AVP determines the
  28. * type of the action. Within an initial AA request the AF may use the
  29. * Specific-Action AVP to request specific actions from the server at the bearer
  30. * events and to limit the contact to such bearer events where specific action
  31. * is required. If the Specific-Action AVP is omitted within the initial AA
  32. * request, no notification of any of the events defined below is requested. The
  33. * following values are defined:
  34. *
  35. * <pre>
  36. * Void (0)
  37. * CHARGING_CORRELATION_EXCHANGE (1)
  38. * Within a RAR, this value shall be used when the server reports the access network
  39. * charging identifier to the AF. The Access-Network-Charging-Identifier AVP shall be
  40. * included within the request. In the AAR, this value indicates that the AF requests
  41. * the server to provide the access network charging identifier to the AF for each authorized flow,
  42. * when the access network charging identifier becomes known at the PCRF.
  43. * INDICATION_OF_LOSS_OF_BEARER (2)
  44. * Within a RAR, this value shall be used when the server reports a loss of a bearer
  45. * (e.g. in the case of GPRS PDP context bandwidth modification to 0 kbit) to the AF.
  46. * The SDFs that are deactivated as a consequence of this loss of bearer shall be provided within
  47. * the Flows AVP. In the AAR, this value indicates that the AF requests the server to provide
  48. * a notification at the loss of a bearer.
  49. * INDICATION_OF_RECOVERY_OF_BEARER (3)
  50. * Within a RAR, this value shall be used when the server reports a recovery of a bearer
  51. * (e.g. in the case of GPRS, PDP context bandwidth modification from 0 kbit to another value)
  52. * to the AF. The SDFs that are re-activated as a consequence of the recovery of bearer shall be
  53. * provided within the Flows AVP. In the AAR, this value indicates that the AF requests the server to
  54. * provide a notification at the recovery of a bearer.
  55. * INDICATION_OF_RELEASE_OF_BEARER (4)
  56. * Within a RAR, this value shall be used when the server reports the release of a bearer
  57. * (e.g. PDP context removal for GPRS) to the AF. The SDFs that are deactivated as a consequence
  58. * of this release of bearer shall be provided within the Flows AVP. In the AAR, this value indicates
  59. * that the AF requests the server to provide a notification at the removal of a bearer.
  60. * Void (5)
  61. * IP-CAN_CHANGE (6)
  62. * This value shall be used in RAR command by the PCRF to indicate a change in the IP-CAN type or
  63. * RAT type (if the IP-CAN type is GPRS). When used in an AAR command, this value indicates that
  64. * the AF is requesting subscription to IP-CAN change and RAT change notification. When used in RAR
  65. * it indicates that the PCRF generated the request because of an IP-CAN or RAT change. IP-CAN-Type
  66. * AVP and RAT-Type AVP (if the IP-CAN type is GPRS) shall be provided in the same request with the
  67. * new/valid value(s). If an IP-CAN type or RAT type change is due to IP flow mobility and a
  68. * subset of the flows within the AF session is affected, the affected service data flows shall be
  69. * provided in the same request.
  70. * INDICATION_OF_OUT_OF_CREDIT (7)
  71. * Within a RAR, this value shall be used when the PCRF reports to the AF that SDFs have run out of
  72. * credit, and that the termination action indicated by the corresponding Final-Unit-Action AVP
  73. * applies (3GPP TS 32.240 [23] and 3GPP TS 32.299 [24). The SDFs that are impacted as a consequence
  74. * of the out of credit condition shall be provided within the Flows AVP. In the AAR, this value
  75. * indicates that the AF requests the PCRF to provide a notification of SDFs for which credit is no
  76. * longer available. Applicable to functionality introduced with the Rel8 feature as described in clause 5.4.1.
  77. * INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION (8)
  78. * Within a RAR, this value shall be used by the PCRF to indicate that the resources requested for
  79. * particular service information have been successfully allocated. The SDFs corresponding to the
  80. * resources successfully allocated shall be provided within the Flows AVP.
  81. * In the AAR, this value indicates that the AF requests the PCRF to provide a notification when
  82. * the resources associated to the corresponding service information have been allocated.
  83. * Applicable to functionality introduced with the Rel8 feature as described in clause 5.4.1.
  84. * NOTE: This value applies to applications for which the successful resource allocation notification
  85. * is required for their operation since subscription to this value impacts the resource allocation
  86. * signalling overhead towards the PCEF/BBERF.
  87. * INDICATION_OF_FAILED_RESOURCES_ALLOCATION (9)
  88. * Within a RAR, this value shall be used by the PCRF to indicate that the resources requested for a
  89. * particular service information cannot be successfully allocated. The SDFs corresponding to the resources
  90. * that could not be allocated shall be provided within the Flows AVP. In the AAR, this value indicates
  91. * that the AF requests the PCRF to provide a notification when the resources associated to the corresponding
  92. * service information cannot be allocated. Applicable to functionality introduced with the Rel8 feature
  93. * as described in clause 5.4.1. NOTE: This value applies to applications for which the unsuccessful
  94. * resource allocation notification is required for their operation since subscription to this value
  95. * impacts the resource allocation signalling overhead towards the PCEF/BBERF.
  96. * INDICATION_OF_LIMITED_PCC_DEPLOYMENT (10)
  97. * Within a RAR, this value shall be used when the server reports the limited PCC deployment
  98. * (i.e. dynamically allocated resources are not applicable) as specified at Annex L in 3GPP TS 23.203 [2]
  99. * to the AF. In the AAR, this value indicates that the AF requests the server to provide a notification
  100. * for the limited PCC deployment. Applicable to functionality introduced with the Rel8 feature as described
  101. * in clause 5.4.1.
  102. * USAGE_REPORT (11)
  103. * In the RA-Request (RAR), this value shall be used by the PCRF to report accumulated usage volume when
  104. * the usage threshold provided by the AF has been reached. In the AA-Request (AAR), this value
  105. * indicates that the AF requests PCRF to report accumulated usage volume when it reaches the threshold.
  106. * Applicable to functionality introduced with the SponsoredConnectivity feature as described in clause 5.4.1
  107. * </pre>
  108. *
  109. * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a>
  110. * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a>
  111. * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a>
  112. */
  113. public enum SpecificAction implements Enumerated{
  114. Void(0),
  115. CHARGING_CORRELATION_EXCHANGE(1),
  116. INDICATION_OF_LOSS_OF_BEARER(2),
  117. INDICATION_OF_RECOVERY_OF_BEARER(3),
  118. INDICATION_OF_RELEASE_OF_BEARER(4),
  119. Void2(5),
  120. IP_CAN_CHANGE(6),
  121. INDICATION_OF_OUT_OF_CREDIT(7),
  122. INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION(8),
  123. INDICATION_OF_FAILED_RESOURCES_ALLOCATION(9),
  124. INDICATION_OF_LIMITED_PCC_DEPLOYMENT(10),
  125. USAGE_REPORT(11);
  126. public static final int _Void = Void.getValue();
  127. public static final int _CHARGING_CORRELATION_EXCHANGE = CHARGING_CORRELATION_EXCHANGE.getValue();
  128. public static final int _INDICATION_OF_LOSS_OF_BEARER = INDICATION_OF_LOSS_OF_BEARER.getValue();
  129. public static final int _INDICATION_OF_RECOVERY_OF_BEARER = INDICATION_OF_RECOVERY_OF_BEARER.getValue();
  130. public static final int _INDICATION_OF_RELEASE_OF_BEARER = INDICATION_OF_RELEASE_OF_BEARER.getValue();
  131. public static final int _Void2 = Void2.getValue();
  132. public static final int _IP_CAN_CHANGE = IP_CAN_CHANGE.getValue();
  133. public static final int _INDICATION_OF_OUT_OF_CREDIT = INDICATION_OF_OUT_OF_CREDIT.getValue();
  134. public static final int _INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION = INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION.getValue();
  135. public static final int _INDICATION_OF_FAILED_RESOURCES_ALLOCATION = INDICATION_OF_FAILED_RESOURCES_ALLOCATION.getValue();
  136. public static final int _INDICATION_OF_LIMITED_PCC_DEPLOYMENT = INDICATION_OF_LIMITED_PCC_DEPLOYMENT.getValue();
  137. public static final int _USAGE_REPORT = USAGE_REPORT.getValue();
  138. private int value = -1;
  139. private SpecificAction(int v) {
  140. this.value=v;
  141. }
  142. private Object readResolve() throws StreamCorruptedException {
  143. try {
  144. return fromInt(value);
  145. }
  146. catch (IllegalArgumentException iae) {
  147. throw new StreamCorruptedException("Invalid internal state found: " + value);
  148. }
  149. }
  150. public static SpecificAction fromInt(int type) throws IllegalArgumentException {
  151. switch (type) {
  152. case 0: return Void;
  153. case 1: return CHARGING_CORRELATION_EXCHANGE;
  154. case 2: return INDICATION_OF_LOSS_OF_BEARER;
  155. case 3: return INDICATION_OF_RECOVERY_OF_BEARER;
  156. case 4: return INDICATION_OF_RELEASE_OF_BEARER;
  157. case 5: return Void2;
  158. case 6: return IP_CAN_CHANGE;
  159. case 7: return INDICATION_OF_OUT_OF_CREDIT;
  160. case 8: return INDICATION_OF_SUCCESSFUL_RESOURCES_ALLOCATION;
  161. case 9: return INDICATION_OF_FAILED_RESOURCES_ALLOCATION;
  162. case 10: return INDICATION_OF_LIMITED_PCC_DEPLOYMENT;
  163. case 11: return USAGE_REPORT;
  164. default:
  165. throw new IllegalArgumentException();
  166. }
  167. }
  168. public int getValue() {
  169. return this.value;
  170. }
  171. }