Modify groupId for ems driver
[vfc/nfvo/driver/ems.git] / ems / boco / src / main / java / org / onap / nfvo / emsdriver / collector / alarm / MsgType.java
1 /**
2  * Copyright 2017 BOCO Corporation.  CMCC Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.nfvo.emsdriver.collector.alarm;
17
18 public enum MsgType {
19         
20         reqLoginAlarm("reqLoginAlarm",1,"all"),
21         ackLoginAlarm("ackLoginAlarm",2,"all"),
22         reqSyncAlarmMsg("reqSyncAlarmMsg",3,"msg"),
23         ackSyncAlarmMsg("ackSyncAlarmMsg",4,"msg"),
24         reqSyncAlarmFile("reqSyncAlarmFile",5,"file"),
25         ackSyncAlarmFile("ackSyncAlarmFile",6,"file"),
26         ackSyncAlarmFileResult("ackSyncAlarmFileResult",7,"file"),
27         reqHeartBeat("reqHeartBeat",8,"all"),
28         ackHeartBeat("ackHeartBeat",9,"all"),
29         closeConnAlarm("closeConnAlarm",10,"all"),
30         realTimeAlarm("realTimeAlarm",0,"all"),
31         undefined("undefined",-1,"all");
32         
33         public int value = -1;
34         public String name = null;
35         public String type = null;
36         
37         MsgType(String name,int value,String type){this.name = name;this.value = value;this.type = type;}
38         
39         public static MsgType getMsgTypeValue(int msgTypeValue){
40                 
41                 for(MsgType msgType : MsgType.values()){
42                         if(msgType.value == msgTypeValue){
43                                 return msgType;
44                         }
45                 }
46                 return undefined;
47         }
48         
49         public static MsgType getMsgTypeName(String msgTypeName){
50                 
51                 for(MsgType msgType : MsgType.values()){
52                         if(msgType.name.toLowerCase().equals(msgTypeName.toLowerCase())){
53                                 return msgType;
54                         }
55                 }
56                 return undefined;
57         }
58         
59         public String toString(){
60                 return this.name;
61         }
62         
63 }