/protocols/ss7/map/map-api/src/main/java/org/mobicents/protocols/ss7/map/api/errors/PositionMethodFailureDiagnostic.java

http://mobicents.googlecode.com/ · Java · 86 lines · 37 code · 8 blank · 41 comment · 1 complexity · 3729be8a2b187afdcc44bd722d811c2c 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.map.api.errors;
  23. /**
  24. *
  25. * PositionMethodFailure-Diagnostic ::= ENUMERATED {
  26. * congestion (0),
  27. * insufficientResources (1),
  28. * insufficientMeasurementData (2),
  29. * inconsistentMeasurementData (3),
  30. * locationProcedureNotCompleted (4),
  31. * locationProcedureNotSupportedByTargetMS (5),
  32. * qoSNotAttainable (6),
  33. * positionMethodNotAvailableInNetwork (7),
  34. * positionMethodNotAvailableInLocationArea (8),
  35. * ... }
  36. * -- exception handling:
  37. * -- any unrecognized value shall be ignored
  38. *
  39. *
  40. * @author sergey vetyutnev
  41. *
  42. */
  43. public enum PositionMethodFailureDiagnostic {
  44. congestion(0), insufficientResources(1), insufficientMeasurementData(2), inconsistentMeasurementData(3),
  45. locationProcedureNotCompleted(4), locationProcedureNotSupportedByTargetMS(5),
  46. qoSNotAttainable(6), positionMethodNotAvailableInNetwork(7), positionMethodNotAvailableInLocationArea(8);
  47. private int code;
  48. private PositionMethodFailureDiagnostic(int code) {
  49. this.code = code;
  50. }
  51. public int getCode() {
  52. return code;
  53. }
  54. public static PositionMethodFailureDiagnostic getInstance(int code) {
  55. switch (code) {
  56. case 0:
  57. return congestion;
  58. case 1:
  59. return insufficientResources;
  60. case 2:
  61. return insufficientMeasurementData;
  62. case 3:
  63. return inconsistentMeasurementData;
  64. case 4:
  65. return locationProcedureNotCompleted;
  66. case 5:
  67. return locationProcedureNotSupportedByTargetMS;
  68. case 6:
  69. return qoSNotAttainable;
  70. case 7:
  71. return positionMethodNotAvailableInNetwork;
  72. case 8:
  73. return positionMethodNotAvailableInLocationArea;
  74. default:
  75. return null;
  76. }
  77. }
  78. }