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

/servers/jain-slee/resources/diameter-s6a/events/src/main/java/org/mobicents/slee/resource/diameter/s6a/events/avp/SubscriptionDataAvpImpl.java

http://mobicents.googlecode.com/
Java | 235 lines | 155 code | 51 blank | 29 comment | 1 complexity | 6828013127ad433a72988475ff7754d4 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 org.mobicents.slee.resource.diameter.s6a.events.avp;
  23. import net.java.slee.resource.diameter.s6a.events.avp.AMBRAvp;
  24. import net.java.slee.resource.diameter.s6a.events.avp.APNConfigurationProfileAvp;
  25. import net.java.slee.resource.diameter.s6a.events.avp.DiameterS6aAvpCodes;
  26. import net.java.slee.resource.diameter.s6a.events.avp.ICSIndicator;
  27. import net.java.slee.resource.diameter.s6a.events.avp.NetworkAccessMode;
  28. import net.java.slee.resource.diameter.s6a.events.avp.RoamingRestrictedDueToUnsupportedFeature;
  29. import net.java.slee.resource.diameter.s6a.events.avp.SubscriberStatus;
  30. import net.java.slee.resource.diameter.s6a.events.avp.SubscriptionDataAvp;
  31. import org.mobicents.slee.resource.diameter.base.events.avp.GroupedAvpImpl;
  32. /**
  33. * Implementation for {@link SubscriptionDataAvp}
  34. *
  35. * @author <a href="mailto:brainslog@gmail.com"> Alexandre Mendonca </a>
  36. * @author <a href="mailto:baranowb@gmail.com"> Bartosz Baranowski </a>
  37. * @author <a href="mailto:richard.good@smilecoms.com"> Richard Good </a>
  38. * @author <a href="mailto:paul.carter-brown@smilecoms.com"> Paul Carter-Brown </a>
  39. */
  40. public class SubscriptionDataAvpImpl extends GroupedAvpImpl implements SubscriptionDataAvp {
  41. public SubscriptionDataAvpImpl() {
  42. super();
  43. }
  44. public SubscriptionDataAvpImpl(int code, long vendorId, int mnd, int prt, byte[] value) {
  45. super(code, vendorId, mnd, prt, value);
  46. }
  47. public boolean hasSubscriberStatus() {
  48. return hasAvp(DiameterS6aAvpCodes.SUBSCRIBER_STATUS, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  49. }
  50. public void setSubscriberStatus(SubscriberStatus ss) {
  51. addAvp(DiameterS6aAvpCodes.SUBSCRIBER_STATUS, DiameterS6aAvpCodes.S6A_VENDOR_ID, ss.getValue());
  52. }
  53. public SubscriberStatus getSubscriberStatus() {
  54. return (SubscriberStatus) getAvpAsEnumerated(DiameterS6aAvpCodes.SUBSCRIBER_STATUS, DiameterS6aAvpCodes.S6A_VENDOR_ID, SubscriberStatus.class);
  55. }
  56. public boolean hasMSISDN() {
  57. return hasAvp(DiameterS6aAvpCodes.MSISDN, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  58. }
  59. public byte[] getMSISDN() {
  60. return getAvpAsOctetString(DiameterS6aAvpCodes.MSISDN, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  61. }
  62. public void setMSISDN(byte[] msisdn) {
  63. addAvp(DiameterS6aAvpCodes.MSISDN, DiameterS6aAvpCodes.S6A_VENDOR_ID, msisdn);
  64. }
  65. public boolean hasSTNSR() {
  66. return hasAvp(DiameterS6aAvpCodes.STN_SR, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  67. }
  68. public byte[] getSTNSR() {
  69. return getAvpAsOctetString(DiameterS6aAvpCodes.STN_SR, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  70. }
  71. public void setSTNSR(byte[] stnsr) {
  72. addAvp(DiameterS6aAvpCodes.STN_SR, DiameterS6aAvpCodes.S6A_VENDOR_ID, stnsr);
  73. }
  74. public boolean hasICSIndicator() {
  75. return hasAvp(DiameterS6aAvpCodes.ICS_INDICATOR, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  76. }
  77. public ICSIndicator getICSIndicator() {
  78. return (ICSIndicator) getAvpAsEnumerated(DiameterS6aAvpCodes.ICS_INDICATOR, DiameterS6aAvpCodes.S6A_VENDOR_ID, ICSIndicator.class);
  79. }
  80. public void setICSIndicator(ICSIndicator icsIndicator) {
  81. addAvp(DiameterS6aAvpCodes.ICS_INDICATOR, DiameterS6aAvpCodes.S6A_VENDOR_ID, icsIndicator.getValue());
  82. }
  83. public boolean hasNetworkAccessMode() {
  84. return hasAvp(DiameterS6aAvpCodes.NETWORK_ACCESS_MODE, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  85. }
  86. public void setNetworkAccessMode(NetworkAccessMode nam) {
  87. addAvp(DiameterS6aAvpCodes.NETWORK_ACCESS_MODE, DiameterS6aAvpCodes.S6A_VENDOR_ID, nam.getValue());
  88. }
  89. public NetworkAccessMode getNetworkAccessMode() {
  90. return (NetworkAccessMode) getAvpAsEnumerated(DiameterS6aAvpCodes.NETWORK_ACCESS_MODE, DiameterS6aAvpCodes.S6A_VENDOR_ID, NetworkAccessMode.class);
  91. }
  92. public boolean has3GPPChargingCharacteristics() {
  93. return hasAvp(DiameterS6aAvpCodes.TGPP_CHARGING_CHARACTERISTICS, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  94. }
  95. public String get3GPPChargingCharacteristics() {
  96. return getAvpAsUTF8String(DiameterS6aAvpCodes.TGPP_CHARGING_CHARACTERISTICS, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  97. }
  98. public void set3GPPChargingCharacteristics(String threeGPPChargingCharacteristics) {
  99. addAvp(DiameterS6aAvpCodes.TGPP_CHARGING_CHARACTERISTICS, DiameterS6aAvpCodes.S6A_VENDOR_ID, threeGPPChargingCharacteristics);
  100. }
  101. public boolean hasAMBR() {
  102. return hasAvp(DiameterS6aAvpCodes.AMBR, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  103. }
  104. public AMBRAvp getAMBR() {
  105. return (AMBRAvp) getAvpAsCustom(DiameterS6aAvpCodes.AMBR, DiameterS6aAvpCodes.S6A_VENDOR_ID, AMBRAvpImpl.class);
  106. }
  107. public void setAMBR(AMBRAvp ambr) {
  108. addAvp(DiameterS6aAvpCodes.AMBR, DiameterS6aAvpCodes.S6A_VENDOR_ID, ambr.byteArrayValue());
  109. }
  110. public boolean hasAPNConfigurationProfile() {
  111. return hasAvp(DiameterS6aAvpCodes.APN_CONFIGURATION_PROFILE, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  112. }
  113. public APNConfigurationProfileAvp getAPNConfigurationProfile() {
  114. return (APNConfigurationProfileAvp) getAvpAsCustom(DiameterS6aAvpCodes.APN_CONFIGURATION_PROFILE, DiameterS6aAvpCodes.S6A_VENDOR_ID, APNConfigurationProfileAvpImpl.class);
  115. }
  116. public void setAPNConfigurationProfile(APNConfigurationProfileAvp apnconfig) {
  117. addAvp(DiameterS6aAvpCodes.APN_CONFIGURATION_PROFILE, DiameterS6aAvpCodes.S6A_VENDOR_ID, apnconfig.byteArrayValue());
  118. }
  119. public boolean hasOperatorDeterminedBarring() {
  120. return hasAvp(DiameterS6aAvpCodes.OPERATOR_DETERMINED_BARRING, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  121. }
  122. public long getOperatorDeterminedBarring() {
  123. return getAvpAsUnsigned32(DiameterS6aAvpCodes.OPERATOR_DETERMINED_BARRING, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  124. }
  125. public void setOperatorDeterminedBarring(long operatorDeterminedBarring) {
  126. addAvp(DiameterS6aAvpCodes.OPERATOR_DETERMINED_BARRING, DiameterS6aAvpCodes.S6A_VENDOR_ID, operatorDeterminedBarring);
  127. }
  128. public boolean hasHPLMNODB() {
  129. return hasAvp(DiameterS6aAvpCodes.HPLMN_ODB, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  130. }
  131. public long getHPLMNODB() {
  132. return getAvpAsUnsigned32(DiameterS6aAvpCodes.HPLMN_ODB, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  133. }
  134. public void setHPLMNODB(long hplmnOdb) {
  135. addAvp(DiameterS6aAvpCodes.HPLMN_ODB, DiameterS6aAvpCodes.S6A_VENDOR_ID, hplmnOdb);
  136. }
  137. public byte[][] getRegionalSubscriptionZoneCodes() {
  138. return getAvpsAsOctetString(DiameterS6aAvpCodes.REGIONAL_SUBSCRIPTION_ZONE_CODE, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  139. }
  140. public void setRegionalSubscriptionZoneCode(byte[] rszc) {
  141. addAvp(DiameterS6aAvpCodes.REGIONAL_SUBSCRIPTION_ZONE_CODE, DiameterS6aAvpCodes.S6A_VENDOR_ID, rszc);
  142. }
  143. public void setRegionalSubscriptionZoneCodes(byte[][] rszcs) {
  144. for(byte[] rszc : rszcs) {
  145. setRegionalSubscriptionZoneCode(rszc);
  146. }
  147. }
  148. public boolean hasAccessRestrictionData() {
  149. return hasAvp(DiameterS6aAvpCodes.ACCESS_RESTRICTION_DATA, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  150. }
  151. public long getAccessRestrictionData() {
  152. return getAvpAsUnsigned32(DiameterS6aAvpCodes.ACCESS_RESTRICTION_DATA, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  153. }
  154. public void setAccessRestrictionData(long ard) {
  155. addAvp(DiameterS6aAvpCodes.ACCESS_RESTRICTION_DATA, DiameterS6aAvpCodes.S6A_VENDOR_ID, ard);
  156. }
  157. public boolean hasAPNOIReplacement() {
  158. return hasAvp(DiameterS6aAvpCodes.APN_OI_REPLACEMENT, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  159. }
  160. public String getAPNOIReplacement() {
  161. return getAvpAsUTF8String(DiameterS6aAvpCodes.APN_OI_REPLACEMENT, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  162. }
  163. public void setAPNOIReplacement(String apnOiReplacement) {
  164. addAvp(DiameterS6aAvpCodes.APN_OI_REPLACEMENT, DiameterS6aAvpCodes.S6A_VENDOR_ID, apnOiReplacement);
  165. }
  166. public boolean hasRATFrequencySelectionPriorityID() {
  167. return hasAvp(DiameterS6aAvpCodes.RAT_FREQUENCY_SELECTION_PRIORITY_ID, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  168. }
  169. public long getRATFrequencySelectionPriorityID() {
  170. return getAvpAsUnsigned32(DiameterS6aAvpCodes.RAT_FREQUENCY_SELECTION_PRIORITY_ID, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  171. }
  172. public void setRATFrequencySelectionPriorityID(long rfspid) {
  173. addAvp(DiameterS6aAvpCodes.RAT_FREQUENCY_SELECTION_PRIORITY_ID, DiameterS6aAvpCodes.S6A_VENDOR_ID, rfspid);
  174. }
  175. public boolean hasRoamingRestrictedDueToUnsupportedFeature() {
  176. return hasAvp(DiameterS6aAvpCodes.ROAMING_RESTRICTED_DUE_TO_UNSUPPORTED_FEATURE, DiameterS6aAvpCodes.S6A_VENDOR_ID);
  177. }
  178. public void setRoamingRestrictedDueToUnsupportedFeature(RoamingRestrictedDueToUnsupportedFeature rrdtuf) {
  179. addAvp(DiameterS6aAvpCodes.ROAMING_RESTRICTED_DUE_TO_UNSUPPORTED_FEATURE, DiameterS6aAvpCodes.S6A_VENDOR_ID, rrdtuf.getValue());
  180. }
  181. public RoamingRestrictedDueToUnsupportedFeature getRoamingRestrictedDueToUnsupportedFeature() {
  182. return (RoamingRestrictedDueToUnsupportedFeature) getAvpAsEnumerated(DiameterS6aAvpCodes.ROAMING_RESTRICTED_DUE_TO_UNSUPPORTED_FEATURE, DiameterS6aAvpCodes.S6A_VENDOR_ID, RoamingRestrictedDueToUnsupportedFeature.class);
  183. }
  184. }