Sho SHIMIZU
Committed by Gerrit Code Review

Conform to our naming convention for enum

Change-Id: I6dd12ca899b72f5d0f9c7831fcbcceb83c2bf3a5
......@@ -16,7 +16,7 @@
package org.onosproject.bgpio.protocol;
import org.onosproject.bgpio.exceptions.BGPParseException;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType;
import org.onosproject.bgpio.types.RouteDistinguisher;
/**
......@@ -43,7 +43,7 @@ public interface BGPLSNlri {
* @return Protocol Id in Nlri
* @throws BGPParseException while getting protocol ID
*/
PROTOCOLTYPE getProtocolId() throws BGPParseException;
ProtocolType getProtocolId() throws BGPParseException;
/**
* Returns Route distinguisher in Nlri.
......
......@@ -61,8 +61,8 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
/**
* Enum to provide PROTOCOLTYPE.
*/
public enum PROTOCOLTYPE {
ISIS_LevelOne(1), ISIS_LevelTwo(2), OSPFv2(3), Direct(4), Static_Configuration(5), OSPFv3(6);
public enum ProtocolType {
ISIS_LEVEL_ONE(1), ISIS_LEVEL_TWO(2), OSPF_V2(3), DIRECT(4), STATIC_CONFIGURATION(5), OSPF_V3(6);
int value;
/**
......@@ -70,7 +70,7 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
*
* @param val protocol type
*/
PROTOCOLTYPE(int val) {
ProtocolType(int val) {
value = val;
}
......@@ -180,20 +180,20 @@ public class BGPNodeLSNlriVer4 implements BGPNodeLSNlri {
}
@Override
public PROTOCOLTYPE getProtocolId() throws BGPParseException {
public ProtocolType getProtocolId() throws BGPParseException {
switch (protocolId) {
case Constants.ISIS_LEVELONE:
return PROTOCOLTYPE.ISIS_LevelOne;
return ProtocolType.ISIS_LEVEL_ONE;
case Constants.ISIS_LEVELTWO:
return PROTOCOLTYPE.ISIS_LevelTwo;
return ProtocolType.ISIS_LEVEL_TWO;
case Constants.OSPFV2:
return PROTOCOLTYPE.OSPFv2;
return ProtocolType.OSPF_V2;
case Constants.DIRECT:
return PROTOCOLTYPE.Direct;
return ProtocolType.DIRECT;
case Constants.STATIC_CONFIGURATION:
return PROTOCOLTYPE.Static_Configuration;
return ProtocolType.STATIC_CONFIGURATION;
case Constants.OSPFV3:
return PROTOCOLTYPE.OSPFv3;
return ProtocolType.OSPF_V3;
default:
throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
}
......
......@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BGPParseException;
import org.onosproject.bgpio.protocol.BGPPrefixLSNlri;
import org.onosproject.bgpio.protocol.NlriType;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType;
import org.onosproject.bgpio.types.BGPValueType;
import org.onosproject.bgpio.types.RouteDistinguisher;
import org.onosproject.bgpio.util.Constants;
......@@ -145,20 +145,20 @@ public class BGPPrefixIPv4LSNlriVer4 implements BGPPrefixLSNlri {
}
@Override
public PROTOCOLTYPE getProtocolId() throws BGPParseException {
public ProtocolType getProtocolId() throws BGPParseException {
switch (protocolId) {
case Constants.ISIS_LEVELONE:
return PROTOCOLTYPE.ISIS_LevelOne;
return ProtocolType.ISIS_LEVEL_ONE;
case Constants.ISIS_LEVELTWO:
return PROTOCOLTYPE.ISIS_LevelTwo;
return ProtocolType.ISIS_LEVEL_TWO;
case Constants.OSPFV2:
return PROTOCOLTYPE.OSPFv2;
return ProtocolType.OSPF_V2;
case Constants.DIRECT:
return PROTOCOLTYPE.Direct;
return ProtocolType.DIRECT;
case Constants.STATIC_CONFIGURATION:
return PROTOCOLTYPE.Static_Configuration;
return ProtocolType.STATIC_CONFIGURATION;
case Constants.OSPFV3:
return PROTOCOLTYPE.OSPFv3;
return ProtocolType.OSPF_V3;
default:
throw new BGPParseException("protocol id not valid");
}
......
......@@ -21,7 +21,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BGPParseException;
import org.onosproject.bgpio.protocol.BgpLinkLsNlri;
import org.onosproject.bgpio.protocol.NlriType;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType;
import org.onosproject.bgpio.types.BGPErrorType;
import org.onosproject.bgpio.types.BGPValueType;
import org.onosproject.bgpio.types.RouteDistinguisher;
......@@ -140,20 +140,20 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
}
@Override
public PROTOCOLTYPE getProtocolId() throws BGPParseException {
public ProtocolType getProtocolId() throws BGPParseException {
switch (protocolId) {
case Constants.ISIS_LEVELONE:
return PROTOCOLTYPE.ISIS_LevelOne;
return ProtocolType.ISIS_LEVEL_ONE;
case Constants.ISIS_LEVELTWO:
return PROTOCOLTYPE.ISIS_LevelTwo;
return ProtocolType.ISIS_LEVEL_TWO;
case Constants.OSPFV2:
return PROTOCOLTYPE.OSPFv2;
return ProtocolType.OSPF_V2;
case Constants.DIRECT:
return PROTOCOLTYPE.Direct;
return ProtocolType.DIRECT;
case Constants.STATIC_CONFIGURATION:
return PROTOCOLTYPE.Static_Configuration;
return ProtocolType.STATIC_CONFIGURATION;
case Constants.OSPFV3:
return PROTOCOLTYPE.OSPFv3;
return ProtocolType.OSPF_V3;
default:
throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
}
......@@ -207,4 +207,4 @@ public class BgpLinkLsNlriVer4 implements BgpLinkLsNlri {
.add("linkLSIdentifier", linkLSIdentifier)
.toString();
}
}
\ No newline at end of file
}
......
......@@ -19,7 +19,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.PROTOCOLTYPE;
import org.onosproject.bgpio.protocol.linkstate.BGPNodeLSNlriVer4.ProtocolType;
import org.onosproject.bgpio.types.BGPValueType;
import com.google.common.base.MoreObjects;
......@@ -29,7 +29,7 @@ import com.google.common.base.MoreObjects;
*/
public class PathAttrNlriDetails {
private List<BGPValueType> pathAttributes;
private PROTOCOLTYPE protocolID;
private ProtocolType protocolID;
private long identifier;
/**
......@@ -55,7 +55,7 @@ public class PathAttrNlriDetails {
*
* @param protocolID in linkstate nlri
*/
public void setProtocolID(PROTOCOLTYPE protocolID) {
public void setProtocolID(ProtocolType protocolID) {
this.protocolID = protocolID;
}
......@@ -64,7 +64,7 @@ public class PathAttrNlriDetails {
*
* @return protocolID
*/
public PROTOCOLTYPE protocolID() {
public ProtocolType protocolID() {
return this.protocolID;
}
......@@ -132,4 +132,4 @@ public class PathAttrNlriDetails {
.add("pathAttributes", pathAttributes)
.toString();
}
}
\ No newline at end of file
}
......