Jonathan Hart
Committed by Gerrit Code Review

Enforce naming convention regarding abbreviations

Change-Id: Ic81038d3869268a55624ccbbf66048545158b0da
Showing 121 changed files with 572 additions and 596 deletions
......@@ -60,7 +60,7 @@ public class DefaultIpDeviceDescription extends AbstractDescription
* @param annotations Annotations to use.
*/
public DefaultIpDeviceDescription(IpDeviceDescription base, SparseAnnotations... annotations) {
this(base.deviceURI(), base.type(), base.deviceIdentifier(),
this(base.deviceUri(), base.type(), base.deviceIdentifier(),
base.deviceTed(), annotations);
}
......@@ -71,12 +71,12 @@ public class DefaultIpDeviceDescription extends AbstractDescription
* @param annotations Annotations to use.
*/
public DefaultIpDeviceDescription(IpDeviceDescription base, Type type, SparseAnnotations... annotations) {
this(base.deviceURI(), type, base.deviceIdentifier(),
this(base.deviceUri(), type, base.deviceIdentifier(),
base.deviceTed(), annotations);
}
@Override
public URI deviceURI() {
public URI deviceUri() {
return uri;
}
......
......@@ -35,7 +35,7 @@ public interface IpDeviceDescription extends Description {
*
* @return provider specific URI for the ip device
*/
URI deviceURI();
URI deviceUri();
/**
* Returns the type of the ip device. For ex: Psuedo or actual
......
......@@ -25,13 +25,13 @@ import java.util.HashMap;
public final class OpenstackExternalGateway {
private String networkId;
private boolean enablePNAT;
private boolean enablePnat;
private HashMap<String, Ip4Address> externalFixedIps;
private OpenstackExternalGateway(String networkId, boolean enablePNAT,
private OpenstackExternalGateway(String networkId, boolean enablePnat,
HashMap externalFixedIps) {
this.networkId = networkId;
this.enablePNAT = enablePNAT;
this.enablePnat = enablePnat;
this.externalFixedIps = externalFixedIps;
}
......@@ -49,8 +49,8 @@ public final class OpenstackExternalGateway {
*
* @return PNAT status
*/
public boolean isEnablePNAT() {
return enablePNAT;
public boolean isEnablePnat() {
return enablePnat;
}
/**
......@@ -58,11 +58,11 @@ public final class OpenstackExternalGateway {
*/
public static final class Builder {
private String networkId;
private boolean enablePNAT;
private HashMap<String, Ip4Address> externalFixedIPs;
private boolean enablePnat;
private HashMap<String, Ip4Address> externalFixedIps;
Builder() {
externalFixedIPs = new HashMap<>();
externalFixedIps = new HashMap<>();
}
/**
......@@ -79,11 +79,11 @@ public final class OpenstackExternalGateway {
/**
* Sets whether PNAT status is enabled or not.
*
* @param enablePNAT true if PNAT status is enabled, false otherwise
* @param enablePnat true if PNAT status is enabled, false otherwise
* @return Builder object
*/
public Builder enablePNAT(boolean enablePNAT) {
this.enablePNAT = enablePNAT;
public Builder enablePnat(boolean enablePnat) {
this.enablePnat = enablePnat;
return this;
}
......@@ -93,8 +93,8 @@ public final class OpenstackExternalGateway {
* @param externalFixedIPs External fixed IP information
* @return Builder object
*/
public Builder externalFixedIPs(HashMap<String, Ip4Address> externalFixedIPs) {
this.externalFixedIPs.putAll(externalFixedIPs);
public Builder externalFixedIps(HashMap<String, Ip4Address> externalFixedIPs) {
this.externalFixedIps.putAll(externalFixedIPs);
return this;
}
......@@ -104,7 +104,7 @@ public final class OpenstackExternalGateway {
* @return OpenstackExternalGateway object
*/
public OpenstackExternalGateway build() {
return new OpenstackExternalGateway(networkId, enablePNAT, externalFixedIPs);
return new OpenstackExternalGateway(networkId, enablePnat, externalFixedIps);
}
}
......
......@@ -20,10 +20,10 @@ import org.onosproject.net.packet.PacketContext;
/**
* Handle ICMP packet processing for Managing Flow Rules In Openstack Nodes.
*/
public class OpenstackICMPHandler implements Runnable {
public class OpenstackIcmpHandler implements Runnable {
volatile PacketContext context;
OpenstackICMPHandler(PacketContext context) {
OpenstackIcmpHandler(PacketContext context) {
this.context = context;
}
......
......@@ -20,10 +20,10 @@ import org.onosproject.net.packet.PacketContext;
/**
* Handle NAT packet processing for Managing Flow Rules In Openstack Nodes.
*/
public class OpenstackPNATHandler implements Runnable {
public class OpenstackPnatHandler implements Runnable {
volatile PacketContext context;
OpenstackPNATHandler(PacketContext context) {
OpenstackPnatHandler(PacketContext context) {
this.context = context;
}
......
......@@ -57,8 +57,8 @@ public class OpenstackRoutingManager implements OpenstackRoutingService {
protected DriverService driverService;
private ApplicationId appId;
private OpenstackICMPHandler icmpHandler;
private OpenstackPNATHandler natHandler;
private OpenstackIcmpHandler icmpHandler;
private OpenstackPnatHandler natHandler;
private OpenstackFloatingIPHandler floatingIPHandler;
private OpenstackRoutingRulePopulator openstackRoutingRulePopulator;
......@@ -144,10 +144,10 @@ public class OpenstackRoutingManager implements OpenstackRoutingService {
IPv4 iPacket = (IPv4) ethernet.getPayload();
switch (iPacket.getProtocol()) {
case IPv4.PROTOCOL_ICMP:
icmpEventExcutorService.execute(new OpenstackICMPHandler(context));
icmpEventExcutorService.execute(new OpenstackIcmpHandler(context));
break;
default:
l3EventExcutorService.execute(new OpenstackPNATHandler(context));
l3EventExcutorService.execute(new OpenstackPnatHandler(context));
break;
}
......
......@@ -67,7 +67,7 @@ public final class OpenstackPortInfo {
return this;
}
public Builder setVNI(long vni) {
public Builder setVni(long vni) {
this.vni = checkNotNull(vni, "vni cannot be null");
return this;
}
......
......@@ -327,7 +327,7 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService {
OpenstackPortInfo.Builder portBuilder = OpenstackPortInfo.builder()
.setDeviceId(deviceId)
.setHostIp((Ip4Address) openstackPort.fixedIps().values().stream().findFirst().orElse(null))
.setVNI(vni);
.setVni(vni);
openstackPortInfoMap.putIfAbsent(port.annotations().value(PORTNAME),
portBuilder.build());
......
......@@ -26,5 +26,5 @@ public interface PcepLinkListener {
*
* @param link pcep link
*/
void handlePCEPlink(PcepLink link);
void handlePceplink(PcepLink link);
}
......
......@@ -69,7 +69,7 @@ public interface PcepTunnel extends PcepOperator {
DIAMOND
}
enum PATHTYPE {
enum PathType {
/**
* Indicates path is the preferred path.
......@@ -179,7 +179,7 @@ public interface PcepTunnel extends PcepOperator {
*
* @return the type of a path, the preferred or alternate.
*/
PATHTYPE getPathType();
PathType getPathType();
/**
* Get the under lay tunnel id of VLAN tunnel.
......
......@@ -26,7 +26,7 @@ public interface PcepTunnelListener {
*
* @param tunnel a pceptunnel.
*/
void handlePCEPTunnel(PcepTunnel tunnel);
void handlePcepTunnel(PcepTunnel tunnel);
/**
* Notify that get a tunnel statistic data from the network.
......
......@@ -28,24 +28,24 @@ public interface ServiceFunctionForwarderService {
* Install Forwarding rule.
*
* @param portChain port-chain
* @param nshSPI nsh spi
* @param nshSpi nsh spi
*/
void installForwardingRule(PortChain portChain, NshServicePathId nshSPI);
void installForwardingRule(PortChain portChain, NshServicePathId nshSpi);
/**
* Uninstall Forwarding rule.
*
* @param portChain port-chain
* @param nshSPI nsh spi
* @param nshSpi nsh spi
*/
void unInstallForwardingRule(PortChain portChain, NshServicePathId nshSPI);
void unInstallForwardingRule(PortChain portChain, NshServicePathId nshSpi);
/**
* Prepare forwarding object for Service Function.
*
* @param portChain port-chain
* @param nshSPI nsh spi
* @param nshSpi nsh spi
* @param type forwarding objective operation type
*/
void prepareServiceFunctionForwarder(PortChain portChain, NshServicePathId nshSPI, Objective.Operation type);
void prepareServiceFunctionForwarder(PortChain portChain, NshServicePathId nshSpi, Objective.Operation type);
}
......
......@@ -15,58 +15,56 @@
*/
package org.onosproject.sfc.forwarder.impl;
import static org.slf4j.LoggerFactory.getLogger;
import static org.onosproject.net.flow.criteria.ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import java.util.ListIterator;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
import org.onlab.osgi.DefaultServiceDirectory;
import org.onlab.osgi.ServiceDirectory;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.behaviour.ExtensionSelectorResolver;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Host;
import org.onosproject.net.HostId;
import org.onosproject.net.NshServicePathId;
import org.onosproject.net.PortNumber;
import org.onosproject.net.behaviour.ExtensionSelectorResolver;
import org.onosproject.net.driver.DriverHandler;
import org.onosproject.net.driver.DriverService;
import org.onosproject.net.flow.DefaultTrafficSelector;
import org.onosproject.net.flow.DefaultTrafficTreatment;
import org.onosproject.net.flow.criteria.ExtensionSelector;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.flow.criteria.ExtensionSelector;
import org.onosproject.net.flowobjective.DefaultForwardingObjective;
import org.onosproject.net.flowobjective.FlowObjectiveService;
import org.onosproject.net.flowobjective.ForwardingObjective;
import org.onosproject.net.flowobjective.ForwardingObjective.Flag;
import org.onosproject.net.flowobjective.Objective;
import org.onosproject.net.host.HostService;
import org.onosproject.net.flowobjective.ForwardingObjective.Flag;
import org.onosproject.vtnrsc.VirtualPortId;
import org.onosproject.vtnrsc.service.VtnRscService;
import org.onosproject.sfc.forwarder.ServiceFunctionForwarderService;
import org.onosproject.vtnrsc.PortChain;
import org.onosproject.vtnrsc.PortPair;
import org.onosproject.vtnrsc.PortPairGroup;
import org.onosproject.vtnrsc.PortPairGroupId;
import org.onosproject.vtnrsc.PortPairId;
import org.onosproject.vtnrsc.virtualport.VirtualPortService;
import org.onosproject.vtnrsc.portpair.PortPairService;
import org.onosproject.vtnrsc.portpairgroup.PortPairGroupService;
import org.onosproject.vtnrsc.VirtualPortId;
import org.onosproject.vtnrsc.flowclassifier.FlowClassifierService;
import org.onosproject.vtnrsc.portchain.PortChainService;
import org.onosproject.sfc.forwarder.ServiceFunctionForwarderService;
import org.onosproject.vtnrsc.portpair.PortPairService;
import org.onosproject.vtnrsc.portpairgroup.PortPairGroupService;
import org.onosproject.vtnrsc.service.VtnRscService;
import org.onosproject.vtnrsc.virtualport.VirtualPortService;
import org.slf4j.Logger;
import java.util.List;
import java.util.ListIterator;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.net.flow.criteria.ExtensionSelectorType.ExtensionSelectorTypes.NICIRA_MATCH_NSH_SPI;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Provides Service Function Forwarder implementation.
*/
......@@ -119,19 +117,19 @@ public class ServiceFunctionForwarderImpl implements ServiceFunctionForwarderSer
}
@Override
public void installForwardingRule(PortChain portChain, NshServicePathId nshSPI) {
public void installForwardingRule(PortChain portChain, NshServicePathId nshSpi) {
checkNotNull(portChain, PORT_CHAIN_NOT_NULL);
prepareServiceFunctionForwarder(portChain, nshSPI, Objective.Operation.ADD);
prepareServiceFunctionForwarder(portChain, nshSpi, Objective.Operation.ADD);
}
@Override
public void unInstallForwardingRule(PortChain portChain, NshServicePathId nshSPI) {
public void unInstallForwardingRule(PortChain portChain, NshServicePathId nshSpi) {
checkNotNull(portChain, PORT_CHAIN_NOT_NULL);
prepareServiceFunctionForwarder(portChain, nshSPI, Objective.Operation.REMOVE);
prepareServiceFunctionForwarder(portChain, nshSpi, Objective.Operation.REMOVE);
}
@Override
public void prepareServiceFunctionForwarder(PortChain portChain, NshServicePathId nshSPI,
public void prepareServiceFunctionForwarder(PortChain portChain, NshServicePathId nshSpi,
Objective.Operation type) {
// Go through the port pair group list
......@@ -153,7 +151,7 @@ public class ServiceFunctionForwarderImpl implements ServiceFunctionForwarderSer
PortPairGroup nextPortPairGroup = portPairGroupService.getPortPairGroup(portPairGrpId);
// push SFF to OVS
pushServiceFunctionForwarder(currentPortPairGroup, nextPortPairGroup, listGrpIterator, nshSPI, type);
pushServiceFunctionForwarder(currentPortPairGroup, nextPortPairGroup, listGrpIterator, nshSpi, type);
}
/**
......@@ -162,11 +160,11 @@ public class ServiceFunctionForwarderImpl implements ServiceFunctionForwarderSer
* @param currentPortPairGroup current port-pair-group
* @param nextPortPairGroup next port-pair-group
* @param listGrpIterator pointer to port-pair-group list
* @param nshSPI nsh service path id
* @param nshSpi nsh service path id
* @param type objective type
*/
public void pushServiceFunctionForwarder(PortPairGroup currentPortPairGroup, PortPairGroup nextPortPairGroup,
ListIterator<PortPairGroupId> listGrpIterator, NshServicePathId nshSPI, Objective.Operation type) {
ListIterator<PortPairGroupId> listGrpIterator, NshServicePathId nshSpi, Objective.Operation type) {
DeviceId deviceId = null;
DeviceId currentDeviceId = null;
DeviceId nextDeviceId = null;
......@@ -185,13 +183,13 @@ public class ServiceFunctionForwarderImpl implements ServiceFunctionForwarderSer
PortPairId portPairId = portPLIterator.next();
PortPair portPair = portPairService.getPortPair(portPairId);
currentDeviceId = vtnRscService.getSFToSFFMaping(VirtualPortId.portId(portPair.ingress()));
currentDeviceId = vtnRscService.getSfToSffMaping(VirtualPortId.portId(portPair.ingress()));
if (deviceId == null) {
deviceId = currentDeviceId;
}
// pack traffic selector
TrafficSelector.Builder selector = packTrafficSelector(deviceId, portPair, nshSPI);
TrafficSelector.Builder selector = packTrafficSelector(deviceId, portPair, nshSpi);
// Get the required information on port pairs from destination port
// pair group
......@@ -204,7 +202,7 @@ public class ServiceFunctionForwarderImpl implements ServiceFunctionForwarderSer
portPairId = portPLIterator.next();
portPair = portPairService.getPortPair(portPairId);
nextDeviceId = vtnRscService.getSFToSFFMaping(VirtualPortId.portId(portPair.ingress()));
nextDeviceId = vtnRscService.getSfToSffMaping(VirtualPortId.portId(portPair.ingress()));
// pack traffic treatment
TrafficTreatment.Builder treatment = packTrafficTreatment(currentDeviceId, nextDeviceId, portPair);
......@@ -228,10 +226,10 @@ public class ServiceFunctionForwarderImpl implements ServiceFunctionForwarderSer
*
* @param deviceId device id
* @param portPair port-pair
* @param nshSPI nsh spi
* @param nshSpi nsh spi
* @return traffic treatment
*/
public TrafficSelector.Builder packTrafficSelector(DeviceId deviceId, PortPair portPair, NshServicePathId nshSPI) {
public TrafficSelector.Builder packTrafficSelector(DeviceId deviceId, PortPair portPair, NshServicePathId nshSpi) {
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
MacAddress dstMacAddress = virtualPortService.getPort(VirtualPortId.portId(portPair.egress())).macAddress();
Host host = hostService.getHost(HostId.hostId(dstMacAddress));
......@@ -243,7 +241,7 @@ public class ServiceFunctionForwarderImpl implements ServiceFunctionForwarderSer
ExtensionSelector nspSpiSelector = resolver.getExtensionSelector(NICIRA_MATCH_NSH_SPI.type());
try {
nspSpiSelector.setPropertyValue("nshSpi", nshSPI);
nspSpiSelector.setPropertyValue("nshSpi", nshSpi);
} catch (Exception e) {
log.error("Failed to get extension instruction to set Nsh Spi Id {}", deviceId);
}
......
......@@ -15,20 +15,10 @@
*/
package org.onosproject.sfc.installer.impl;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.net.flow.instructions.ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SI;
import static org.onosproject.net.flow.instructions.ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SPI;
import static org.slf4j.LoggerFactory.getLogger;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import org.apache.felix.scr.annotations.Component;
import org.onlab.osgi.DefaultServiceDirectory;
import org.onlab.osgi.ServiceDirectory;
import org.onlab.packet.Ethernet;
......@@ -41,8 +31,8 @@ import org.onosproject.net.Host;
import org.onosproject.net.HostId;
import org.onosproject.net.NshServicePathId;
import org.onosproject.net.PortNumber;
import org.onosproject.net.device.DeviceService;
import org.onosproject.net.behaviour.ExtensionTreatmentResolver;
import org.onosproject.net.device.DeviceService;
import org.onosproject.net.driver.DriverHandler;
import org.onosproject.net.driver.DriverService;
import org.onosproject.net.flow.DefaultTrafficSelector;
......@@ -72,9 +62,17 @@ import org.onosproject.vtnrsc.portpair.PortPairService;
import org.onosproject.vtnrsc.portpairgroup.PortPairGroupService;
import org.onosproject.vtnrsc.service.VtnRscService;
import org.onosproject.vtnrsc.virtualport.VirtualPortService;
import org.slf4j.Logger;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.net.flow.instructions.ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SI;
import static org.onosproject.net.flow.instructions.ExtensionTreatmentType.ExtensionTreatmentTypes.NICIRA_SET_NSH_SPI;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Provides flow classifier installer implementation.
*/
......@@ -175,7 +173,7 @@ public class FlowClassifierInstallerImpl implements FlowClassifierInstallerServi
}
@Override
public void prepareFlowClassification(FlowClassifier flowClassifier, PortPair portPair, NshServicePathId nshSPI,
public void prepareFlowClassification(FlowClassifier flowClassifier, PortPair portPair, NshServicePathId nshSpi,
Operation type) {
DeviceId deviceId = null;
// device id if virtual ports are set in flow classifier.
......@@ -187,10 +185,10 @@ public class FlowClassifierInstallerImpl implements FlowClassifierInstallerServi
TpPort nshDstPort = TpPort.tpPort(6633);
if ((flowClassifier.srcPort() != null) && (!flowClassifier.srcPort().portId().isEmpty())) {
deviceIdfromFc = vtnRscService.getSFToSFFMaping(flowClassifier.srcPort());
deviceIdfromFc = vtnRscService.getSfToSffMaping(flowClassifier.srcPort());
deviceId = deviceIdfromFc;
} else {
deviceIdfromPp = vtnRscService.getSFToSFFMaping(VirtualPortId.portId(portPair.ingress()));
deviceIdfromPp = vtnRscService.getSfToSffMaping(VirtualPortId.portId(portPair.ingress()));
srcMacAddress = virtualPortService.getPort(VirtualPortId.portId(portPair.egress())).macAddress();
deviceId = deviceIdfromPp;
}
......@@ -200,7 +198,7 @@ public class FlowClassifierInstallerImpl implements FlowClassifierInstallerServi
// Build traffic treatment.
TrafficTreatment.Builder treatment = packTrafficTreatment(deviceId, srcMacAddress, nshDstPort, deviceIdfromFc,
deviceIdfromPp, nshSPI, flowClassifier);
deviceIdfromPp, nshSpi, flowClassifier);
// Build forwarding objective and send to OVS.
sendServiceFunctionForwarder(selector, treatment, deviceId, type);
......@@ -266,13 +264,13 @@ public class FlowClassifierInstallerImpl implements FlowClassifierInstallerServi
* @param nshDstPort vxlan tunnel port for nsh header
* @param deviceIdfromFc device id if virtual ports are set in flow classifier.
* @param deviceIdfromPp device id if port pair is used to fetch device id.
* @param nshSPI nsh spi
* @param nshSpi nsh spi
* @param flowClassifier flow-classifier
* @return traffic treatment
*/
public TrafficTreatment.Builder packTrafficTreatment(DeviceId deviceId, MacAddress srcMacAddress,
TpPort nshDstPort, DeviceId deviceIdfromFc, DeviceId deviceIdfromPp,
NshServicePathId nshSPI, FlowClassifier flowClassifier) {
NshServicePathId nshSpi, FlowClassifier flowClassifier) {
TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder();
Host host = hostService.getHost(HostId.hostId(srcMacAddress));
......@@ -295,7 +293,7 @@ public class FlowClassifierInstallerImpl implements FlowClassifierInstallerServi
treatmentBuilder.setUdpDst(nshDstPort);
try {
nspIdTreatment.setPropertyValue("nshSpi", nshSPI);
nspIdTreatment.setPropertyValue("nshSpi", nshSpi);
} catch (Exception e) {
log.error("Failed to get extension instruction to set Nsh Spi Id {}", deviceId);
}
......
......@@ -15,20 +15,14 @@
*/
package org.onosproject.sfc.manager.impl;
import static org.slf4j.LoggerFactory.getLogger;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import org.onlab.util.KryoNamespace;
import org.onlab.util.ItemNotFoundException;
import org.onlab.util.KryoNamespace;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.NshServicePathId;
......@@ -38,22 +32,26 @@ import org.onosproject.sfc.installer.FlowClassifierInstallerService;
import org.onosproject.sfc.installer.impl.FlowClassifierInstallerImpl;
import org.onosproject.sfc.manager.NshSpiIdGenerators;
import org.onosproject.sfc.manager.SfcService;
import org.onosproject.vtnrsc.PortPair;
import org.onosproject.vtnrsc.PortPairId;
import org.onosproject.vtnrsc.PortPairGroup;
import org.onosproject.vtnrsc.PortPairGroupId;
import org.onosproject.vtnrsc.FlowClassifier;
import org.onosproject.vtnrsc.FlowClassifierId;
import org.onosproject.vtnrsc.PortChain;
import org.onosproject.vtnrsc.PortChainId;
import org.onosproject.vtnrsc.PortPair;
import org.onosproject.vtnrsc.PortPairGroup;
import org.onosproject.vtnrsc.PortPairGroupId;
import org.onosproject.vtnrsc.PortPairId;
import org.onosproject.vtnrsc.TenantId;
import org.onosproject.vtnrsc.event.VtnRscEvent;
import org.onosproject.vtnrsc.event.VtnRscEventFeedback;
import org.onosproject.vtnrsc.event.VtnRscListener;
import org.onosproject.vtnrsc.service.VtnRscService;
import org.slf4j.Logger;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Provides implementation of SFC Service.
*/
......@@ -192,18 +190,18 @@ public class SfcManager implements SfcService {
@Override
public void onPortChainCreated(PortChain portChain) {
NshServicePathId nshSPI;
NshServicePathId nshSpi;
log.info("onPortChainCreated");
if (nshSpiPortChainMap.containsKey(portChain.portChainId())) {
nshSPI = nshSpiPortChainMap.get(portChain.portChainId());
nshSpi = nshSpiPortChainMap.get(portChain.portChainId());
} else {
nshSPI = NshServicePathId.of(NshSpiIdGenerators.create());
nshSpiPortChainMap.put(portChain.portChainId(), nshSPI);
nshSpi = NshServicePathId.of(NshSpiIdGenerators.create());
nshSpiPortChainMap.put(portChain.portChainId(), nshSpi);
}
// install in OVS.
flowClassifierInstallerService.installFlowClassifier(portChain, nshSPI);
serviceFunctionForwarderService.installForwardingRule(portChain, nshSPI);
flowClassifierInstallerService.installFlowClassifier(portChain, nshSpi);
serviceFunctionForwarderService.installForwardingRule(portChain, nshSpi);
}
@Override
......@@ -213,12 +211,12 @@ public class SfcManager implements SfcService {
throw new ItemNotFoundException("Unable to find NSH SPI");
}
NshServicePathId nshSPI = nshSpiPortChainMap.get(portChain.portChainId());
NshServicePathId nshSpi = nshSpiPortChainMap.get(portChain.portChainId());
// uninstall from OVS.
flowClassifierInstallerService.unInstallFlowClassifier(portChain, nshSPI);
serviceFunctionForwarderService.unInstallForwardingRule(portChain, nshSPI);
flowClassifierInstallerService.unInstallFlowClassifier(portChain, nshSpi);
serviceFunctionForwarderService.unInstallForwardingRule(portChain, nshSpi);
// remove SPI. No longer it will be used.
nshSpiPortChainMap.remove(nshSPI);
nshSpiPortChainMap.remove(nshSpi);
}
}
......
......@@ -51,7 +51,7 @@ public class VtnRscManagerTestImpl implements VtnRscService {
}
@Override
public Iterator<Device> getSFFOfTenant(TenantId tenantId) {
public Iterator<Device> getSffOfTenant(TenantId tenantId) {
return null;
}
......@@ -67,7 +67,7 @@ public class VtnRscManagerTestImpl implements VtnRscService {
}
@Override
public DeviceId getSFToSFFMaping(VirtualPortId portId) {
public DeviceId getSfToSffMaping(VirtualPortId portId) {
return DeviceId.deviceId("www.google.com");
}
......
......@@ -18,7 +18,7 @@ package org.onosproject.vtn.cli;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.vtn.manager.impl.VTNManager;
import org.onosproject.vtn.manager.impl.VtnManager;
/**
* Supports for updating the external gateway virtualPort.
......@@ -33,6 +33,6 @@ public class VtnCommand extends AbstractShellCommand {
@Override
protected void execute() {
VTNManager.setExPortName(exPortName);
VtnManager.setExPortName(exPortName);
}
}
......
......@@ -22,7 +22,7 @@ import org.onosproject.vtnrsc.event.VtnRscEventFeedback;
/**
* VTN application that applies configuration and flows to the device.
*/
public interface VTNService {
public interface VtnService {
/**
* Creates a vxlan tunnel and creates the ovs when a ovs controller node is
......
......@@ -82,7 +82,7 @@ import org.onosproject.store.service.LogicalClockService;
import org.onosproject.store.service.Serializer;
import org.onosproject.store.service.StorageService;
import org.onosproject.store.service.Versioned;
import org.onosproject.vtn.manager.VTNService;
import org.onosproject.vtn.manager.VtnService;
import org.onosproject.vtn.table.ArpService;
import org.onosproject.vtn.table.ClassifierService;
import org.onosproject.vtn.table.DnatService;
......@@ -131,7 +131,7 @@ import com.google.common.collect.Sets;
*/
@Component(immediate = true)
@Service
public class VTNManager implements VTNService {
public class VtnManager implements VtnService {
private final Logger log = getLogger(getClass());
private static final String APP_ID = "org.onosproject.app.vtn";
......
......@@ -15,8 +15,6 @@
*/
package org.onosproject.vtnrsc.service;
import java.util.Iterator;
import org.onlab.packet.MacAddress;
import org.onosproject.event.ListenerService;
import org.onosproject.net.Device;
......@@ -29,6 +27,8 @@ import org.onosproject.vtnrsc.VirtualPortId;
import org.onosproject.vtnrsc.event.VtnRscEvent;
import org.onosproject.vtnrsc.event.VtnRscListener;
import java.util.Iterator;
/**
* Service for interacting with the inventory of Vtn resource.
*/
......@@ -55,7 +55,7 @@ public interface VtnRscService extends ListenerService<VtnRscEvent, VtnRscListen
* @param tenantId tenant identifier
* @return iterable collection of Device
*/
Iterator<Device> getSFFOfTenant(TenantId tenantId);
Iterator<Device> getSffOfTenant(TenantId tenantId);
/**
* Returns gateway mac address of the specific host.
......@@ -79,7 +79,7 @@ public interface VtnRscService extends ListenerService<VtnRscEvent, VtnRscListen
* @param portId port identifier
* @return device identifier
*/
DeviceId getSFToSFFMaping(VirtualPortId portId);
DeviceId getSfToSffMaping(VirtualPortId portId);
/**
* Adds specify Device identifier to Service Function Forward OvsMap
......
......@@ -389,7 +389,7 @@ public class VtnRscManager extends AbstractListenerManager<VtnRscEvent, VtnRscLi
}
@Override
public Iterator<Device> getSFFOfTenant(TenantId tenantId) {
public Iterator<Device> getSffOfTenant(TenantId tenantId) {
checkNotNull(tenantId, TENANTID_NOT_NULL);
Set<DeviceId> deviceIdSet = sffOvsMap.get(tenantId);
Set<Device> deviceSet = new HashSet<>();
......@@ -430,7 +430,7 @@ public class VtnRscManager extends AbstractListenerManager<VtnRscEvent, VtnRscLi
}
@Override
public DeviceId getSFToSFFMaping(VirtualPortId portId) {
public DeviceId getSfToSffMaping(VirtualPortId portId) {
checkNotNull(portId, "portId cannot be null");
VirtualPort vmPort = virtualPortService.getPort(portId);
Set<Host> hostSet = hostService.getHostsByMac(vmPort.macAddress());
......
......@@ -44,7 +44,7 @@ public abstract class AbstractDriverLoader {
protected void activate() {
try {
provider = new XmlDriverLoader(getClassLoaderInstance())
.loadDrivers(loadXMLDriversStream(), driverAdminService);
.loadDrivers(loadXmlDriversStream(), driverAdminService);
driverAdminService.registerProvider(provider);
} catch (Exception e) {
log.error("Unable to load default drivers", e);
......@@ -58,7 +58,7 @@ public abstract class AbstractDriverLoader {
log.info("Stopped");
}
protected abstract InputStream loadXMLDriversStream();
protected abstract InputStream loadXmlDriversStream();
protected abstract ClassLoader getClassLoaderInstance();
......
......@@ -247,7 +247,7 @@ public interface Criterion {
}
}
enum TCPFlags {
enum TcpFlags {
/** ECN-nonce concealment protection. */
NS((short) (1 << 0)),
......@@ -270,7 +270,7 @@ public interface Criterion {
private short value;
TCPFlags(short value) {
TcpFlags(short value) {
this.value = value;
}
......
......@@ -138,17 +138,17 @@ public class CriteriaTest {
int tcpFlags1 =
Criterion.TCPFlags.NS.getValue() |
Criterion.TCPFlags.CWR.getValue() |
Criterion.TCPFlags.ECE.getValue() |
Criterion.TCPFlags.URG.getValue() |
Criterion.TCPFlags.ACK.getValue() |
Criterion.TCPFlags.PSH.getValue() |
Criterion.TCPFlags.RST.getValue() |
Criterion.TCPFlags.SYN.getValue();
Criterion.TcpFlags.NS.getValue() |
Criterion.TcpFlags.CWR.getValue() |
Criterion.TcpFlags.ECE.getValue() |
Criterion.TcpFlags.URG.getValue() |
Criterion.TcpFlags.ACK.getValue() |
Criterion.TcpFlags.PSH.getValue() |
Criterion.TcpFlags.RST.getValue() |
Criterion.TcpFlags.SYN.getValue();
int tcpFlags2 = tcpFlags1 |
Criterion.TCPFlags.FIN.getValue();
Criterion.TcpFlags.FIN.getValue();
Criterion matchTcpFlags1 = Criteria.matchTcpFlags(tcpFlags1);
Criterion sameAsmatchTcpFlags1 = Criteria.matchTcpFlags(tcpFlags1);
......
......@@ -30,7 +30,7 @@ public class CienaDriversLoader extends AbstractDriverLoader {
private static final String DRIVERS_XML = "/ciena-drivers.xml";
@Override
protected InputStream loadXMLDriversStream() {
protected InputStream loadXmlDriversStream() {
return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
}
......
......@@ -84,7 +84,7 @@ public class PortDiscoveryCienaWaveserverImpl extends AbstractHandlerBehaviour
if (LINESIDE.contains(name)) {
String wsportInfoRequest = SPECIFIC_PORT_PATH + sub.getLong(PORT_ID) +
SPECIFIC_PORT_CONFIG;
ports.add(XmlConfigParser.parseWaveServerCienaOCHPorts(
ports.add(XmlConfigParser.parseWaveServerCienaOchPorts(
sub.getLong(PORT_ID),
toGbps(Long.parseLong(sub.getString(SPEED).replace(GBPS, EMPTY_STRING))),
XmlConfigParser.loadXml(controller.get(deviceId, wsportInfoRequest, XML)),
......
......@@ -33,7 +33,7 @@ public class DefaultDriversLoader extends AbstractDriverLoader implements Defaul
private static final String DRIVERS_XML = "/onos-drivers.xml";
@Override
protected InputStream loadXMLDriversStream() {
protected InputStream loadXmlDriversStream() {
return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
}
......
......@@ -149,7 +149,7 @@ public class OltPipeline extends AbstractHandlerBehaviour implements Pipeliner {
IPProtocolCriterion ipProto = (IPProtocolCriterion)
filterForCriterion(filter.conditions(), Criterion.Type.IP_PROTO);
if (ipProto.protocol() == IPv4.PROTOCOL_IGMP) {
provisionIGMP(filter, ethType, ipProto, output);
provisionIgmp(filter, ethType, ipProto, output);
} else {
log.error("OLT can only filter igmp");
fail(filter, ObjectiveError.UNSUPPORTED);
......@@ -377,7 +377,7 @@ public class OltPipeline extends AbstractHandlerBehaviour implements Pipeliner {
}
private void provisionIGMP(FilteringObjective filter, EthTypeCriterion ethType,
private void provisionIgmp(FilteringObjective filter, EthTypeCriterion ethType,
IPProtocolCriterion ipProto,
Instructions.OutputInstruction output) {
TrafficSelector selector = buildSelector(filter.key(), ethType, ipProto);
......
......@@ -134,11 +134,11 @@ public class OpenstackPipeline extends DefaultSingleTablePipeline
}
private void initializePipeline() {
processVNITable(true);
processVniTable(true);
processForwardingTable(true);
}
private void processVNITable(boolean install) {
private void processVniTable(boolean install) {
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
......
......@@ -30,7 +30,7 @@ public class FujitsuDriversLoader extends AbstractDriverLoader {
private static final String DRIVERS_XML = "/fujitsu-drivers.xml";
@Override
protected InputStream loadXMLDriversStream() {
protected InputStream loadXmlDriversStream() {
return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
}
......
......@@ -30,7 +30,7 @@ public class NetconfDriversLoader extends AbstractDriverLoader {
private static final String DRIVERS_XML = "/netconf-drivers.xml";
@Override
protected InputStream loadXMLDriversStream() {
protected InputStream loadXmlDriversStream() {
return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
}
......
......@@ -30,7 +30,7 @@ public class OvsdbDriversLoader extends AbstractDriverLoader {
private static final String DRIVERS_XML = "/ovsdb-drivers.xml";
@Override
protected InputStream loadXMLDriversStream() {
protected InputStream loadXmlDriversStream() {
return getClassLoaderInstance().getResourceAsStream(DRIVERS_XML);
}
......
......@@ -135,7 +135,7 @@ public final class XmlConfigParser {
return cfg.configurationsAt("ws-ports.port-interface");
}
public static PortDescription parseWaveServerCienaOCHPorts(long portNumber, long oduPortSpeed,
public static PortDescription parseWaveServerCienaOchPorts(long portNumber, long oduPortSpeed,
HierarchicalConfiguration config,
SparseAnnotations annotations) {
final List<String> tunableType = Lists.newArrayList("Performance-Optimized", "Accelerated");
......
......@@ -65,9 +65,9 @@ public class XmlConfigParserTest {
@Test
public void controllersConfig() {
InputStream streamOrig = getClass().getResourceAsStream("/testConfig.xml");
InputStream streamCFG = XmlConfigParser.class.getResourceAsStream("/controllers.xml");
InputStream streamCfg = XmlConfigParser.class.getResourceAsStream("/controllers.xml");
String config = XmlConfigParser
.createControllersConfig(XmlConfigParser.loadXml(streamCFG),
.createControllersConfig(XmlConfigParser.loadXml(streamCfg),
XmlConfigParser.loadXml(streamOrig),
"running", "merge", "create",
new ArrayList<>(
......
......@@ -45,14 +45,14 @@ public class DistributedMcastStore extends AbstractStore<McastEvent, McastStoreD
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
private StorageService storageService;
protected ConsistentMap<McastRoute, MulticastData> mcastRIB;
protected ConsistentMap<McastRoute, MulticastData> mcastRib;
protected Map<McastRoute, MulticastData> mcastRoutes;
@Activate
public void activate() {
mcastRIB = storageService.<McastRoute, MulticastData>consistentMapBuilder()
mcastRib = storageService.<McastRoute, MulticastData>consistentMapBuilder()
.withName(MCASTRIB)
.withSerializer(Serializer.using(KryoNamespace.newBuilder().register(
MulticastData.class,
......@@ -65,7 +65,7 @@ public class DistributedMcastStore extends AbstractStore<McastEvent, McastStoreD
.withRelaxedReadConsistency()
.build();
mcastRoutes = mcastRIB.asJavaMap();
mcastRoutes = mcastRib.asJavaMap();
log.info("Started");
......
......@@ -52,6 +52,7 @@
<module>incubator</module>
<module>features</module>
<module>tools/build/conf</module>
<module>tools/package/archetypes</module>
<module>tools/package/branding</module>
<module>tools/package/maven-plugin</module>
......@@ -75,7 +76,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<onos-build-conf.version>1.1</onos-build-conf.version>
<onos-build-conf.version>1.2-SNAPSHOT</onos-build-conf.version>
<netty4.version>4.0.33.Final</netty4.version>
<!-- TODO: replace with final release version when it is out -->
<atomix.version>0.1.0-beta5</atomix.version>
......
......@@ -16,12 +16,12 @@
package org.onosproject.bgp.controller;
import java.util.Map;
import java.util.Set;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.BgpMessage;
import java.util.Map;
import java.util.Set;
/**
* Abstraction of an BGP controller. Serves as a one stop shop for obtaining BGP devices and (un)register listeners on
* bgp events
......@@ -72,7 +72,7 @@ public interface BgpController {
* @param msg the message to process.
* @throws BgpParseException on data processing error
*/
void processBGPPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException;
void processBgpPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException;
/**
* Close all connected BGP peers.
......
......@@ -19,5 +19,5 @@ package org.onosproject.bgpio.protocol;
/**
* Provides Abstraction of IGP RouterID TLV.
*/
public interface IGPRouterID {
public interface IgpRouterId {
}
......
......@@ -27,7 +27,7 @@ import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.types.BgpErrorType;
import org.onosproject.bgpio.types.BgpValueType;
import org.onosproject.bgpio.types.IPReachabilityInformationTlv;
import org.onosproject.bgpio.types.OSPFRouteTypeTlv;
import org.onosproject.bgpio.types.OspfRouteTypeTlv;
import org.onosproject.bgpio.types.attr.BgpAttrNodeMultiTopologyId;
import org.onosproject.bgpio.util.UnSupportedAttribute;
import org.slf4j.Logger;
......@@ -139,8 +139,8 @@ public class BgpPrefixLSIdentifier implements Comparable<Object> {
}
tempCb = cb.readBytes(length);
switch (type) {
case OSPFRouteTypeTlv.TYPE:
tlv = OSPFRouteTypeTlv.read(tempCb);
case OspfRouteTypeTlv.TYPE:
tlv = OspfRouteTypeTlv.read(tempCb);
break;
case IPReachabilityInformationTlv.TYPE:
tlv = IPReachabilityInformationTlv.read(tempCb, length);
......
......@@ -31,8 +31,8 @@ import org.onosproject.bgpio.types.BgpLSIdentifierTlv;
import org.onosproject.bgpio.types.BgpValueType;
import org.onosproject.bgpio.types.IsIsNonPseudonode;
import org.onosproject.bgpio.types.IsIsPseudonode;
import org.onosproject.bgpio.types.OSPFNonPseudonode;
import org.onosproject.bgpio.types.OSPFPseudonode;
import org.onosproject.bgpio.types.OspfNonPseudonode;
import org.onosproject.bgpio.types.OspfPseudonode;
import org.onosproject.bgpio.util.UnSupportedAttribute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -193,9 +193,9 @@ public class NodeDescriptors {
}
} else if (protocolId == OSPF_V2_PROTOCOL_ID || protocolId == OSPF_V3_PROTOCOL_ID) {
if (length == OSPFNONPSEUDONODE_LEN) {
tlv = OSPFNonPseudonode.read(tempCb);
tlv = OspfNonPseudonode.read(tempCb);
} else if (length == OSPFPSEUDONODE_LEN) {
tlv = OSPFPseudonode.read(tempCb);
tlv = OspfPseudonode.read(tempCb);
}
}
break;
......
......@@ -122,11 +122,11 @@ class BgpNotificationMsgVer4 implements BgpNotificationMsg {
private BgpHeader bgpHeader;
private boolean isErrorCodeSet = false;
private boolean isErrorSubCodeSet = false;
private boolean isBGPHeaderSet = false;
private boolean isBgpHeaderSet = false;
@Override
public BgpNotificationMsg build() throws BgpParseException {
BgpHeader bgpHeader = this.isBGPHeaderSet ? this.bgpHeader : DEFAULT_MESSAGE_HEADER;
BgpHeader bgpHeader = this.isBgpHeaderSet ? this.bgpHeader : DEFAULT_MESSAGE_HEADER;
if (!this.isErrorCodeSet) {
throw new BgpParseException("Error code must be present");
}
......
......@@ -15,10 +15,7 @@
*/
package org.onosproject.bgpio.types;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.util.Constants;
......@@ -26,7 +23,9 @@ import org.onosproject.bgpio.util.Validation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Provides Implementation of As4Path BGP Path Attribute.
......@@ -122,7 +121,7 @@ public class As4Path implements BgpValueType {
*
* @return list of ASNum in AS4path Sequence
*/
public List<Integer> as4PathSEQ() {
public List<Integer> as4PathSeq() {
return this.as4pathSeq;
}
......@@ -131,7 +130,7 @@ public class As4Path implements BgpValueType {
*
* @return list of ASNum in AS4path Set
*/
public List<Integer> as4PathSET() {
public List<Integer> as4PathSet() {
return this.as4pathSet;
}
......
......@@ -16,10 +16,7 @@
package org.onosproject.bgpio.types;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.util.Constants;
......@@ -27,7 +24,9 @@ import org.onosproject.bgpio.util.Validation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Provides Implementation of AsPath mandatory BGP Path Attribute.
......@@ -36,7 +35,7 @@ public class AsPath implements BgpValueType {
/**
* Enum to provide AS types.
*/
public enum ASTYPE {
public enum AsType {
AS_SET(1), AS_SEQUENCE(2), AS_CONFED_SEQUENCE(3), AS_CONFED_SET(4);
int value;
......@@ -45,7 +44,7 @@ public class AsPath implements BgpValueType {
*
* @param val AS type
*/
ASTYPE(int val) {
AsType(int val) {
value = val;
}
......
......@@ -15,18 +15,17 @@
*/
package org.onosproject.bgpio.types;
import java.nio.ByteBuffer;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.protocol.IGPRouterID;
import org.onosproject.bgpio.protocol.IgpRouterId;
import com.google.common.base.MoreObjects;
import java.nio.ByteBuffer;
import java.util.Arrays;
/**
* Provides Implementation of IsIsNonPseudonode Tlv.
*/
public class IsIsNonPseudonode implements IGPRouterID, BgpValueType {
public class IsIsNonPseudonode implements IgpRouterId, BgpValueType {
public static final short TYPE = 515;
public static final short LENGTH = 6;
......@@ -56,7 +55,7 @@ public class IsIsNonPseudonode implements IGPRouterID, BgpValueType {
*
* @return ISO NodeID
*/
public byte[] getISONodeID() {
public byte[] getIsoNodeId() {
return isoNodeID;
}
......
......@@ -15,19 +15,18 @@
*/
package org.onosproject.bgpio.types;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.protocol.IgpRouterId;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.protocol.IGPRouterID;
import com.google.common.base.MoreObjects;
/**
* Provides implementation of IsIsPseudonode Tlv.
*/
public class IsIsPseudonode implements IGPRouterID, BgpValueType {
public class IsIsPseudonode implements IgpRouterId, BgpValueType {
public static final short TYPE = 515;
public static final short LENGTH = 7;
......@@ -62,7 +61,7 @@ public class IsIsPseudonode implements IGPRouterID, BgpValueType {
*
* @return ISO NodeID
*/
public byte[] getISONodeID() {
public byte[] getIsoNodeId() {
return isoNodeID;
}
......@@ -71,7 +70,7 @@ public class IsIsPseudonode implements IGPRouterID, BgpValueType {
*
* @return PSN Identifier
*/
public byte getPSNIdentifier() {
public byte getPsnIdentifier() {
return this.psnIdentifier;
}
......
......@@ -15,12 +15,12 @@
*/
package org.onosproject.bgpio.types;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import java.util.Objects;
/**
* Provides MultiProtocolExtnCapabilityTlv.
......@@ -74,7 +74,7 @@ public class MultiProtocolExtnCapabilityTlv implements BgpValueType {
* Returns afi Address Family Identifiers value.
* @return afi Address Family Identifiers value
*/
public short getAFI() {
public short getAfi() {
return afi;
}
......@@ -90,7 +90,7 @@ public class MultiProtocolExtnCapabilityTlv implements BgpValueType {
* Returns safi Subsequent Address Family Identifier value.
* @return safi Subsequent Address Family Identifier value
*/
public byte getSAFI() {
public byte getSafi() {
return safi;
}
......
......@@ -15,14 +15,13 @@
*/
package org.onosproject.bgpio.types;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.util.Constants;
import org.onosproject.bgpio.util.Validation;
import com.google.common.base.MoreObjects;
import java.util.Objects;
/**
* Provides Implementation of mandatory BGP Origin path attribute.
......@@ -32,7 +31,7 @@ public class Origin implements BgpValueType {
/**
* Enum to provide ORIGIN types.
*/
public enum ORIGINTYPE {
public enum OriginType {
IGP(0), EGP(1), INCOMPLETE(2);
int value;
/**
......@@ -40,7 +39,7 @@ public class Origin implements BgpValueType {
*
* @param val ORIGIN type
*/
ORIGINTYPE(int val) {
OriginType(int val) {
value = val;
}
......@@ -84,13 +83,13 @@ public class Origin implements BgpValueType {
*
* @return type of Origin in Enum values
*/
public ORIGINTYPE origin() {
public OriginType origin() {
if (this.origin == 0) {
return ORIGINTYPE.IGP;
return OriginType.IGP;
} else if (this.origin == 1) {
return ORIGINTYPE.EGP;
return OriginType.EGP;
} else {
return ORIGINTYPE.INCOMPLETE;
return OriginType.INCOMPLETE;
}
}
......@@ -118,8 +117,8 @@ public class Origin implements BgpValueType {
byte originValue;
originValue = cb.readByte();
if ((originValue != ORIGINTYPE.INCOMPLETE.value) && (originValue != ORIGINTYPE.IGP.value) &&
(originValue != ORIGINTYPE.EGP.value)) {
if ((originValue != OriginType.INCOMPLETE.value) && (originValue != OriginType.IGP.value) &&
(originValue != OriginType.EGP.value)) {
throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.INVALID_ORIGIN_ATTRIBUTE, data);
}
return new Origin(originValue);
......
......@@ -16,17 +16,16 @@
package org.onosproject.bgpio.types;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.protocol.IGPRouterID;
import org.onosproject.bgpio.protocol.IgpRouterId;
import com.google.common.base.MoreObjects;
import java.util.Objects;
/**
* Provides implementation of OSPFNonPseudonode Tlv.
*/
public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
public class OspfNonPseudonode implements IgpRouterId, BgpValueType {
public static final short TYPE = 515;
public static final short LENGTH = 4;
......@@ -37,7 +36,7 @@ public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
*
* @param routerID routerID
*/
public OSPFNonPseudonode(int routerID) {
public OspfNonPseudonode(int routerID) {
this.routerID = routerID;
}
......@@ -47,8 +46,8 @@ public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
* @param routerID routerID
* @return object of OSPFNonPseudonode
*/
public static OSPFNonPseudonode of(final int routerID) {
return new OSPFNonPseudonode(routerID);
public static OspfNonPseudonode of(final int routerID) {
return new OspfNonPseudonode(routerID);
}
/**
......@@ -71,8 +70,8 @@ public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
return true;
}
if (obj instanceof OSPFNonPseudonode) {
OSPFNonPseudonode other = (OSPFNonPseudonode) obj;
if (obj instanceof OspfNonPseudonode) {
OspfNonPseudonode other = (OspfNonPseudonode) obj;
return Objects.equals(routerID, other.routerID);
}
return false;
......@@ -93,8 +92,8 @@ public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
* @param cb ChannelBuffer
* @return object of OSPFNonPseudonode
*/
public static OSPFNonPseudonode read(ChannelBuffer cb) {
return OSPFNonPseudonode.of(cb.readInt());
public static OspfNonPseudonode read(ChannelBuffer cb) {
return OspfNonPseudonode.of(cb.readInt());
}
@Override
......@@ -107,7 +106,7 @@ public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
if (this.equals(o)) {
return 0;
}
return ((Integer) (this.routerID)).compareTo((Integer) (((OSPFNonPseudonode) o).routerID));
return ((Integer) (this.routerID)).compareTo((Integer) (((OspfNonPseudonode) o).routerID));
}
@Override
......
......@@ -15,18 +15,17 @@
*/
package org.onosproject.bgpio.types;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onlab.packet.Ip4Address;
import org.onosproject.bgpio.protocol.IGPRouterID;
import org.onosproject.bgpio.protocol.IgpRouterId;
import com.google.common.base.MoreObjects;
import java.util.Objects;
/**
* Provides implementation of OSPFPseudonode Tlv.
*/
public class OSPFPseudonode implements IGPRouterID, BgpValueType {
public class OspfPseudonode implements IgpRouterId, BgpValueType {
public static final short TYPE = 515;
public static final short LENGTH = 8;
......@@ -39,7 +38,7 @@ public class OSPFPseudonode implements IGPRouterID, BgpValueType {
* @param routerID routerID
* @param drInterface IPv4 address of the DR's interface
*/
public OSPFPseudonode(int routerID, Ip4Address drInterface) {
public OspfPseudonode(int routerID, Ip4Address drInterface) {
this.routerID = routerID;
this.drInterface = drInterface;
}
......@@ -51,8 +50,8 @@ public class OSPFPseudonode implements IGPRouterID, BgpValueType {
* @param drInterface IPv4 address of the DR's interface
* @return object of OSPFPseudonode
*/
public static OSPFPseudonode of(final int routerID, final Ip4Address drInterface) {
return new OSPFPseudonode(routerID, drInterface);
public static OspfPseudonode of(final int routerID, final Ip4Address drInterface) {
return new OspfPseudonode(routerID, drInterface);
}
/**
......@@ -74,8 +73,8 @@ public class OSPFPseudonode implements IGPRouterID, BgpValueType {
if (this == obj) {
return true;
}
if (obj instanceof OSPFPseudonode) {
OSPFPseudonode other = (OSPFPseudonode) obj;
if (obj instanceof OspfPseudonode) {
OspfPseudonode other = (OspfPseudonode) obj;
return Objects.equals(routerID, other.routerID) && Objects.equals(drInterface, other.drInterface);
}
return false;
......@@ -97,10 +96,10 @@ public class OSPFPseudonode implements IGPRouterID, BgpValueType {
* @param cb ChannelBuffer
* @return object of OSPFPseudonode
*/
public static OSPFPseudonode read(ChannelBuffer cb) {
public static OspfPseudonode read(ChannelBuffer cb) {
int routerID = cb.readInt();
Ip4Address drInterface = Ip4Address.valueOf(cb.readInt());
return OSPFPseudonode.of(routerID, drInterface);
return OspfPseudonode.of(routerID, drInterface);
}
@Override
......@@ -113,9 +112,9 @@ public class OSPFPseudonode implements IGPRouterID, BgpValueType {
if (this.equals(o)) {
return 0;
}
int result = ((Integer) (this.routerID)).compareTo((Integer) (((OSPFPseudonode) o).routerID));
int result = ((Integer) (this.routerID)).compareTo((Integer) (((OspfPseudonode) o).routerID));
if (result != 0) {
return this.drInterface.compareTo(((OSPFPseudonode) o).drInterface);
return this.drInterface.compareTo(((OspfPseudonode) o).drInterface);
}
return result;
}
......
......@@ -25,7 +25,7 @@ import com.google.common.base.MoreObjects;
/**
* Provides OSPF Route Type Tlv which contains route type.
*/
public class OSPFRouteTypeTlv implements BgpValueType {
public class OspfRouteTypeTlv implements BgpValueType {
/* Reference :draft-ietf-idr-ls-distribution-11
0 1 2 3
......@@ -69,7 +69,7 @@ public class OSPFRouteTypeTlv implements BgpValueType {
*
* @param routeType Route type
*/
public OSPFRouteTypeTlv(byte routeType) {
public OspfRouteTypeTlv(byte routeType) {
this.routeType = routeType;
}
......@@ -79,8 +79,8 @@ public class OSPFRouteTypeTlv implements BgpValueType {
* @param routeType Route type
* @return object of OSPFRouteTypeTlv
*/
public static OSPFRouteTypeTlv of(final byte routeType) {
return new OSPFRouteTypeTlv(routeType);
public static OspfRouteTypeTlv of(final byte routeType) {
return new OspfRouteTypeTlv(routeType);
}
/**
......@@ -118,8 +118,8 @@ public class OSPFRouteTypeTlv implements BgpValueType {
if (this == obj) {
return true;
}
if (obj instanceof OSPFRouteTypeTlv) {
OSPFRouteTypeTlv other = (OSPFRouteTypeTlv) obj;
if (obj instanceof OspfRouteTypeTlv) {
OspfRouteTypeTlv other = (OspfRouteTypeTlv) obj;
return Objects.equals(routeType, other.routeType);
}
return false;
......@@ -140,8 +140,8 @@ public class OSPFRouteTypeTlv implements BgpValueType {
* @param cb channelBuffer
* @return object of OSPFRouteTypeTlv
*/
public static OSPFRouteTypeTlv read(ChannelBuffer cb) {
return OSPFRouteTypeTlv.of(cb.readByte());
public static OspfRouteTypeTlv read(ChannelBuffer cb) {
return OspfRouteTypeTlv.of(cb.readByte());
}
@Override
......@@ -154,7 +154,7 @@ public class OSPFRouteTypeTlv implements BgpValueType {
if (this.equals(o)) {
return 0;
}
return ((Byte) (this.routeType)).compareTo((Byte) (((OSPFRouteTypeTlv) o).routeType));
return ((Byte) (this.routeType)).compareTo((Byte) (((OspfRouteTypeTlv) o).routeType));
}
@Override
......
......@@ -15,8 +15,7 @@
*/
package org.onosproject.bgpio.types.attr;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.types.BgpErrorType;
......@@ -25,7 +24,7 @@ import org.onosproject.bgpio.util.Validation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import java.util.Objects;
/**
* Implements BGP prefix IGP Flag attribute.
......@@ -55,15 +54,15 @@ public final class BgpPrefixAttrIgpFlags implements BgpValueType {
* @param bisisUpDownBit IS-IS Up/Down Bit
* @param bOspfNoUnicastBit OSPF no unicast Bit
* @param bOspfLclAddrBit OSPF local address Bit
* @param bOspfNSSABit OSPF propagate NSSA Bit
* @param bOspfNssaBit OSPF propagate NSSA Bit
*/
public BgpPrefixAttrIgpFlags(boolean bisisUpDownBit,
boolean bOspfNoUnicastBit,
boolean bOspfLclAddrBit, boolean bOspfNSSABit) {
boolean bOspfLclAddrBit, boolean bOspfNssaBit) {
this.bisisUpDownBit = bisisUpDownBit;
this.bOspfNoUnicastBit = bOspfNoUnicastBit;
this.bOspfLclAddrBit = bOspfLclAddrBit;
this.bOspfNSSABit = bOspfNSSABit;
this.bOspfNSSABit = bOspfNssaBit;
}
/**
......@@ -72,15 +71,15 @@ public final class BgpPrefixAttrIgpFlags implements BgpValueType {
* @param bisisUpDownBit IS-IS Up/Down Bit
* @param bOspfNoUnicastBit OSPF no unicast Bit
* @param bOspfLclAddrBit OSPF local address Bit
* @param bOspfNSSABit OSPF propagate NSSA Bit
* @param bOspfNssaBit OSPF propagate NSSA Bit
* @return object of BgpPrefixAttrIGPFlags
*/
public static BgpPrefixAttrIgpFlags of(final boolean bisisUpDownBit,
final boolean bOspfNoUnicastBit,
final boolean bOspfLclAddrBit,
final boolean bOspfNSSABit) {
final boolean bOspfNssaBit) {
return new BgpPrefixAttrIgpFlags(bisisUpDownBit, bOspfNoUnicastBit,
bOspfLclAddrBit, bOspfNSSABit);
bOspfLclAddrBit, bOspfNssaBit);
}
/**
......@@ -95,7 +94,7 @@ public final class BgpPrefixAttrIgpFlags implements BgpValueType {
boolean bisisUpDownBit = false;
boolean bOspfNoUnicastBit = false;
boolean bOspfLclAddrBit = false;
boolean bOspfNSSABit = false;
boolean bOspfNssaBit = false;
short lsAttrLength = cb.readShort();
......@@ -111,10 +110,10 @@ public final class BgpPrefixAttrIgpFlags implements BgpValueType {
bisisUpDownBit = ((nodeFlagBits & FIRST_BIT) == FIRST_BIT);
bOspfNoUnicastBit = ((nodeFlagBits & SECOND_BIT) == SECOND_BIT);
bOspfLclAddrBit = ((nodeFlagBits & THIRD_BIT) == THIRD_BIT);
bOspfNSSABit = ((nodeFlagBits & FOURTH_BIT) == FOURTH_BIT);
bOspfNssaBit = ((nodeFlagBits & FOURTH_BIT) == FOURTH_BIT);
return BgpPrefixAttrIgpFlags.of(bisisUpDownBit, bOspfNoUnicastBit,
bOspfLclAddrBit, bOspfNSSABit);
bOspfLclAddrBit, bOspfNssaBit);
}
/**
......@@ -149,7 +148,7 @@ public final class BgpPrefixAttrIgpFlags implements BgpValueType {
*
* @return OSPF propagate NSSA Bit set or not
*/
public boolean ospfNSSABit() {
public boolean ospfNssaBit() {
return bOspfNSSABit;
}
......
......@@ -35,7 +35,7 @@ import org.onosproject.bgpio.types.LinkStateAttributes;
import org.onosproject.bgpio.types.Med;
import org.onosproject.bgpio.types.MpReachNlri;
import org.onosproject.bgpio.types.Origin;
import org.onosproject.bgpio.types.Origin.ORIGINTYPE;
import org.onosproject.bgpio.types.Origin.OriginType;
import org.onosproject.bgpio.types.attr.BgpAttrNodeFlagBitTlv;
import org.onosproject.bgpio.types.attr.BgpAttrNodeIsIsAreaId;
import org.onosproject.bgpio.types.attr.BgpAttrNodeMultiTopologyId;
......@@ -132,7 +132,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
//compare Origin
testPathAttribute = listIterator.next();
......@@ -250,7 +250,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -363,7 +363,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -477,7 +477,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -594,7 +594,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -713,7 +713,7 @@ public class BgpUpdateLinkStateAttrTest {
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -827,7 +827,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -945,7 +945,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1063,7 +1063,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1175,7 +1175,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1288,7 +1288,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1400,7 +1400,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1513,7 +1513,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1626,7 +1626,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1739,7 +1739,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1840,7 +1840,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......@@ -1935,7 +1935,7 @@ public class BgpUpdateLinkStateAttrTest {
BgpPathAttributes pathAttribute = other.bgpPathAttributes();
pathAttributeList = pathAttribute.pathAttributes();
ListIterator<BgpValueType> listIterator = pathAttributeList.listIterator();
ORIGINTYPE originValue = org.onosproject.bgpio.types.Origin.ORIGINTYPE.IGP;
OriginType originValue = OriginType.IGP;
testPathAttribute = listIterator.next();
origin = (Origin) testPathAttribute;
......
......@@ -28,9 +28,9 @@ public class OspfPseudonodeTest {
private final int value2 = 0xc3223406;
private final Ip4Address drInterface1 = Ip4Address.valueOf(0xaf91e01);
private final Ip4Address drInterface2 = Ip4Address.valueOf(0xaf91e02);
private final OSPFPseudonode tlv1 = OSPFPseudonode.of(value1, drInterface1);
private final OSPFPseudonode sameAsTlv1 = OSPFPseudonode.of(value1, drInterface1);
private final OSPFPseudonode tlv2 = OSPFPseudonode.of(value2, drInterface2);
private final OspfPseudonode tlv1 = OspfPseudonode.of(value1, drInterface1);
private final OspfPseudonode sameAsTlv1 = OspfPseudonode.of(value1, drInterface1);
private final OspfPseudonode tlv2 = OspfPseudonode.of(value2, drInterface2);
@Test
public void testEquality() {
......
......@@ -25,9 +25,9 @@ import com.google.common.testing.EqualsTester;
public class OspfRouteTypeTest {
private final byte value1 = 5;
private final byte value2 = 4;
private final OSPFRouteTypeTlv tlv1 = OSPFRouteTypeTlv.of(value1);
private final OSPFRouteTypeTlv sameAsTlv1 = OSPFRouteTypeTlv.of(value1);
private final OSPFRouteTypeTlv tlv2 = OSPFRouteTypeTlv.of(value2);
private final OspfRouteTypeTlv tlv1 = OspfRouteTypeTlv.of(value1);
private final OspfRouteTypeTlv sameAsTlv1 = OspfRouteTypeTlv.of(value1);
private final OspfRouteTypeTlv tlv2 = OspfRouteTypeTlv.of(value2);
@Test
public void testEquality() {
......
......@@ -16,18 +16,6 @@
package org.onosproject.bgp.controller.impl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.UnknownHostException;
import java.nio.channels.ClosedChannelException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.concurrent.RejectedExecutionException;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
......@@ -59,6 +47,18 @@ import org.onosproject.bgpio.types.MultiProtocolExtnCapabilityTlv;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.UnknownHostException;
import java.nio.channels.ClosedChannelException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.concurrent.RejectedExecutionException;
/**
* Channel handler deals with the bgp peer connection and dispatches messages from peer to the appropriate locations.
*/
......@@ -95,7 +95,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
// proceeds to cleaup peer state - we need to ensure that it does not
// cleanup
// peer state for the older (still connected) peer
private volatile Boolean duplicateBGPIdFound;
private volatile Boolean duplicateBgpIdFound;
// Indicates the bgp version used by this bgp peer
protected BgpVersion bgpVersion;
private BgpController bgpController;
......@@ -119,7 +119,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
this.peerManager = (BgpPeerManagerImpl) bgpController.peerManager();
this.state = ChannelState.IDLE;
this.factory4 = Controller.getBgpMessageFactory4();
this.duplicateBGPIdFound = Boolean.FALSE;
this.duplicateBgpIdFound = Boolean.FALSE;
this.bgpPacketStats = new BgpPacketStatsImpl();
this.bgpconfig = bgpController.getConfig();
}
......@@ -344,7 +344,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
protected void disconnectDuplicate(BgpChannelHandler h) {
log.error("Duplicated BGP IP or incompleted cleanup - " + "" + "disconnecting channel {}",
h.getPeerInfoString());
h.duplicateBGPIdFound = Boolean.TRUE;
h.duplicateBgpIdFound = Boolean.TRUE;
h.channel.disconnect();
}
......@@ -438,7 +438,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
peerAddr = IpAddress.valueOf(inetAddress.getAddress()).toString();
if (thisbgpId != null) {
if (!duplicateBGPIdFound) {
if (!duplicateBgpIdFound) {
// if the disconnected peer (on this ChannelHandler)
// was not one with a duplicate, it is safe to remove all
// state for it at the controller. Notice that if the disconnected
......@@ -449,7 +449,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
if (bgpPeer != null) {
BgpPeerImpl peer = (BgpPeerImpl) bgpPeer;
peerManager.removeConnectedPeer(thisbgpId);
peer.updateLocalRIBOnPeerDisconnect();
peer.updateLocalRibOnPeerDisconnect();
}
// Retry connection if connection is lost to bgp speaker/peer
......@@ -475,7 +475,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
// this is the same peer reconnecting, but the original state was
// not cleaned up - XXX check liveness of original ChannelHandler
log.debug("{}:duplicate found", getPeerInfoString());
duplicateBGPIdFound = Boolean.FALSE;
duplicateBgpIdFound = Boolean.FALSE;
}
stopKeepAliveTimer();
......@@ -610,7 +610,7 @@ class BgpChannelHandler extends IdleStateAwareChannelHandler {
*/
private void dispatchMessage(BgpMessage m) throws BgpParseException {
bgpPacketStats.addInPacket();
bgpController.processBGPPacket(thisbgpId, m);
bgpController.processBgpPacket(thisbgpId, m);
}
/**
......
......@@ -16,14 +16,6 @@
package org.onosproject.bgp.controller.impl;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
......@@ -32,8 +24,8 @@ import org.onosproject.bgp.controller.BgpCfg;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.bgp.controller.BgpId;
import org.onosproject.bgp.controller.BgpLocalRib;
import org.onosproject.bgp.controller.BgpPeer;
import org.onosproject.bgp.controller.BgpNodeListener;
import org.onosproject.bgp.controller.BgpPeer;
import org.onosproject.bgp.controller.BgpPeerManager;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.BgpMessage;
......@@ -44,6 +36,14 @@ import org.onosproject.bgpio.types.MpUnReachNlri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@Component(immediate = true)
@Service
public class BgpControllerImpl implements BgpController {
......@@ -54,8 +54,8 @@ public class BgpControllerImpl implements BgpController {
protected BgpPeerManagerImpl peerManager = new BgpPeerManagerImpl();
private BgpLocalRib bgplocalRIB = new BgpLocalRibImpl(this);
private BgpLocalRib bgplocalRIBVpn = new BgpLocalRibImpl(this);
private BgpLocalRib bgplocalRib = new BgpLocalRibImpl(this);
private BgpLocalRib bgplocalRibVpn = new BgpLocalRibImpl(this);
protected Set<BgpNodeListener> bgpNodeListener = new CopyOnWriteArraySet<>();
......@@ -108,7 +108,7 @@ public class BgpControllerImpl implements BgpController {
}
@Override
public void processBGPPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException {
public void processBgpPacket(BgpId bgpId, BgpMessage msg) throws BgpParseException {
BgpPeer peer = getPeer(bgpId);
......@@ -251,7 +251,7 @@ public class BgpControllerImpl implements BgpController {
*/
@Override
public BgpLocalRib bgpLocalRib() {
return bgplocalRIB;
return bgplocalRib;
}
/**
......@@ -261,6 +261,6 @@ public class BgpControllerImpl implements BgpController {
*/
@Override
public BgpLocalRib bgpLocalRibVpn() {
return bgplocalRIBVpn;
return bgplocalRibVpn;
}
}
......
......@@ -13,10 +13,7 @@
package org.onosproject.bgp.controller.impl;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import com.google.common.base.MoreObjects;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.bgp.controller.BgpId;
import org.onosproject.bgp.controller.BgpLocalRib;
......@@ -35,8 +32,11 @@ import org.onosproject.bgpio.types.RouteDistinguisher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.MoreObjects;
/**
* Implementation of local RIB.
......@@ -447,7 +447,7 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param o adjacency-in/VPN adjacency-in
*/
public void localRIBUpdateNode(Object o) {
public void localRibUpdateNode(Object o) {
if (o instanceof AdjRibIn) {
AdjRibIn adjRib = (AdjRibIn) o;
......@@ -488,7 +488,7 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param o adjacency-in/VPN adjacency-in
*/
public void localRIBUpdateLink(Object o) {
public void localRibUpdateLink(Object o) {
if (o instanceof AdjRibIn) {
AdjRibIn adjRib = (AdjRibIn) o;
......@@ -529,7 +529,7 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param o instance of adjacency-in/VPN adjacency-in
*/
public void localRIBUpdatePrefix(Object o) {
public void localRibUpdatePrefix(Object o) {
if (o instanceof AdjRibIn) {
AdjRibIn adjRib = (AdjRibIn) o;
......@@ -573,12 +573,12 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param adjRibIn adjacency RIB-in
*/
public void localRIBUpdate(AdjRibIn adjRibIn) {
public void localRibUpdate(AdjRibIn adjRibIn) {
log.debug("Update local RIB.");
localRIBUpdateNode(adjRibIn);
localRIBUpdateLink(adjRibIn);
localRIBUpdatePrefix(adjRibIn);
localRibUpdateNode(adjRibIn);
localRibUpdateLink(adjRibIn);
localRibUpdatePrefix(adjRibIn);
}
/**
......@@ -586,12 +586,12 @@ public class BgpLocalRibImpl implements BgpLocalRib {
*
* @param vpnAdjRibIn VPN adjacency RIB-in
*/
public void localRIBUpdate(VpnAdjRibIn vpnAdjRibIn) {
public void localRibUpdate(VpnAdjRibIn vpnAdjRibIn) {
log.debug("Update VPN local RIB.");
localRIBUpdateNode(vpnAdjRibIn);
localRIBUpdateLink(vpnAdjRibIn);
localRIBUpdatePrefix(vpnAdjRibIn);
localRibUpdateNode(vpnAdjRibIn);
localRibUpdateLink(vpnAdjRibIn);
localRibUpdatePrefix(vpnAdjRibIn);
}
@Override
......
......@@ -16,27 +16,21 @@
package org.onosproject.bgp.controller.impl;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
import java.util.concurrent.RejectedExecutionException;
import com.google.common.base.MoreObjects;
import org.jboss.netty.channel.Channel;
import org.onlab.packet.IpAddress;
import org.onosproject.bgp.controller.BgpController;
import org.onosproject.bgp.controller.BgpLocalRib;
import org.onosproject.bgp.controller.BgpPeer;
import org.onosproject.bgp.controller.BgpSessionInfo;
import org.onosproject.bgp.controller.BgpLocalRib;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.protocol.BgpFactories;
import org.onosproject.bgpio.protocol.BgpFactory;
import org.onosproject.bgpio.protocol.BgpLSNlri;
import org.onosproject.bgpio.protocol.BgpMessage;
import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.BgpNodeLSNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.BgpPrefixIPv4LSNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.BgpLinkLsNlriVer4;
import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetails;
import org.onosproject.bgpio.types.BgpValueType;
import org.onosproject.bgpio.types.MpReachNlri;
......@@ -44,7 +38,12 @@ import org.onosproject.bgpio.types.MpUnReachNlri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
import java.util.concurrent.RejectedExecutionException;
/**
* BGPPeerImpl implements BGPPeer, maintains peer information and store updates in RIB .
......@@ -62,8 +61,8 @@ public class BgpPeerImpl implements BgpPeer {
protected boolean isHandShakeComplete = false;
private BgpSessionInfo sessionInfo;
private BgpPacketStatsImpl pktStats;
private BgpLocalRib bgplocalRIB;
private BgpLocalRib bgplocalRIBVpn;
private BgpLocalRib bgplocalRib;
private BgpLocalRib bgplocalRibVpn;
private AdjRibIn adjRib;
private VpnAdjRibIn vpnAdjRib;
......@@ -101,8 +100,8 @@ public class BgpPeerImpl implements BgpPeer {
this.bgpController = bgpController;
this.sessionInfo = sessionInfo;
this.pktStats = pktStats;
this.bgplocalRIB = bgpController.bgpLocalRib();
this.bgplocalRIBVpn = bgpController.bgpLocalRibVpn();
this.bgplocalRib = bgpController.bgpLocalRib();
this.bgplocalRibVpn = bgpController.bgpLocalRibVpn();
this.adjRib = new AdjRibIn();
this.vpnAdjRib = new VpnAdjRibIn();
}
......@@ -141,30 +140,30 @@ public class BgpPeerImpl implements BgpPeer {
PathAttrNlriDetails details = setPathAttrDetails(nlriInfo, pathAttr);
if (!((BgpNodeLSNlriVer4) nlriInfo).isVpnPresent()) {
adjRib.add(nlriInfo, details);
bgplocalRIB.add(sessionInfo(), nlriInfo, details);
bgplocalRib.add(sessionInfo(), nlriInfo, details);
} else {
vpnAdjRib.addVpn(nlriInfo, details, ((BgpNodeLSNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRIBVpn.add(sessionInfo(), nlriInfo, details,
bgplocalRibVpn.add(sessionInfo(), nlriInfo, details,
((BgpNodeLSNlriVer4) nlriInfo).getRouteDistinguisher());
}
} else if (nlriInfo instanceof BgpLinkLsNlriVer4) {
PathAttrNlriDetails details = setPathAttrDetails(nlriInfo, pathAttr);
if (!((BgpLinkLsNlriVer4) nlriInfo).isVpnPresent()) {
adjRib.add(nlriInfo, details);
bgplocalRIB.add(sessionInfo(), nlriInfo, details);
bgplocalRib.add(sessionInfo(), nlriInfo, details);
} else {
vpnAdjRib.addVpn(nlriInfo, details, ((BgpLinkLsNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRIBVpn.add(sessionInfo(), nlriInfo, details,
bgplocalRibVpn.add(sessionInfo(), nlriInfo, details,
((BgpLinkLsNlriVer4) nlriInfo).getRouteDistinguisher());
}
} else if (nlriInfo instanceof BgpPrefixIPv4LSNlriVer4) {
PathAttrNlriDetails details = setPathAttrDetails(nlriInfo, pathAttr);
if (!((BgpPrefixIPv4LSNlriVer4) nlriInfo).isVpnPresent()) {
adjRib.add(nlriInfo, details);
bgplocalRIB.add(sessionInfo(), nlriInfo, details);
bgplocalRib.add(sessionInfo(), nlriInfo, details);
} else {
vpnAdjRib.addVpn(nlriInfo, details, ((BgpPrefixIPv4LSNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRIBVpn.add(sessionInfo(), nlriInfo, details,
bgplocalRibVpn.add(sessionInfo(), nlriInfo, details,
((BgpPrefixIPv4LSNlriVer4) nlriInfo).getRouteDistinguisher());
}
}
......@@ -201,26 +200,26 @@ public class BgpPeerImpl implements BgpPeer {
if (nlriInfo instanceof BgpNodeLSNlriVer4) {
if (!((BgpNodeLSNlriVer4) nlriInfo).isVpnPresent()) {
adjRib.remove(nlriInfo);
bgplocalRIB.delete(nlriInfo);
bgplocalRib.delete(nlriInfo);
} else {
vpnAdjRib.removeVpn(nlriInfo, ((BgpNodeLSNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRIBVpn.delete(nlriInfo, ((BgpNodeLSNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRibVpn.delete(nlriInfo, ((BgpNodeLSNlriVer4) nlriInfo).getRouteDistinguisher());
}
} else if (nlriInfo instanceof BgpLinkLsNlriVer4) {
if (!((BgpLinkLsNlriVer4) nlriInfo).isVpnPresent()) {
adjRib.remove(nlriInfo);
bgplocalRIB.delete(nlriInfo);
bgplocalRib.delete(nlriInfo);
} else {
vpnAdjRib.removeVpn(nlriInfo, ((BgpLinkLsNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRIBVpn.delete(nlriInfo, ((BgpLinkLsNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRibVpn.delete(nlriInfo, ((BgpLinkLsNlriVer4) nlriInfo).getRouteDistinguisher());
}
} else if (nlriInfo instanceof BgpPrefixIPv4LSNlriVer4) {
if (!((BgpPrefixIPv4LSNlriVer4) nlriInfo).isVpnPresent()) {
adjRib.remove(nlriInfo);
bgplocalRIB.delete(nlriInfo);
bgplocalRib.delete(nlriInfo);
} else {
vpnAdjRib.removeVpn(nlriInfo, ((BgpPrefixIPv4LSNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRIBVpn.delete(nlriInfo, ((BgpPrefixIPv4LSNlriVer4) nlriInfo).getRouteDistinguisher());
bgplocalRibVpn.delete(nlriInfo, ((BgpPrefixIPv4LSNlriVer4) nlriInfo).getRouteDistinguisher());
}
}
}
......@@ -248,12 +247,12 @@ public class BgpPeerImpl implements BgpPeer {
* Update localRIB on peer disconnect.
*
*/
public void updateLocalRIBOnPeerDisconnect() {
BgpLocalRibImpl localRib = (BgpLocalRibImpl) bgplocalRIB;
BgpLocalRibImpl localRibVpn = (BgpLocalRibImpl) bgplocalRIBVpn;
public void updateLocalRibOnPeerDisconnect() {
BgpLocalRibImpl localRib = (BgpLocalRibImpl) bgplocalRib;
BgpLocalRibImpl localRibVpn = (BgpLocalRibImpl) bgplocalRibVpn;
localRib.localRIBUpdate(adjacencyRib());
localRibVpn.localRIBUpdate(vpnAdjacencyRib());
localRib.localRibUpdate(adjacencyRib());
localRibVpn.localRibUpdate(vpnAdjacencyRib());
}
// ************************
......
......@@ -15,20 +15,20 @@
*/
package org.onosproject.bgp.controller.impl;
import java.util.Comparator;
import java.util.List;
import java.util.ListIterator;
import org.onosproject.bgpio.protocol.linkstate.PathAttrNlriDetailsLocalRib;
import org.onosproject.bgpio.types.AsPath;
import org.onosproject.bgpio.types.BgpValueType;
import org.onosproject.bgpio.types.LocalPref;
import org.onosproject.bgpio.types.Med;
import org.onosproject.bgpio.types.Origin;
import org.onosproject.bgpio.types.Origin.ORIGINTYPE;
import org.onosproject.bgpio.types.Origin.OriginType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Comparator;
import java.util.List;
import java.util.ListIterator;
/**
* Implementation of BGP best path Selection process.
*/
......@@ -122,13 +122,13 @@ public final class BgpSelectionAlgo implements Comparator<PathAttrNlriDetailsLoc
* @return object with lowest origin value
*/
int compareOrigin(Origin obj1Origin, Origin obj2Origin) {
if (obj1Origin.origin() == ORIGINTYPE.IGP) {
if (obj1Origin.origin() == OriginType.IGP) {
return 1;
}
if (obj2Origin.origin() == ORIGINTYPE.IGP) {
if (obj2Origin.origin() == OriginType.IGP) {
return -1;
}
if (obj1Origin.origin() == ORIGINTYPE.EGP) {
if (obj1Origin.origin() == OriginType.EGP) {
return 1;
} else {
return -1;
......
......@@ -20,11 +20,11 @@ import com.google.common.util.concurrent.ListenableFuture;
import org.onlab.packet.IpAddress;
import org.onosproject.net.DeviceId;
import org.onosproject.net.behaviour.ControllerInfo;
import org.onosproject.ovsdb.rfc.jsonrpc.OvsdbRPC;
import org.onosproject.ovsdb.rfc.jsonrpc.OvsdbRpc;
import org.onosproject.ovsdb.rfc.message.OperationResult;
import org.onosproject.ovsdb.rfc.message.TableUpdates;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.operations.Operation;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
......@@ -35,7 +35,7 @@ import java.util.Set;
/**
* Represents to provider facing side of a node.
*/
public interface OvsdbClientService extends OvsdbRPC {
public interface OvsdbClientService extends OvsdbRpc {
/**
* Gets the node identifier.
*
......@@ -136,7 +136,7 @@ public interface OvsdbClientService extends OvsdbRPC {
* @param bridgeUuid bridge uuid
* @param controllers list of controllers
*/
void setControllersWithUUID(UUID bridgeUuid, List<ControllerInfo> controllers);
void setControllersWithUuid(Uuid bridgeUuid, List<ControllerInfo> controllers);
/**
* Sets the Controllers for the specified device.
......
......@@ -30,7 +30,7 @@ import org.onosproject.ovsdb.controller.OvsdbTunnel;
import org.onosproject.ovsdb.rfc.message.OperationResult;
import org.onosproject.ovsdb.rfc.message.TableUpdates;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.operations.Operation;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
......@@ -94,7 +94,7 @@ public class OvsdbClientServiceAdapter implements OvsdbClientService {
}
@Override
public void setControllersWithUUID(UUID bridgeUuid, List<ControllerInfo> controllers) {
public void setControllersWithUuid(Uuid bridgeUuid, List<ControllerInfo> controllers) {
}
......
......@@ -47,7 +47,7 @@ import org.onosproject.ovsdb.rfc.message.UpdateNotification;
import org.onosproject.ovsdb.rfc.notation.OvsdbMap;
import org.onosproject.ovsdb.rfc.notation.OvsdbSet;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.table.Bridge;
import org.onosproject.ovsdb.rfc.table.Interface;
......@@ -221,7 +221,7 @@ public class OvsdbControllerImpl implements OvsdbController {
for (String tableName : updates.result().keySet()) {
TableUpdate update = updates.result().get(tableName);
for (UUID uuid : (Set<UUID>) update.rows().keySet()) {
for (Uuid uuid : (Set<Uuid>) update.rows().keySet()) {
log.debug("Begin to process table updates uuid: {}, databaseName: {}, tableName: {}",
uuid.value(), dbName, tableName);
......
......@@ -15,18 +15,17 @@
*/
package org.onosproject.ovsdb.rfc.jsonrpc;
import java.util.List;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.util.concurrent.ListenableFuture;
import org.onosproject.ovsdb.rfc.operations.Operation;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.List;
/**
* The following interface describe the RPC7047's methods that are supported.
*/
public interface OvsdbRPC {
public interface OvsdbRpc {
/**
* This operation retrieves a database-schema that describes hosted database
......
......@@ -20,7 +20,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -30,7 +30,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public final class OperationResult {
private int count;
private UUID uuid;
private Uuid uuid;
private List<Row> rows;
private String error;
private String details;
......@@ -59,7 +59,7 @@ public final class OperationResult {
* @param error error message
* @param details details of error message
*/
public OperationResult(int count, UUID uuid, List<Row> rows, String error,
public OperationResult(int count, Uuid uuid, List<Row> rows, String error,
String details) {
checkNotNull(uuid, "uuid cannot be null");
checkNotNull(rows, "rows cannot be null");
......@@ -92,7 +92,7 @@ public final class OperationResult {
* Return uuid.
* @return uuid
*/
public UUID getUuid() {
public Uuid getUuid() {
return uuid;
}
......@@ -100,7 +100,7 @@ public final class OperationResult {
* Set uuid value.
* @param uuid the Operation message of uuid
*/
public void setUuid(UUID uuid) {
public void setUuid(Uuid uuid) {
checkNotNull(uuid, "uuid cannot be null");
this.uuid = uuid;
}
......
......@@ -21,7 +21,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Objects;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
/**
* A TableUpdate is an object that maps from the row's UUID to a RowUpdate object.
......@@ -29,7 +29,7 @@ import org.onosproject.ovsdb.rfc.notation.UUID;
* Refer to RFC 7047 Section 4.1.6.
*/
public final class RowUpdate {
private final UUID uuid;
private final Uuid uuid;
private final Row oldRow;
private final Row newRow;
......@@ -39,7 +39,7 @@ public final class RowUpdate {
* @param oldRow present for "delete" and "modify" updates
* @param newRow present for "initial", "insert", and "modify" updates
*/
public RowUpdate(UUID uuid, Row oldRow, Row newRow) {
public RowUpdate(Uuid uuid, Row oldRow, Row newRow) {
checkNotNull(uuid, "uuid cannot be null");
this.uuid = uuid;
this.oldRow = oldRow;
......@@ -50,7 +50,7 @@ public final class RowUpdate {
* Return uuid.
* @return uuid
*/
public UUID uuid() {
public Uuid uuid() {
return this.uuid;
}
......
......@@ -22,20 +22,20 @@ import java.util.Map;
import java.util.Objects;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
/**
* TableUpdate is an object that maps from the row's UUID to a RowUpdate object.
*/
public final class TableUpdate {
private final Map<UUID, RowUpdate> rows;
private final Map<Uuid, RowUpdate> rows;
/**
* Constructs a TableUpdate object.
* @param rows the parameter of TableUpdate entity
*/
private TableUpdate(Map<UUID, RowUpdate> rows) {
private TableUpdate(Map<Uuid, RowUpdate> rows) {
this.rows = rows;
}
......@@ -44,7 +44,7 @@ public final class TableUpdate {
* @param rows the parameter of TableUpdate entity
* @return TableUpdate entity
*/
public static TableUpdate tableUpdate(Map<UUID, RowUpdate> rows) {
public static TableUpdate tableUpdate(Map<Uuid, RowUpdate> rows) {
checkNotNull(rows, "rows cannot be null");
return new TableUpdate(rows);
}
......@@ -54,7 +54,7 @@ public final class TableUpdate {
* @param uuid the key of rows
* @return Row old row
*/
public Row getOld(UUID uuid) {
public Row getOld(Uuid uuid) {
RowUpdate rowUpdate = rows.get(uuid);
if (rowUpdate == null) {
return null;
......@@ -67,7 +67,7 @@ public final class TableUpdate {
* @param uuid the key of rows
* @return Row new row
*/
public Row getNew(UUID uuid) {
public Row getNew(Uuid uuid) {
RowUpdate rowUpdate = rows.get(uuid);
if (rowUpdate == null) {
return null;
......@@ -79,7 +79,7 @@ public final class TableUpdate {
* Return rows.
* @return rows
*/
public Map<UUID, RowUpdate> rows() {
public Map<Uuid, RowUpdate> rows() {
return rows;
}
......
......@@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
*/
public final class Row {
private String tableName;
private UUID uuid;
private Uuid uuid;
private Map<String, Column> columns;
/**
......@@ -59,7 +59,7 @@ public final class Row {
* @param columns Map of Column entity
* @param uuid UUID of the row
*/
public Row(String tableName, UUID uuid, Map<String, Column> columns) {
public Row(String tableName, Uuid uuid, Map<String, Column> columns) {
checkNotNull(tableName, "table name cannot be null");
checkNotNull(uuid, "uuid cannot be null");
checkNotNull(columns, "columns cannot be null");
......@@ -91,7 +91,7 @@ public final class Row {
*
* @return uuid
*/
public UUID uuid() {
public Uuid uuid() {
return uuid;
}
......@@ -100,7 +100,7 @@ public final class Row {
*
* @param uuid new uuid
*/
public void setUuid(UUID uuid) {
public void setUuid(Uuid uuid) {
this.uuid = uuid;
}
......
......@@ -20,8 +20,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Objects;
import org.onosproject.ovsdb.rfc.notation.json.UUIDConverter;
import org.onosproject.ovsdb.rfc.notation.json.UUIDSerializer;
import org.onosproject.ovsdb.rfc.notation.json.UuidConverter;
import org.onosproject.ovsdb.rfc.notation.json.UuidSerializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
......@@ -29,16 +29,16 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* Handles both uuid and named-uuid.
*/
@JsonSerialize(using = UUIDSerializer.class)
@JsonDeserialize(converter = UUIDConverter.class)
public final class UUID {
@JsonSerialize(using = UuidSerializer.class)
@JsonDeserialize(converter = UuidConverter.class)
public final class Uuid {
private final String value;
/**
* UUID constructor.
* @param value UUID value
*/
private UUID(String value) {
private Uuid(String value) {
checkNotNull(value, "value cannot be null");
this.value = value;
}
......@@ -48,8 +48,8 @@ public final class UUID {
* @param value UUID value
* @return UUID
*/
public static UUID uuid(String value) {
return new UUID(value);
public static Uuid uuid(String value) {
return new Uuid(value);
}
/**
......@@ -70,8 +70,8 @@ public final class UUID {
if (this == obj) {
return true;
}
if (obj instanceof UUID) {
final UUID other = (UUID) obj;
if (obj instanceof Uuid) {
final Uuid other = (Uuid) obj;
return Objects.equals(this.value, other.value);
}
return false;
......
......@@ -15,7 +15,7 @@
*/
package org.onosproject.ovsdb.rfc.notation.json;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.util.StdConverter;
......@@ -23,10 +23,10 @@ import com.fasterxml.jackson.databind.util.StdConverter;
/**
* UUIDConverter Converter.
*/
public class UUIDConverter extends StdConverter<JsonNode, UUID> {
public class UuidConverter extends StdConverter<JsonNode, Uuid> {
@Override
public UUID convert(JsonNode json) {
return UUID.uuid(json.get(1).asText());
public Uuid convert(JsonNode json) {
return Uuid.uuid(json.get(1).asText());
}
}
......
......@@ -15,20 +15,19 @@
*/
package org.onosproject.ovsdb.rfc.notation.json;
import java.io.IOException;
import org.onosproject.ovsdb.rfc.notation.UUID;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import java.io.IOException;
/**
* UUID Serializer.
*/
public class UUIDSerializer extends JsonSerializer<UUID> {
public class UuidSerializer extends JsonSerializer<Uuid> {
@Override
public void serialize(UUID value, JsonGenerator generator,
public void serialize(Uuid value, JsonGenerator generator,
SerializerProvider provider) throws IOException {
generator.writeStartArray();
String reg = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$";
......
......@@ -18,7 +18,7 @@ package org.onosproject.ovsdb.rfc.table;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.OvsdbSet;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
......@@ -212,7 +212,7 @@ public class Bridge extends AbstractOvsdbTableService {
* attributes.
* @param ports the column data which column name is "ports"
*/
public void setPorts(Set<UUID> ports) {
public void setPorts(Set<Uuid> ports) {
ColumnDescription columndesc = new ColumnDescription(
BridgeColumn.PORTS
.columnName(),
......@@ -240,7 +240,7 @@ public class Bridge extends AbstractOvsdbTableService {
* attributes.
* @param mirrors the column data which column name is "mirrors"
*/
public void setMirrors(Set<UUID> mirrors) {
public void setMirrors(Set<Uuid> mirrors) {
ColumnDescription columndesc = new ColumnDescription(
BridgeColumn.MIRRORS
.columnName(),
......@@ -268,7 +268,7 @@ public class Bridge extends AbstractOvsdbTableService {
* attributes.
* @param netflow the column data which column name is "netflow"
*/
public void setNetflow(Set<UUID> netflow) {
public void setNetflow(Set<Uuid> netflow) {
ColumnDescription columndesc = new ColumnDescription(
BridgeColumn.NETFLOW
.columnName(),
......@@ -296,7 +296,7 @@ public class Bridge extends AbstractOvsdbTableService {
* attributes.
* @param sflow the column data which column name is "sflow"
*/
public void setSflow(Set<UUID> sflow) {
public void setSflow(Set<Uuid> sflow) {
ColumnDescription columndesc = new ColumnDescription(
BridgeColumn.SFLOW
.columnName(),
......@@ -324,7 +324,7 @@ public class Bridge extends AbstractOvsdbTableService {
* attributes.
* @param ipfix the column data which column name is "ipfix"
*/
public void setIpfix(Set<UUID> ipfix) {
public void setIpfix(Set<Uuid> ipfix) {
ColumnDescription columndesc = new ColumnDescription(
BridgeColumn.IPFIX
.columnName(),
......@@ -548,7 +548,7 @@ public class Bridge extends AbstractOvsdbTableService {
* of attributes.
* @param flowTables the column data which column name is "flow_tables"
*/
public void setFlowTables(Map<Long, UUID> flowTables) {
public void setFlowTables(Map<Long, Uuid> flowTables) {
ColumnDescription columndesc = new ColumnDescription(
BridgeColumn.FLOWTABLES
.columnName(),
......
......@@ -19,7 +19,7 @@ import java.util.Map;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
......@@ -97,7 +97,7 @@ public class FlowSampleCollectorSet extends AbstractOvsdbTableService {
* attributes.
* @param bridge the column data which column name is "bridge"
*/
public void setBridge(UUID bridge) {
public void setBridge(Uuid bridge) {
ColumnDescription columndesc = new ColumnDescription(FlowSampleCollectorSetColumn.BRIDGE.columnName(),
"setBridge", VersionNum.VERSION710);
super.setDataHandler(columndesc, bridge);
......@@ -119,7 +119,7 @@ public class FlowSampleCollectorSet extends AbstractOvsdbTableService {
* attributes.
* @param ipfix the column data which column name is "ipfix"
*/
public void setIpfix(UUID ipfix) {
public void setIpfix(Uuid ipfix) {
ColumnDescription columndesc = new ColumnDescription(FlowSampleCollectorSetColumn.IPFIX.columnName(),
"setIpfix", VersionNum.VERSION710);
super.setDataHandler(columndesc, ipfix);
......
......@@ -20,7 +20,7 @@ import java.util.Set;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
......@@ -114,7 +114,7 @@ public class Mirror extends AbstractOvsdbTableService {
* @param selectSrcPort the column data which column name is
* "select_src_port"
*/
public void setSelectSrcPort(Set<UUID> selectSrcPort) {
public void setSelectSrcPort(Set<Uuid> selectSrcPort) {
ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTSRCPORT.columnName(),
"setSelectSrcPort", VersionNum.VERSION100);
super.setDataHandler(columndesc, selectSrcPort);
......@@ -137,7 +137,7 @@ public class Mirror extends AbstractOvsdbTableService {
* @param selectDstPrt the column data which column name is
* "select_dst_port"
*/
public void setSelectDstPort(Set<UUID> selectDstPrt) {
public void setSelectDstPort(Set<Uuid> selectDstPrt) {
ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTDSTPORT.columnName(),
"setSelectDstPort", VersionNum.VERSION100);
super.setDataHandler(columndesc, selectDstPrt);
......@@ -181,7 +181,7 @@ public class Mirror extends AbstractOvsdbTableService {
* of attributes.
* @param outputPort the column data which column name is "output_port"
*/
public void setOutputPort(Set<UUID> outputPort) {
public void setOutputPort(Set<Uuid> outputPort) {
ColumnDescription columndesc = new ColumnDescription(MirrorColumn.OUTPUTPORT.columnName(),
"setOutputPort", VersionNum.VERSION100);
super.setDataHandler(columndesc, outputPort);
......
......@@ -20,7 +20,7 @@ import java.util.Set;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
......@@ -85,7 +85,7 @@ public class OpenVSwitch extends AbstractOvsdbTableService {
* attributes.
* @param bridges the column data which column name is "bridges"
*/
public void setBridges(Set<UUID> bridges) {
public void setBridges(Set<Uuid> bridges) {
ColumnDescription columndesc = new ColumnDescription(
OpenVSwitchColumn.BRIDGES
.columnName(),
......@@ -114,7 +114,7 @@ public class OpenVSwitch extends AbstractOvsdbTableService {
* attributes.
* @param managers the column data which column name is "managers"
*/
public void setManagers(Set<UUID> managers) {
public void setManagers(Set<Uuid> managers) {
ColumnDescription columndesc = new ColumnDescription(
OpenVSwitchColumn.MANAGERS
.columnName(),
......@@ -144,7 +144,7 @@ public class OpenVSwitch extends AbstractOvsdbTableService {
* @param managerOptions the column data which column name is
* "manager_options"
*/
public void setManagerOptions(Set<UUID> managerOptions) {
public void setManagerOptions(Set<Uuid> managerOptions) {
ColumnDescription columndesc = new ColumnDescription(
OpenVSwitchColumn.MANAGEROPTIONS
.columnName(),
......@@ -172,7 +172,7 @@ public class OpenVSwitch extends AbstractOvsdbTableService {
* attributes.
* @param ssl the column data which column name is "ssl"
*/
public void setSsl(Set<UUID> ssl) {
public void setSsl(Set<Uuid> ssl) {
ColumnDescription columndesc = new ColumnDescription(
OpenVSwitchColumn.SSL
.columnName(),
......@@ -313,7 +313,7 @@ public class OpenVSwitch extends AbstractOvsdbTableService {
* of attributes.
* @param capabilities the column data which column name is "capabilities"
*/
public void setCapabilities(Map<String, UUID> capabilities) {
public void setCapabilities(Map<String, Uuid> capabilities) {
ColumnDescription columndesc = new ColumnDescription(
OpenVSwitchColumn.CAPABILITIES
.columnName(),
......
......@@ -20,7 +20,7 @@ import java.util.Set;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
......@@ -126,7 +126,7 @@ public class Port extends AbstractOvsdbTableService {
* of attributes.
* @param interfaces the column data which column name is "interfaces"
*/
public void setInterfaces(Set<UUID> interfaces) {
public void setInterfaces(Set<Uuid> interfaces) {
ColumnDescription columndesc = new ColumnDescription(
PortColumn.INTERFACES
.columnName(),
......@@ -238,7 +238,7 @@ public class Port extends AbstractOvsdbTableService {
* attributes.
* @param qos the column data which column name is "qos"
*/
public void setQos(Set<UUID> qos) {
public void setQos(Set<Uuid> qos) {
ColumnDescription columndesc = new ColumnDescription(
PortColumn.QOS
.columnName(),
......
......@@ -20,7 +20,7 @@ import java.util.Set;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
......@@ -75,7 +75,7 @@ public class Qos extends AbstractOvsdbTableService {
* attributes.
* @param queues the column data which column name is "queues"
*/
public void setQueues(Map<Long, UUID> queues) {
public void setQueues(Map<Long, Uuid> queues) {
ColumnDescription columndesc = new ColumnDescription(QosColumn.QUEUES.columnName(), "setQueues",
VersionNum.VERSION100);
super.setDataHandler(columndesc, queues);
......
......@@ -25,7 +25,7 @@ import org.onosproject.ovsdb.rfc.exception.TableSchemaNotFoundException;
import org.onosproject.ovsdb.rfc.exception.VersionMismatchException;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.ColumnSchema;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.schema.TableSchema;
......@@ -196,12 +196,12 @@ public abstract class AbstractOvsdbTableService implements OvsdbTableService {
}
@Override
public UUID getTableUuid() {
public Uuid getTableUuid() {
if (!isValid()) {
return null;
}
ColumnDescription columnDesc = new ColumnDescription("_uuid", "getTableUuid");
return (UUID) getDataHandler(columnDesc);
return (Uuid) getDataHandler(columnDesc);
}
@Override
......@@ -214,12 +214,12 @@ public abstract class AbstractOvsdbTableService implements OvsdbTableService {
}
@Override
public UUID getTableVersion() {
public Uuid getTableVersion() {
if (!isValid()) {
return null;
}
ColumnDescription columnDesc = new ColumnDescription("_version", "getTableVersion");
return (UUID) getDataHandler(columnDesc);
return (Uuid) getDataHandler(columnDesc);
}
@Override
......
......@@ -16,7 +16,7 @@
package org.onosproject.ovsdb.rfc.tableservice;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
/**
* Representation of conversion between Ovsdb table and Row.
......@@ -48,7 +48,7 @@ public interface OvsdbTableService {
* Returns UUID which column name is _uuid.
* @return UUID
*/
public UUID getTableUuid();
public Uuid getTableUuid();
/**
* Returns UUID Column which column name is _uuid.
......@@ -60,7 +60,7 @@ public interface OvsdbTableService {
* Returns UUID which column name is _version.
* @return UUID
*/
public UUID getTableVersion();
public Uuid getTableVersion();
/**
* Returns UUID Column which column name is _version.
......
......@@ -31,7 +31,7 @@ import org.onosproject.ovsdb.rfc.message.TableUpdates;
import org.onosproject.ovsdb.rfc.message.UpdateNotification;
import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.operations.Operation;
import org.onosproject.ovsdb.rfc.schema.ColumnSchema;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
......@@ -276,12 +276,12 @@ public final class FromJsonUtil {
* @return TableUpdate
*/
public static TableUpdate jsonNodeToTableUpdate(TableSchema tableSchema, JsonNode updateJson) {
Map<UUID, RowUpdate> rows = Maps.newHashMap();
Map<Uuid, RowUpdate> rows = Maps.newHashMap();
Iterator<Map.Entry<String, JsonNode>> tableUpdateItr = updateJson.fields();
while (tableUpdateItr.hasNext()) {
Map.Entry<String, JsonNode> oldNewRow = tableUpdateItr.next();
String uuidStr = oldNewRow.getKey();
UUID uuid = UUID.uuid(uuidStr);
Uuid uuid = Uuid.uuid(uuidStr);
JsonNode newR = oldNewRow.getValue().get("new");
JsonNode oldR = oldNewRow.getValue().get("old");
Row newRow = newR != null ? createRow(tableSchema, uuid, newR) : null;
......@@ -298,7 +298,7 @@ public final class FromJsonUtil {
* @param rowNode JsonNode
* @return Row
*/
private static Row createRow(TableSchema tableSchema, UUID uuid, JsonNode rowNode) {
private static Row createRow(TableSchema tableSchema, Uuid uuid, JsonNode rowNode) {
if (tableSchema == null) {
return null;
}
......
......@@ -21,7 +21,7 @@ import java.util.Set;
import org.onosproject.ovsdb.rfc.notation.OvsdbMap;
import org.onosproject.ovsdb.rfc.notation.OvsdbSet;
import org.onosproject.ovsdb.rfc.notation.RefTableRow;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.notation.Uuid;
import org.onosproject.ovsdb.rfc.schema.type.AtomicColumnType;
import org.onosproject.ovsdb.rfc.schema.type.BaseType;
import org.onosproject.ovsdb.rfc.schema.type.BooleanBaseType;
......@@ -160,7 +160,7 @@ public final class TransValueUtil {
if (valueNode.get(0).isTextual()
&& ("uuid".equals(valueNode.get(0).asText()) || "named-uuid"
.equals(valueNode.get(0).asText()))) {
return UUID.uuid(valueNode.get(1).asText());
return Uuid.uuid(valueNode.get(1).asText());
}
}
} else {
......
......@@ -145,10 +145,10 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
*/
public static class Builder implements PcInitiatedLspRequest.Builder {
private boolean bIsSRPObjectSet = false;
private boolean bIsLSPObjectSet = false;
private boolean bIsSrpObjectSet = false;
private boolean bIsLspObjectSet = false;
private boolean bIsEndPointsObjectSet = false;
private boolean bIsEROObjectSet = false;
private boolean bIsEroObjectSet = false;
private boolean bIsPcepAttributeSet = false;
private boolean bIsbRFlagSet = false;
......@@ -178,7 +178,7 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
PcepAttribute pcepAttribute = null;
boolean bRFlag = false;
if (!this.bIsSRPObjectSet) {
if (!this.bIsSrpObjectSet) {
throw new PcepParseException("Srp object NOT Set while building PcInitiatedLspRequest");
} else {
srpObject = this.srpObject;
......@@ -191,7 +191,7 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
this.bIsbRFlagSet = false;
}
if (!this.bIsLSPObjectSet) {
if (!this.bIsLspObjectSet) {
throw new PcepParseException("LSP Object NOT Set while building PcInitiatedLspRequest");
} else {
lspObject = this.lspObject;
......@@ -203,7 +203,7 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
} else {
endPointsObject = this.endPointsObject;
}
if (!this.bIsEROObjectSet) {
if (!this.bIsEroObjectSet) {
throw new PcepParseException("ERO Object NOT Set while building PcInitiatedLspRequest");
} else {
eroObject = this.eroObject;
......@@ -243,7 +243,7 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
@Override
public Builder setSrpObject(PcepSrpObject srpobj) {
this.srpObject = srpobj;
this.bIsSRPObjectSet = true;
this.bIsSrpObjectSet = true;
return this;
}
......@@ -251,7 +251,7 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
@Override
public Builder setLspObject(PcepLspObject lspObject) {
this.lspObject = lspObject;
this.bIsLSPObjectSet = true;
this.bIsLspObjectSet = true;
return this;
}
......@@ -265,7 +265,7 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
@Override
public Builder setEroObject(PcepEroObject eroObject) {
this.eroObject = eroObject;
this.bIsEROObjectSet = true;
this.bIsEroObjectSet = true;
return this;
}
......
......@@ -236,7 +236,7 @@ public class PcepLabelUpdateVer1 implements PcepLabelUpdate {
default:
throw new PcepParseException("Unkown FEC object type " + tempObjHeader.getObjType());
}
labelMap.setFECObject(fecObject);
labelMap.setFecObject(fecObject);
pceLabelUpdate.setLabelMap(labelMap);
} else {
throw new PcepParseException(
......@@ -308,7 +308,7 @@ public class PcepLabelUpdateVer1 implements PcepLabelUpdate {
} else {
labelObject.write(cb);
}
fecObject = labelMap.getFECObject();
fecObject = labelMap.getFecObject();
if (fecObject == null) {
throw new PcepParseException("fec Object is mandatory object for Label map.");
} else {
......
......@@ -121,7 +121,7 @@ public class PcepMsgPathVer1 implements PcepMsgPath {
*/
public static class Builder implements PcepMsgPath.Builder {
private boolean bIsEROObjectSet = false;
private boolean bIsEroObjectSet = false;
private boolean bIsPcepAttributeSet = false;
//PCEP ERO Object
......@@ -137,7 +137,7 @@ public class PcepMsgPathVer1 implements PcepMsgPath {
//PCEP Attribute list
PcepAttribute pcepAttribute = null;
if (!this.bIsEROObjectSet) {
if (!this.bIsEroObjectSet) {
throw new PcepParseException("ERO Object NOT Set while building PcepMsgPath.");
} else {
eroObject = this.eroObject;
......@@ -164,7 +164,7 @@ public class PcepMsgPathVer1 implements PcepMsgPath {
@Override
public Builder setEroObject(PcepEroObject eroObject) {
this.eroObject = eroObject;
this.bIsEROObjectSet = true;
this.bIsEroObjectSet = true;
return this;
}
......
......@@ -333,8 +333,8 @@ public class PcepStateReportVer1 implements PcepStateReport {
*/
public static class Builder implements PcepStateReport.Builder {
private boolean bIsSRPObjectSet = false;
private boolean bIsLSPObjectSet = false;
private boolean bIsSrpObjectSet = false;
private boolean bIsLspObjectSet = false;
private boolean bIsPcepMsgPathSet = false;
//PCEP SRP Object
......@@ -354,11 +354,11 @@ public class PcepStateReportVer1 implements PcepStateReport {
//PCEP Attribute list
PcepStateReport.PcepMsgPath msgPath = null;
if (this.bIsSRPObjectSet) {
if (this.bIsSrpObjectSet) {
srpObject = this.srpObject;
}
if (!this.bIsLSPObjectSet) {
if (!this.bIsLspObjectSet) {
throw new PcepParseException(" LSP Object NOT Set while building PcepStateReport.");
} else {
lspObject = this.lspObject;
......@@ -390,14 +390,14 @@ public class PcepStateReportVer1 implements PcepStateReport {
@Override
public Builder setSrpObject(PcepSrpObject srpobj) {
this.srpObject = srpobj;
this.bIsSRPObjectSet = true;
this.bIsSrpObjectSet = true;
return this;
}
@Override
public Builder setLspObject(PcepLspObject lspObject) {
this.lspObject = lspObject;
this.bIsLSPObjectSet = true;
this.bIsLspObjectSet = true;
return this;
}
......
......@@ -110,8 +110,8 @@ public class PcepUpdateRequestVer1 implements PcepUpdateRequest {
*/
public static class Builder implements PcepUpdateRequest.Builder {
private boolean bIsSRPObjectSet = false;
private boolean bIsLSPObjectSet = false;
private boolean bIsSrpObjectSet = false;
private boolean bIsLspObjectSet = false;
private boolean bIsPcepMsgPathSet = false;
//PCEP SRP Object
......@@ -131,12 +131,12 @@ public class PcepUpdateRequestVer1 implements PcepUpdateRequest {
//PCEP Attribute list
PcepMsgPath msgPath = null;
if (!this.bIsSRPObjectSet) {
if (!this.bIsSrpObjectSet) {
throw new PcepParseException(" SRP Object NOT Set while building PcepUpdateRequest.");
} else {
srpObject = this.srpObject;
}
if (!this.bIsLSPObjectSet) {
if (!this.bIsLspObjectSet) {
throw new PcepParseException(" LSP Object NOT Set while building PcepUpdateRequest.");
} else {
lspObject = this.lspObject;
......@@ -168,7 +168,7 @@ public class PcepUpdateRequestVer1 implements PcepUpdateRequest {
@Override
public Builder setSrpObject(PcepSrpObject srpobj) {
this.srpObject = srpobj;
this.bIsSRPObjectSet = true;
this.bIsSrpObjectSet = true;
return this;
}
......@@ -176,7 +176,7 @@ public class PcepUpdateRequestVer1 implements PcepUpdateRequest {
@Override
public Builder setLspObject(PcepLspObject lspObject) {
this.lspObject = lspObject;
this.bIsLSPObjectSet = true;
this.bIsLspObjectSet = true;
return this;
}
......
......@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
/**
* Provides BGP LS identifier which contains opaque value (32 Bit ID).
*/
public class BGPLSidentifierTlv implements PcepValueType {
public class BgpLsIdentifierTlv implements PcepValueType {
/* Reference :draft-ietf-idr-ls-distribution-10
* 0 1 2 3
......@@ -39,7 +39,7 @@ public class BGPLSidentifierTlv implements PcepValueType {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(BGPLSidentifierTlv.class);
protected static final Logger log = LoggerFactory.getLogger(BgpLsIdentifierTlv.class);
public static final short TYPE = 17; //TODD:change this TBD11
public static final short LENGTH = 4;
......@@ -51,7 +51,7 @@ public class BGPLSidentifierTlv implements PcepValueType {
*
* @param rawValue BGP LS identifier Tlv
*/
public BGPLSidentifierTlv(int rawValue) {
public BgpLsIdentifierTlv(int rawValue) {
this.rawValue = rawValue;
}
......@@ -61,8 +61,8 @@ public class BGPLSidentifierTlv implements PcepValueType {
* @param raw value
* @return object of BGPLSidentifierTlv
*/
public static BGPLSidentifierTlv of(final int raw) {
return new BGPLSidentifierTlv(raw);
public static BgpLsIdentifierTlv of(final int raw) {
return new BgpLsIdentifierTlv(raw);
}
/**
......@@ -99,8 +99,8 @@ public class BGPLSidentifierTlv implements PcepValueType {
if (this == obj) {
return true;
}
if (obj instanceof BGPLSidentifierTlv) {
BGPLSidentifierTlv other = (BGPLSidentifierTlv) obj;
if (obj instanceof BgpLsIdentifierTlv) {
BgpLsIdentifierTlv other = (BgpLsIdentifierTlv) obj;
return Objects.equals(rawValue, other.rawValue);
}
return false;
......@@ -121,8 +121,8 @@ public class BGPLSidentifierTlv implements PcepValueType {
* @param c input channel buffer
* @return object of BGP LS identifier Tlv
*/
public static BGPLSidentifierTlv read(ChannelBuffer c) {
return BGPLSidentifierTlv.of(c.readInt());
public static BgpLsIdentifierTlv read(ChannelBuffer c) {
return BgpLsIdentifierTlv.of(c.readInt());
}
@Override
......
......@@ -15,15 +15,14 @@
*/
package org.onosproject.pcepio.types;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Arrays;
/**
* Provides IPv6 Interface Address. REFERENCE :[RFC6119]/4.2.
......@@ -65,15 +64,15 @@ public class IPv6InterfaceAddressTlv implements PcepValueType {
*/
public static IPv6InterfaceAddressTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNONE = true;
boolean bFoundNone = true;
//value starts from 3rd byte.
for (int i = 2; i < 20; ++i) {
if (NONE_VAL[i] != raw[i]) {
bFoundNONE = false;
bFoundNone = false;
}
}
if (bFoundNONE) {
if (bFoundNone) {
return NONE;
}
......
......@@ -15,15 +15,14 @@
*/
package org.onosproject.pcepio.types;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Arrays;
/**
* Provides IPv6 Neighbor Address. Reference :[RFC6119]/4.3.
......@@ -63,15 +62,15 @@ public class IPv6NeighborAddressTlv implements PcepValueType {
*/
public static IPv6NeighborAddressTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNONE = true;
boolean bFoundNone = true;
//value starts from 3rd byte.
for (int i = 2; i < 20; ++i) {
if (NONE_VAL[i] != raw[i]) {
bFoundNONE = false;
bFoundNone = false;
}
}
if (bFoundNONE) {
if (bFoundNone) {
return NONE;
}
......
......@@ -16,15 +16,14 @@
package org.onosproject.pcepio.types;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Arrays;
/**
* Provides IPv6 Sub Object.
......@@ -115,15 +114,15 @@ public class IPv6SubObject implements PcepValueType {
*/
public static IPv6SubObject of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNONE = true;
boolean bFoundNone = true;
//value starts from 3rd byte.
for (int i = 2; i < 20; ++i) {
if (NONE_VAL[i] != raw[i]) {
bFoundNONE = false;
bFoundNone = false;
}
}
if (bFoundNONE) {
if (bFoundNone) {
return NONE;
}
......
......@@ -15,15 +15,14 @@
*/
package org.onosproject.pcepio.types;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Arrays;
/**
* Provides IPv6 TE Router Id of Local Node. Reference :[RFC6119]/4.1.
......@@ -63,15 +62,15 @@ public class IPv6TERouterIdofLocalNodeTlv implements PcepValueType {
*/
public static IPv6TERouterIdofLocalNodeTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNONE = true;
boolean bFoundNone = true;
//value starts from 3rd byte.
for (int i = 2; i < 20; ++i) {
if (NONE_VAL[i] != raw[i]) {
bFoundNONE = false;
bFoundNone = false;
}
}
if (bFoundNONE) {
if (bFoundNone) {
return NONE;
}
......
......@@ -15,15 +15,14 @@
*/
package org.onosproject.pcepio.types;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Arrays;
/**
* Provides IPv6 TE Router Id of Remote Node. Reference :[RFC6119]/4.1.
......@@ -64,15 +63,15 @@ public class IPv6TERouterIdofRemoteNodeTlv implements PcepValueType {
*/
public static IPv6TERouterIdofRemoteNodeTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNONE = true;
boolean bFoundNone = true;
//value starts from 3rd byte.
for (int i = 2; i < 20; ++i) {
if (NONE_VAL[i] != raw[i]) {
bFoundNONE = false;
bFoundNone = false;
}
}
if (bFoundNONE) {
if (bFoundNone) {
return NONE;
}
......
......@@ -15,20 +15,19 @@
*/
package org.onosproject.pcepio.types;
import java.util.Arrays;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Arrays;
/**
* Provides IGP Link Metric .
*/
public class IGPMetricTlv implements PcepValueType {
public class IgpMetricTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr-ls-distribution] /3.3.2.4
* 0 1 2 3
......@@ -40,7 +39,7 @@ public class IGPMetricTlv implements PcepValueType {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(IGPMetricTlv.class);
protected static final Logger log = LoggerFactory.getLogger(IgpMetricTlv.class);
public static final short TYPE = 1095; //TODO:NEED TO HANDLE TDB40
private short hLength;
......@@ -53,7 +52,7 @@ public class IGPMetricTlv implements PcepValueType {
* @param rawValue IGP Link Metric
* @param hLength length
*/
public IGPMetricTlv(byte[] rawValue, short hLength) {
public IgpMetricTlv(byte[] rawValue, short hLength) {
this.rawValue = rawValue;
this.hLength = hLength;
}
......@@ -65,8 +64,8 @@ public class IGPMetricTlv implements PcepValueType {
* @param hLength length
* @return object of IGPMetricTlv
*/
public static IGPMetricTlv of(final byte[] raw, short hLength) {
return new IGPMetricTlv(raw, hLength);
public static IgpMetricTlv of(final byte[] raw, short hLength) {
return new IgpMetricTlv(raw, hLength);
}
/**
......@@ -103,8 +102,8 @@ public class IGPMetricTlv implements PcepValueType {
if (this == obj) {
return true;
}
if (obj instanceof IGPMetricTlv) {
IGPMetricTlv other = (IGPMetricTlv) obj;
if (obj instanceof IgpMetricTlv) {
IgpMetricTlv other = (IgpMetricTlv) obj;
return Arrays.equals(rawValue, other.rawValue);
}
return false;
......@@ -127,9 +126,9 @@ public class IGPMetricTlv implements PcepValueType {
* @return object of IGPMetricTlv
*/
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iIGPMetric = new byte[hLength];
c.readBytes(iIGPMetric, 0, hLength);
return new IGPMetricTlv(iIGPMetric, hLength);
byte[] iIgpMetric = new byte[hLength];
c.readBytes(iIgpMetric, 0, hLength);
return new IgpMetricTlv(iIgpMetric, hLength);
}
@Override
......
......@@ -15,21 +15,20 @@
*/
package org.onosproject.pcepio.types;
import java.util.Arrays;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Arrays;
import java.util.Objects;
/**
* Provides ISIS Area Identifier.
*/
public class ISISAreaIdentifierTlv implements PcepValueType {
public class IsisAreaIdentifierTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr- ls-distribution]/3.3.1.2
* 0 1 2 3
......@@ -41,7 +40,7 @@ public class ISISAreaIdentifierTlv implements PcepValueType {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(ISISAreaIdentifierTlv.class);
protected static final Logger log = LoggerFactory.getLogger(IsisAreaIdentifierTlv.class);
public static final short TYPE = 107; //TODO:NEED TO HANDLE TBD24
private short hLength;
......@@ -54,7 +53,7 @@ public class ISISAreaIdentifierTlv implements PcepValueType {
* @param rawValue ISIS-Area-Identifier
* @param hLength length
*/
public ISISAreaIdentifierTlv(byte[] rawValue, short hLength) {
public IsisAreaIdentifierTlv(byte[] rawValue, short hLength) {
log.debug("ISISAreaIdentifierTlv");
this.rawValue = rawValue;
if (0 == hLength) {
......@@ -71,8 +70,8 @@ public class ISISAreaIdentifierTlv implements PcepValueType {
* @param hLength length
* @return object of ISISAreaIdentifierTlv
*/
public static ISISAreaIdentifierTlv of(final byte[] raw, short hLength) {
return new ISISAreaIdentifierTlv(raw, hLength);
public static IsisAreaIdentifierTlv of(final byte[] raw, short hLength) {
return new IsisAreaIdentifierTlv(raw, hLength);
}
/**
......@@ -109,8 +108,8 @@ public class ISISAreaIdentifierTlv implements PcepValueType {
if (this == obj) {
return true;
}
if (obj instanceof ISISAreaIdentifierTlv) {
ISISAreaIdentifierTlv other = (ISISAreaIdentifierTlv) obj;
if (obj instanceof IsisAreaIdentifierTlv) {
IsisAreaIdentifierTlv other = (IsisAreaIdentifierTlv) obj;
return Objects.equals(hLength, other.hLength) && Arrays.equals(rawValue, other.rawValue);
}
return false;
......@@ -133,9 +132,9 @@ public class ISISAreaIdentifierTlv implements PcepValueType {
* @return object of ISISAreaIdentifierTlv
*/
public static PcepValueType read(ChannelBuffer c, short hLength) {
byte[] iISISAreaIdentifier = new byte[hLength];
c.readBytes(iISISAreaIdentifier, 0, hLength);
return new ISISAreaIdentifierTlv(iISISAreaIdentifier, hLength);
byte[] iIsisAreaIdentifier = new byte[hLength];
c.readBytes(iIsisAreaIdentifier, 0, hLength);
return new IsisAreaIdentifierTlv(iIsisAreaIdentifier, hLength);
}
@Override
......
......@@ -201,13 +201,13 @@ public class LocalTENodeDescriptorsTlv implements PcepValueType {
iValue = tempCb.readInt();
tlv = new AutonomousSystemTlv(iValue);
break;
case BGPLSidentifierTlv.TYPE:
case BgpLsIdentifierTlv.TYPE:
iValue = tempCb.readInt();
tlv = new BGPLSidentifierTlv(iValue);
tlv = new BgpLsIdentifierTlv(iValue);
break;
case OSPFareaIDsubTlv.TYPE:
case OspfAreaIdSubTlv.TYPE:
iValue = tempCb.readInt();
tlv = new OSPFareaIDsubTlv(iValue);
tlv = new OspfAreaIdSubTlv(iValue);
break;
case RouterIDSubTlv.TYPE:
tlv = RouterIDSubTlv.read(tempCb, length);
......
......@@ -27,7 +27,7 @@ import com.google.common.base.MoreObjects;
/**
* Provides MPLS Protocol Mask.
*/
public class MPLSProtocolMaskTlv implements PcepValueType {
public class MplsProtocolMaskTlv implements PcepValueType {
/* Reference :[I-D.ietf-idr-ls-distribution]/3.3.2.2
* 0 1 2 3
......@@ -38,7 +38,7 @@ public class MPLSProtocolMaskTlv implements PcepValueType {
|L|R| Reserved |
+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(MPLSProtocolMaskTlv.class);
protected static final Logger log = LoggerFactory.getLogger(MplsProtocolMaskTlv.class);
public static final short TYPE = 1094; //TDB39
public static final short LENGTH = 1;
......@@ -55,7 +55,7 @@ public class MPLSProtocolMaskTlv implements PcepValueType {
*
* @param rawValue MPLS Protocol Mask Flag Bits
*/
public MPLSProtocolMaskTlv(byte rawValue) {
public MplsProtocolMaskTlv(byte rawValue) {
this.rawValue = rawValue;
this.isRawValueSet = true;
this.bLFlag = (rawValue & LFLAG_SET) == LFLAG_SET;
......@@ -68,7 +68,7 @@ public class MPLSProtocolMaskTlv implements PcepValueType {
* @param bLFlag L-flag
* @param bRFlag R-flag
*/
public MPLSProtocolMaskTlv(boolean bLFlag, boolean bRFlag) {
public MplsProtocolMaskTlv(boolean bLFlag, boolean bRFlag) {
this.bLFlag = bLFlag;
this.bRFlag = bRFlag;
this.rawValue = 0;
......@@ -81,8 +81,8 @@ public class MPLSProtocolMaskTlv implements PcepValueType {
* @param raw MPLS Protocol Mask Tlv
* @return new object of MPLS Protocol Mask Tlv
*/
public static MPLSProtocolMaskTlv of(final byte raw) {
return new MPLSProtocolMaskTlv(raw);
public static MplsProtocolMaskTlv of(final byte raw) {
return new MplsProtocolMaskTlv(raw);
}
/**
......@@ -141,8 +141,8 @@ public class MPLSProtocolMaskTlv implements PcepValueType {
if (this == obj) {
return true;
}
if (obj instanceof MPLSProtocolMaskTlv) {
MPLSProtocolMaskTlv other = (MPLSProtocolMaskTlv) obj;
if (obj instanceof MplsProtocolMaskTlv) {
MplsProtocolMaskTlv other = (MplsProtocolMaskTlv) obj;
if (isRawValueSet) {
return Objects.equals(this.rawValue, other.rawValue);
} else {
......@@ -186,7 +186,7 @@ public class MPLSProtocolMaskTlv implements PcepValueType {
bLFlag = (temp & LFLAG_SET) == LFLAG_SET;
bRFlag = (temp & RFLAG_SET) == RFLAG_SET;
return new MPLSProtocolMaskTlv(bLFlag, bRFlag);
return new MplsProtocolMaskTlv(bLFlag, bRFlag);
}
@Override
......
......@@ -16,15 +16,14 @@
package org.onosproject.pcepio.types;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import java.util.Objects;
/**
* NexthopIPv6addressTlv provides Ipv6 address of next hop.
......@@ -84,15 +83,15 @@ public class NexthopIPv6addressTlv implements PcepValueType {
//logic to be checked
public static NexthopIPv6addressTlv of(final byte[] raw) {
//check NONE_VAL
boolean bFoundNONE = true;
boolean bFoundNone = true;
//value starts from 3rd byte.
for (int i = 5; i < 20; ++i) {
if (NONE_VAL[i] != raw[i]) {
bFoundNONE = false;
bFoundNone = false;
}
}
if (bFoundNONE) {
if (bFoundNone) {
return NONE;
}
......
......@@ -15,18 +15,18 @@
*/
package org.onosproject.pcepio.types;
import java.util.Objects;
import com.google.common.base.MoreObjects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import java.util.Objects;
/**
* Provides area ID for OSPF area.
*/
public class OSPFareaIDsubTlv implements PcepValueType {
public class OspfAreaIdSubTlv implements PcepValueType {
/* Reference :draft-ietf-idr-ls-distribution-10.
* 0 1 2 3
......@@ -38,7 +38,7 @@ public class OSPFareaIDsubTlv implements PcepValueType {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(OSPFareaIDsubTlv.class);
protected static final Logger log = LoggerFactory.getLogger(OspfAreaIdSubTlv.class);
public static final short TYPE = 600; //TODD:change this TBD12
public static final short LENGTH = 4;
......@@ -50,7 +50,7 @@ public class OSPFareaIDsubTlv implements PcepValueType {
*
* @param rawValue area ID for OSPF area.
*/
public OSPFareaIDsubTlv(int rawValue) {
public OspfAreaIdSubTlv(int rawValue) {
this.rawValue = rawValue;
}
......@@ -60,8 +60,8 @@ public class OSPFareaIDsubTlv implements PcepValueType {
* @param raw opaque value of AreaID
* @return new object of OSPF area ID sub TLV
*/
public static OSPFareaIDsubTlv of(final int raw) {
return new OSPFareaIDsubTlv(raw);
public static OspfAreaIdSubTlv of(final int raw) {
return new OspfAreaIdSubTlv(raw);
}
/**
......@@ -98,8 +98,8 @@ public class OSPFareaIDsubTlv implements PcepValueType {
if (this == obj) {
return true;
}
if (obj instanceof OSPFareaIDsubTlv) {
OSPFareaIDsubTlv other = (OSPFareaIDsubTlv) obj;
if (obj instanceof OspfAreaIdSubTlv) {
OspfAreaIdSubTlv other = (OspfAreaIdSubTlv) obj;
return Objects.equals(this.rawValue, other.rawValue);
}
return false;
......@@ -120,8 +120,8 @@ public class OSPFareaIDsubTlv implements PcepValueType {
* @param c input channel buffer
* @return object of OSPFAreaIdSubTlv
*/
public static OSPFareaIDsubTlv read(ChannelBuffer c) {
return OSPFareaIDsubTlv.of(c.readInt());
public static OspfAreaIdSubTlv read(ChannelBuffer c) {
return OspfAreaIdSubTlv.of(c.readInt());
}
@Override
......