Enforce naming convention regarding abbreviations
Change-Id: Ic81038d3869268a55624ccbbf66048545158b0da
diff --git a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/ServiceFunctionForwarderService.java b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/ServiceFunctionForwarderService.java
index 0ed42fc..069cfd1 100644
--- a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/ServiceFunctionForwarderService.java
+++ b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/ServiceFunctionForwarderService.java
@@ -28,24 +28,24 @@
* 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);
}
diff --git a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/impl/ServiceFunctionForwarderImpl.java b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/impl/ServiceFunctionForwarderImpl.java
index 82c7bcb..4eab2bf 100644
--- a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/impl/ServiceFunctionForwarderImpl.java
+++ b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/forwarder/impl/ServiceFunctionForwarderImpl.java
@@ -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 @@
}
@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 @@
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 @@
* @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 @@
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 @@
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 @@
*
* @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 @@
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);
}
diff --git a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/installer/impl/FlowClassifierInstallerImpl.java b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/installer/impl/FlowClassifierInstallerImpl.java
index b628c21..caebbd9 100644
--- a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/installer/impl/FlowClassifierInstallerImpl.java
+++ b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/installer/impl/FlowClassifierInstallerImpl.java
@@ -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.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.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 @@
}
@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 @@
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 @@
// 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 @@
* @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 @@
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);
}
diff --git a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/manager/impl/SfcManager.java b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/manager/impl/SfcManager.java
index c841266..02eda21 100644
--- a/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/manager/impl/SfcManager.java
+++ b/apps/vtn/sfcmgr/src/main/java/org/onosproject/sfc/manager/impl/SfcManager.java
@@ -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.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 @@
@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 @@
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);
}
}