PageRenderTime 34ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/protocols/ss7/map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/dialog/ProcedureCancellationReason.java

http://mobicents.googlecode.com/
Java | 81 lines | 37 code | 7 blank | 37 comment | 1 complexity | c7606eb11ef622740592068fc6d11349 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.protocols.ss7.map.api.dialog;
  23. /**
  24. * See ETS 300974 Table 5.3/7
  25. *
  26. * ProcedureCancellationReason ::= ENUMERATED {
  27. * handoverCancellation (0),
  28. * radioChannelRelease (1),
  29. * networkPathRelease (2),
  30. * callRelease (3),
  31. * associatedProcedureFailure (4),
  32. * tandemDialogueRelease (5),
  33. * remoteOperationsFailure (6)}
  34. *
  35. *
  36. * @author amit bhayani
  37. *
  38. */
  39. public enum ProcedureCancellationReason {
  40. handoverCancellation(0),
  41. radioChannelRelease(1),
  42. networkPathRelease(2),
  43. callRelease(3),
  44. associatedProcedureFailure(4),
  45. tandemDialogueRelease(5),
  46. remoteOperationsFailure(6);
  47. private int code;
  48. private ProcedureCancellationReason(int code) {
  49. this.code = code;
  50. }
  51. public static ProcedureCancellationReason getInstance(int code) {
  52. switch (code) {
  53. case 0:
  54. return handoverCancellation;
  55. case 1:
  56. return radioChannelRelease;
  57. case 2:
  58. return networkPathRelease;
  59. case 3:
  60. return callRelease;
  61. case 4:
  62. return associatedProcedureFailure;
  63. case 5:
  64. return tandemDialogueRelease;
  65. case 6:
  66. return remoteOperationsFailure;
  67. default:
  68. return null;
  69. }
  70. }
  71. public int getCode() {
  72. return code;
  73. }
  74. }