PageRenderTime 26ms CodeModel.GetById 22ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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