/protocols/ss7/m3ua/api/src/main/java/org/mobicents/protocols/ss7/m3ua/parameter/CongestedIndication.java

http://mobicents.googlecode.com/ · Java · 86 lines · 28 code · 11 blank · 47 comment · 1 complexity · d44c5e15c928b412bb886b60b2061262 MD5 · raw file

  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.protocols.ss7.m3ua.parameter;
  23. /**
  24. * The optional Congestion Indications parameter contains a Congestion Level
  25. * field. This optional parameter is used to communicate congestion levels in
  26. * national MTP networks with multiple congestion thresholds
  27. *
  28. * @author amit bhayani
  29. *
  30. */
  31. public interface CongestedIndication extends Parameter {
  32. public CongestionLevel getCongestionLevel();
  33. /**
  34. * <p>
  35. * The Congestion Level field, associated with all of the Affected DPC(s) in
  36. * the Affected Destinations parameter, contains one of the following
  37. * values:
  38. * </p>
  39. * <p>
  40. * <ul>
  41. * <li> 0 No Congestion or Undefined </li>
  42. * <li>1 Congestion Level 1 </li>
  43. * <li>2 Congestion Level 2 </li>
  44. * <li>3 Congestion Level 3 </li>
  45. * </ul>
  46. * </p>
  47. *
  48. * @author abhayani
  49. *
  50. */
  51. public enum CongestionLevel {
  52. UNDEFINED(0), LEVEL1(1), LEVEL2(2), LEVEL3(3);
  53. int level;
  54. private CongestionLevel(int level) {
  55. this.level = level;
  56. }
  57. public int getLevel(){
  58. return this.level;
  59. }
  60. public static CongestionLevel getCongestionLevel(int level) {
  61. switch (level) {
  62. case 0:
  63. return UNDEFINED;
  64. case 1:
  65. return LEVEL1;
  66. case 2:
  67. return LEVEL2;
  68. case 3:
  69. return LEVEL3;
  70. default:
  71. return null;
  72. }
  73. }
  74. }
  75. }