Committed by
Gerrit Code Review
Conform to our naming convention for enum
Change-Id: I6dd12ca899b72f5d0f9c7831fcbcceb83c2bf3a5
Showing
5 changed files
with
34 additions
and
34 deletions
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | package org.onosproject.bgpio.protocol; | 16 | package org.onosproject.bgpio.protocol; |
17 | 17 | ||
18 | import org.onosproject.bgpio.exceptions.BGPParseException; | 18 | import org.onosproject.bgpio.exceptions.BGPParseException; |
19 | -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE; | 19 | +import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; |
20 | import org.onosproject.bgpio.types.RouteDistinguisher; | 20 | import org.onosproject.bgpio.types.RouteDistinguisher; |
21 | 21 | ||
22 | /** | 22 | /** |
... | @@ -43,7 +43,7 @@ public interface BGPLSNlri { | ... | @@ -43,7 +43,7 @@ public interface BGPLSNlri { |
43 | * @return Protocol Id in Nlri | 43 | * @return Protocol Id in Nlri |
44 | * @throws BGPParseException while getting protocol ID | 44 | * @throws BGPParseException while getting protocol ID |
45 | */ | 45 | */ |
46 | - PROTOCOLTYPE getProtocolId() throws BGPParseException; | 46 | + ProtocolType getProtocolId() throws BGPParseException; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Returns Route distinguisher in Nlri. | 49 | * Returns Route distinguisher in Nlri. | ... | ... |
... | @@ -61,8 +61,8 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { | ... | @@ -61,8 +61,8 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { |
61 | /** | 61 | /** |
62 | * Enum to provide PROTOCOLTYPE. | 62 | * Enum to provide PROTOCOLTYPE. |
63 | */ | 63 | */ |
64 | - public enum PROTOCOLTYPE { | 64 | + public enum ProtocolType { |
65 | - ISIS_LevelOne(1), ISIS_LevelTwo(2), OSPFv2(3), Direct(4), Static_Configuration(5), OSPFv3(6); | 65 | + ISIS_LEVEL_ONE(1), ISIS_LEVEL_TWO(2), OSPF_V2(3), DIRECT(4), STATIC_CONFIGURATION(5), OSPF_V3(6); |
66 | int value; | 66 | int value; |
67 | 67 | ||
68 | /** | 68 | /** |
... | @@ -70,7 +70,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { | ... | @@ -70,7 +70,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { |
70 | * | 70 | * |
71 | * @param val protocol type | 71 | * @param val protocol type |
72 | */ | 72 | */ |
73 | - PROTOCOLTYPE(int val) { | 73 | + ProtocolType(int val) { |
74 | value = val; | 74 | value = val; |
75 | } | 75 | } |
76 | 76 | ||
... | @@ -180,20 +180,20 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { | ... | @@ -180,20 +180,20 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri { |
180 | } | 180 | } |
181 | 181 | ||
182 | @Override | 182 | @Override |
183 | - public PROTOCOLTYPE getProtocolId() throws BGPParseException { | 183 | + public ProtocolType getProtocolId() throws BGPParseException { |
184 | switch (protocolId) { | 184 | switch (protocolId) { |
185 | case Constants.ISIS_LEVELONE: | 185 | case Constants.ISIS_LEVELONE: |
186 | - return PROTOCOLTYPE.ISIS_LevelOne; | 186 | + return ProtocolType.ISIS_LEVEL_ONE; |
187 | case Constants.ISIS_LEVELTWO: | 187 | case Constants.ISIS_LEVELTWO: |
188 | - return PROTOCOLTYPE.ISIS_LevelTwo; | 188 | + return ProtocolType.ISIS_LEVEL_TWO; |
189 | case Constants.OSPFV2: | 189 | case Constants.OSPFV2: |
190 | - return PROTOCOLTYPE.OSPFv2; | 190 | + return ProtocolType.OSPF_V2; |
191 | case Constants.DIRECT: | 191 | case Constants.DIRECT: |
192 | - return PROTOCOLTYPE.Direct; | 192 | + return ProtocolType.DIRECT; |
193 | case Constants.STATIC_CONFIGURATION: | 193 | case Constants.STATIC_CONFIGURATION: |
194 | - return PROTOCOLTYPE.Static_Configuration; | 194 | + return ProtocolType.STATIC_CONFIGURATION; |
195 | case Constants.OSPFV3: | 195 | case Constants.OSPFV3: |
196 | - return PROTOCOLTYPE.OSPFv3; | 196 | + return ProtocolType.OSPF_V3; |
197 | default: | 197 | default: |
198 | throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); | 198 | throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); |
199 | } | 199 | } | ... | ... |
... | @@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; | ... | @@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; |
21 | import org.onosproject.bgpio.exceptions.BGPParseException; | 21 | import org.onosproject.bgpio.exceptions.BGPParseException; |
22 | import org.onosproject.bgpio.protocol.BGPPrefixLSNlri; | 22 | import org.onosproject.bgpio.protocol.BGPPrefixLSNlri; |
23 | import org.onosproject.bgpio.protocol.NlriType; | 23 | import org.onosproject.bgpio.protocol.NlriType; |
24 | -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE; | 24 | +import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; |
25 | import org.onosproject.bgpio.types.BGPValueType; | 25 | import org.onosproject.bgpio.types.BGPValueType; |
26 | import org.onosproject.bgpio.types.RouteDistinguisher; | 26 | import org.onosproject.bgpio.types.RouteDistinguisher; |
27 | import org.onosproject.bgpio.util.Constants; | 27 | import org.onosproject.bgpio.util.Constants; |
... | @@ -145,20 +145,20 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { | ... | @@ -145,20 +145,20 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri { |
145 | } | 145 | } |
146 | 146 | ||
147 | @Override | 147 | @Override |
148 | - public PROTOCOLTYPE getProtocolId() throws BGPParseException { | 148 | + public ProtocolType getProtocolId() throws BGPParseException { |
149 | switch (protocolId) { | 149 | switch (protocolId) { |
150 | case Constants.ISIS_LEVELONE: | 150 | case Constants.ISIS_LEVELONE: |
151 | - return PROTOCOLTYPE.ISIS_LevelOne; | 151 | + return ProtocolType.ISIS_LEVEL_ONE; |
152 | case Constants.ISIS_LEVELTWO: | 152 | case Constants.ISIS_LEVELTWO: |
153 | - return PROTOCOLTYPE.ISIS_LevelTwo; | 153 | + return ProtocolType.ISIS_LEVEL_TWO; |
154 | case Constants.OSPFV2: | 154 | case Constants.OSPFV2: |
155 | - return PROTOCOLTYPE.OSPFv2; | 155 | + return ProtocolType.OSPF_V2; |
156 | case Constants.DIRECT: | 156 | case Constants.DIRECT: |
157 | - return PROTOCOLTYPE.Direct; | 157 | + return ProtocolType.DIRECT; |
158 | case Constants.STATIC_CONFIGURATION: | 158 | case Constants.STATIC_CONFIGURATION: |
159 | - return PROTOCOLTYPE.Static_Configuration; | 159 | + return ProtocolType.STATIC_CONFIGURATION; |
160 | case Constants.OSPFV3: | 160 | case Constants.OSPFV3: |
161 | - return PROTOCOLTYPE.OSPFv3; | 161 | + return ProtocolType.OSPF_V3; |
162 | default: | 162 | default: |
163 | throw new BGPParseException("protocol id not valid"); | 163 | throw new BGPParseException("protocol id not valid"); |
164 | } | 164 | } | ... | ... |
... | @@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; | ... | @@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer; |
21 | import org.onosproject.bgpio.exceptions.BGPParseException; | 21 | import org.onosproject.bgpio.exceptions.BGPParseException; |
22 | import org.onosproject.bgpio.protocol.BgpLinkLsNlri; | 22 | import org.onosproject.bgpio.protocol.BgpLinkLsNlri; |
23 | import org.onosproject.bgpio.protocol.NlriType; | 23 | import org.onosproject.bgpio.protocol.NlriType; |
24 | -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE; | 24 | +import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; |
25 | import org.onosproject.bgpio.types.BGPErrorType; | 25 | import org.onosproject.bgpio.types.BGPErrorType; |
26 | import org.onosproject.bgpio.types.BGPValueType; | 26 | import org.onosproject.bgpio.types.BGPValueType; |
27 | import org.onosproject.bgpio.types.RouteDistinguisher; | 27 | import org.onosproject.bgpio.types.RouteDistinguisher; |
... | @@ -140,20 +140,20 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { | ... | @@ -140,20 +140,20 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { |
140 | } | 140 | } |
141 | 141 | ||
142 | @Override | 142 | @Override |
143 | - public PROTOCOLTYPE getProtocolId() throws BGPParseException { | 143 | + public ProtocolType getProtocolId() throws BGPParseException { |
144 | switch (protocolId) { | 144 | switch (protocolId) { |
145 | case Constants.ISIS_LEVELONE: | 145 | case Constants.ISIS_LEVELONE: |
146 | - return PROTOCOLTYPE.ISIS_LevelOne; | 146 | + return ProtocolType.ISIS_LEVEL_ONE; |
147 | case Constants.ISIS_LEVELTWO: | 147 | case Constants.ISIS_LEVELTWO: |
148 | - return PROTOCOLTYPE.ISIS_LevelTwo; | 148 | + return ProtocolType.ISIS_LEVEL_TWO; |
149 | case Constants.OSPFV2: | 149 | case Constants.OSPFV2: |
150 | - return PROTOCOLTYPE.OSPFv2; | 150 | + return ProtocolType.OSPF_V2; |
151 | case Constants.DIRECT: | 151 | case Constants.DIRECT: |
152 | - return PROTOCOLTYPE.Direct; | 152 | + return ProtocolType.DIRECT; |
153 | case Constants.STATIC_CONFIGURATION: | 153 | case Constants.STATIC_CONFIGURATION: |
154 | - return PROTOCOLTYPE.Static_Configuration; | 154 | + return ProtocolType.STATIC_CONFIGURATION; |
155 | case Constants.OSPFV3: | 155 | case Constants.OSPFV3: |
156 | - return PROTOCOLTYPE.OSPFv3; | 156 | + return ProtocolType.OSPF_V3; |
157 | default: | 157 | default: |
158 | throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); | 158 | throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null); |
159 | } | 159 | } |
... | @@ -207,4 +207,4 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { | ... | @@ -207,4 +207,4 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri { |
207 | .add("linkLSIdentifier", linkLSIdentifier) | 207 | .add("linkLSIdentifier", linkLSIdentifier) |
208 | .toString(); | 208 | .toString(); |
209 | } | 209 | } |
210 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
210 | +} | ... | ... |
... | @@ -19,7 +19,7 @@ import java.util.Iterator; | ... | @@ -19,7 +19,7 @@ import java.util.Iterator; |
19 | import java.util.List; | 19 | import java.util.List; |
20 | import java.util.Objects; | 20 | import java.util.Objects; |
21 | 21 | ||
22 | -import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE; | 22 | +import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType; |
23 | import org.onosproject.bgpio.types.BGPValueType; | 23 | import org.onosproject.bgpio.types.BGPValueType; |
24 | 24 | ||
25 | import com.google.common.base.MoreObjects; | 25 | import com.google.common.base.MoreObjects; |
... | @@ -29,7 +29,7 @@ import com.google.common.base.MoreObjects; | ... | @@ -29,7 +29,7 @@ import com.google.common.base.MoreObjects; |
29 | */ | 29 | */ |
30 | public class PathAttrNlriDetails { | 30 | public class PathAttrNlriDetails { |
31 | private List<BGPValueType> pathAttributes; | 31 | private List<BGPValueType> pathAttributes; |
32 | - private PROTOCOLTYPE protocolID; | 32 | + private ProtocolType protocolID; |
33 | private long identifier; | 33 | private long identifier; |
34 | 34 | ||
35 | /** | 35 | /** |
... | @@ -55,7 +55,7 @@ public class PathAttrNlriDetails { | ... | @@ -55,7 +55,7 @@ public class PathAttrNlriDetails { |
55 | * | 55 | * |
56 | * @param protocolID in linkstate nlri | 56 | * @param protocolID in linkstate nlri |
57 | */ | 57 | */ |
58 | - public void setProtocolID(PROTOCOLTYPE protocolID) { | 58 | + public void setProtocolID(ProtocolType protocolID) { |
59 | this.protocolID = protocolID; | 59 | this.protocolID = protocolID; |
60 | } | 60 | } |
61 | 61 | ||
... | @@ -64,7 +64,7 @@ public class PathAttrNlriDetails { | ... | @@ -64,7 +64,7 @@ public class PathAttrNlriDetails { |
64 | * | 64 | * |
65 | * @return protocolID | 65 | * @return protocolID |
66 | */ | 66 | */ |
67 | - public PROTOCOLTYPE protocolID() { | 67 | + public ProtocolType protocolID() { |
68 | return this.protocolID; | 68 | return this.protocolID; |
69 | } | 69 | } |
70 | 70 | ||
... | @@ -132,4 +132,4 @@ public class PathAttrNlriDetails { | ... | @@ -132,4 +132,4 @@ public class PathAttrNlriDetails { |
132 | .add("pathAttributes", pathAttributes) | 132 | .add("pathAttributes", pathAttributes) |
133 | .toString(); | 133 | .toString(); |
134 | } | 134 | } |
135 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
135 | +} | ... | ... |
-
Please register or login to post a comment