PageRenderTime 25ms CodeModel.GetById 19ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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