*/
protected abstract InstanceIdentifier<T> getWildCardPath();
- private boolean preConfigurationCheck(final InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
+ private static boolean preConfigurationCheck(final InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
Preconditions.checkNotNull(nodeConnIdent, "FlowCapableNodeConnector ident can not be null!");
return true;
}
}
}
- private boolean compareInstanceIdentifierTail(final InstanceIdentifier<?> identifier1,
+ private static boolean compareInstanceIdentifierTail(final InstanceIdentifier<?> identifier1,
final InstanceIdentifier<?> identifier2) {
return Iterables.getLast(identifier1.getPathArguments())
.equals(Iterables.getLast(identifier2.getPathArguments()));
return true;
}
- private StaleFlow makeStaleFlow(InstanceIdentifier<Flow> identifier, Flow del,
+ private static StaleFlow makeStaleFlow(InstanceIdentifier<Flow> identifier, Flow del,
InstanceIdentifier<FlowCapableNode> nodeIdent) {
StaleFlowBuilder staleFlowBuilder = new StaleFlowBuilder(del);
return staleFlowBuilder.setId(del.getId()).build();
handleStaleFlowResultFuture(submitFuture);
}
- private void handleStaleFlowResultFuture(FluentFuture<?> submitFuture) {
+ private static void handleStaleFlowResultFuture(FluentFuture<?> submitFuture) {
submitFuture.addCallback(new FutureCallback<Object>() {
@Override
public void onSuccess(Object result) {
}
- private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
+ private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
.flow.inventory.rev130819.tables.table.StaleFlow> getStaleFlowInstanceIdentifier(
StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(Table.class, new TableKey(staleFlow.getTableId())).child(
}
}
- private boolean compareInstanceIdentifierTail(InstanceIdentifier<?> identifier1,
+ private static boolean compareInstanceIdentifierTail(InstanceIdentifier<?> identifier1,
InstanceIdentifier<?> identifier2) {
return Iterables.getLast(identifier1.getPathArguments())
.equals(Iterables.getLast(identifier2.getPathArguments()));
}
- private BigInteger getDpIdFromPortName(String portName) {
+ private static BigInteger getDpIdFromPortName(String portName) {
String dpId = portName.substring(portName.indexOf(SEPARATOR) + 1, portName.lastIndexOf(SEPARATOR));
return new BigInteger(dpId);
}
private static final AtomicLong BUNDLE_ID = new AtomicLong();
private static final BundleFlags BUNDLE_FLAGS = new BundleFlags(true, true);
- private Map<String, ReconciliationState> reconciliationStates;
+ private final Map<String, ReconciliationState> reconciliationStates;
public FlowNodeReconciliationImpl(final ForwardingRulesManager manager, final DataBroker db,
final String serviceName, final int priority, final ResultState resultState,
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "https://github.com/spotbugs/spotbugs/issues/811")
- private BigInteger getDpnIdFromNodeName(String nodeName) {
-
+ private static BigInteger getDpnIdFromNodeName(String nodeName) {
String dpId = nodeName.substring(nodeName.lastIndexOf(SEPARATOR) + 1);
return new BigInteger(dpId);
}
handleStaleEntityDeletionResultFuture(submitFuture);
}
- private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
+ private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
.flow.inventory.rev130819.tables.table.StaleFlow> getStaleFlowInstanceIdentifier(
StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(Table.class, new TableKey(staleFlow.getTableId())).child(
new StaleFlowKey(new FlowId(staleFlow.getId())));
}
- private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
+ private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
.group.types.rev131018.groups.StaleGroup> getStaleGroupInstanceIdentifier(
StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId())));
}
- private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
+ private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight
.flow.inventory.rev130819.meters.StaleMeter> getStaleMeterInstanceIdentifier(
StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(StaleMeter.class, new StaleMeterKey(new MeterId(staleMeter.getMeterId())));
return futureList;
}
- private void handleStaleEntityDeletionResultFuture(FluentFuture<?> submitFuture) {
+ private static void handleStaleEntityDeletionResultFuture(FluentFuture<?> submitFuture) {
submitFuture.addCallback(new FutureCallback<Object>() {
@Override
public void onSuccess(Object result) {
}, MoreExecutors.directExecutor());
}
- private Flow getDeleteAllFlow() {
- final FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setTableId(OFConstants.OFPTT_ALL);
- return flowBuilder.build();
+ private static Flow getDeleteAllFlow() {
+ return new FlowBuilder().setTableId(OFConstants.OFPTT_ALL).build();
}
- private Group getDeleteAllGroup() {
- final GroupBuilder groupBuilder = new GroupBuilder();
- groupBuilder.setGroupType(GroupTypes.GroupAll);
- groupBuilder.setGroupId(new GroupId(OFConstants.OFPG_ALL));
- return groupBuilder.build();
+ private static Group getDeleteAllGroup() {
+ return new GroupBuilder()
+ .setGroupType(GroupTypes.GroupAll)
+ .setGroupId(new GroupId(OFConstants.OFPG_ALL))
+ .build();
}
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
justification = "https://github.com/spotbugs/spotbugs/issues/811")
- private Messages createMessages(final NodeRef nodeRef) {
+ private static Messages createMessages(final NodeRef nodeRef) {
final List<Message> messages = new ArrayList<>();
messages.add(new MessageBuilder().setNode(nodeRef)
.setBundleInnerMessage(new BundleRemoveFlowCaseBuilder()
this.forwardingRulesManagerImpl = forwardingRulesManagerImpl;
}
- private Node buildNode(long nodeIid) {
+ private static Node buildNode(long nodeIid) {
NodeId nodeId = new NodeId("openflow:" + nodeIid);
Node nodeDpn = new NodeBuilder().setId(nodeId).withKey(new NodeKey(nodeId)).build();
return nodeDpn;
}
- private StaleGroup makeStaleGroup(InstanceIdentifier<Group> identifier, Group del,
+ private static StaleGroup makeStaleGroup(InstanceIdentifier<Group> identifier, Group del,
InstanceIdentifier<FlowCapableNode> nodeIdent) {
StaleGroupBuilder staleGroupBuilder = new StaleGroupBuilder(del);
return staleGroupBuilder.setGroupId(del.getGroupId()).build();
handleStaleGroupResultFuture(submitFuture);
}
- private void handleStaleGroupResultFuture(FluentFuture<?> submitFuture) {
+ private static void handleStaleGroupResultFuture(FluentFuture<?> submitFuture) {
submitFuture.addCallback(new FutureCallback<Object>() {
@Override
public void onSuccess(Object result) {
LOG.error("Stale Group creation failed", throwable);
}
}, MoreExecutors.directExecutor());
-
}
- private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group
+ private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group
.types.rev131018.groups.StaleGroup> getStaleGroupInstanceIdentifier(
StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId())));
persistStaleMeter(staleMeter, nodeIdent);
}
- private StaleMeter makeStaleMeter(Meter del) {
+ private static StaleMeter makeStaleMeter(Meter del) {
StaleMeterBuilder staleMeterBuilder = new StaleMeterBuilder(del);
return staleMeterBuilder.setMeterId(del.getMeterId()).build();
}
handleStaleMeterResultFuture(submitFuture);
}
- private void handleStaleMeterResultFuture(FluentFuture<?> submitFuture) {
+ private static void handleStaleMeterResultFuture(FluentFuture<?> submitFuture) {
submitFuture.addCallback(new FutureCallback<Object>() {
@Override
public void onSuccess(Object result) {
}, MoreExecutors.directExecutor());
}
- private InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819
+ private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819
.meters.StaleMeter> getStaleMeterInstanceIdentifier(
StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(StaleMeter.class, new StaleMeterKey(new MeterId(staleMeter.getMeterId())));
To view the topology data for all the connected nodes, send the following
request to the controller:
-**Headers:**
-
-- **Content-type:** ``application/xml``
-
-- **Accept:** ``application/xml``
-
-- **Authentication:** ``admin:admin``
-
**URL:** ``/restconf/operational/network-topology:network-topology/topology/flow:1``
-**Method:** GET
+**RFC8040 URL:** ``/rests/data/network-topology:network-topology/topology=flow%3A1?content=nonconfig``
-**Sample output:**
+**Method:** ``GET``
-.. code-block:: none
+.. tabs::
+
+ .. tab:: XML
+
+ **Headers:**
+
+ **Content-type:** ``application/xml``
+
+ **Accept:** ``application/xml``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
+ <topology-id>flow: 1</topology-id>
+ <node>
+ <node-id>openflow: 2</node-id>
+ <termination-point>
+ <tp-id>openflow: 2: 2</tp-id>
+ <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 2']/a:node-connector[a:id='openflow: 2: 2']
+ </inventory-node-connector-ref>
+ </termination-point>
+ <termination-point>
+ <tp-id>openflow: 2: 1</tp-id>
+ <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 2']/a:node-connector[a:id='openflow: 2: 1']
+ </inventory-node-connector-ref>
+ </termination-point>
+ <termination-point>
+ <tp-id>openflow: 2:LOCAL</tp-id>
+ <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 2']/a:node-connector[a:id='openflow: 2:LOCAL']
+ </inventory-node-connector-ref>
+ </termination-point>
+ <inventory-node-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 2']
+ </inventory-node-ref>
+ </node>
+ <node>
+ <node-id>openflow: 1</node-id>
+ <termination-point>
+ <tp-id>openflow: 1: 1</tp-id>
+ <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 1']/a:node-connector[a:id='openflow: 1: 1']
+ </inventory-node-connector-ref>
+ </termination-point>
+ <termination-point>
+ <tp-id>openflow: 1:LOCAL</tp-id>
+ <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 1']/a:node-connector[a:id='openflow: 1:LOCAL']
+ </inventory-node-connector-ref>
+ </termination-point>
+ <termination-point>
+ <tp-id>openflow: 1: 2</tp-id>
+ <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 1']/a:node-connector[a:id='openflow: 1: 2']
+ </inventory-node-connector-ref>
+ </termination-point>
+ <inventory-node-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow: 1']
+ </inventory-node-ref>
+ </node>
+ <link>
+ <link-id>openflow:1:2</link-id>
+ <destination>
+ <dest-tp>openflow:2:2</dest-tp>
+ <dest-node>openflow:2</dest-node>
+ </destination>
+ <source>
+ <source-node>openflow:1</source-node>
+ <source-tp>openflow:1:2</source-tp>
+ </source>
+ </link>
+ <link>
+ <link-id>openflow:2:2</link-id>
+ <destination>
+ <dest-tp>openflow:1:2</dest-tp>
+ <dest-node>openflow:1</dest-node>
+ </destination>
+ <source>
+ <source-node>openflow:2</source-node>
+ <source-tp>openflow:2:2</source-tp>
+ </source>
+ </link>
+ </topology>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "topology": [
+ {
+ "topology-id": "flow:1",
+ "node": [
+ {
+ "node-id": "openflow:2",
+ "termination-point": [
+ {
+ "tp-id": "openflow:2:2",
+ "opendaylight-topology-inventory:inventory-node-connector-ref":
+ "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:2']"
+ },
+ {
+ "tp-id": "openflow:2:1",
+ "opendaylight-topology-inventory:inventory-node-connector-ref":
+ "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:1']"
+ },
+ {
+ "tp-id": "openflow:2:LOCAL",
+ "opendaylight-topology-inventory:inventory-node-connector-ref":
+ "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:LOCAL']"
+ }
+ ],
+ "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']"
+ },
+ {
+ "node-id": "openflow:1",
+ "termination-point": [
+ {
+ "tp-id": "openflow:1:1",
+ "opendaylight-topology-inventory:inventory-node-connector-ref":
+ "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:1:1']"
+ },
+ {
+ "tp-id": "openflow:1:LOCAL",
+ "opendaylight-topology-inventory:inventory-node-connector-ref":
+ "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:1:LOCAL']"
+ },
+ {
+ "tp-id": "openflow:1:2",
+ "opendaylight-topology-inventory:inventory-node-connector-ref":
+ "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:1:2']"
+ }
+ ],
+ "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']"
+ }
+ ],
+ "link": [
+ {
+ "link-id": "openflow:1:2",
+ "destination": {
+ "dest-tp": "openflow:2:2",
+ "dest-node": "openflow:2"
+ },
+ "source": {
+ "source-node": "openflow:1",
+ "source-tp": "openflow:1:2"
+ }
+ },
+ {
+ "link-id": "openflow:2:2",
+ "destination": {
+ "dest-tp": "openflow:1:2",
+ "dest-node": "openflow:1"
+ },
+ "source": {
+ "source-node": "openflow:2",
+ "source-tp": "openflow:2:2"
+ }
+ }
+ ]
+ }
+ ]
+ }
- <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
- <topology-id>flow:1</topology-id>
- <node>
- <node-id>openflow:1</node-id>
- <inventory-node-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:1']</inventory-node-ref>
- <termination-point>
- <tp-id>openflow:1:1</tp-id>
- <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:1']/a:node-connector[a:id='openflow:1:1']</inventory-node-connector-ref>
- </termination-point>
- <termination-point>
- <tp-id>openflow:1:LOCAL</tp-id>
- <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:1']/a:node-connector[a:id='openflow:1:LOCAL']</inventory-node-connector-ref>
- </termination-point>
- <termination-point>
- <tp-id>openflow:1:2</tp-id>
- <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:1']/a:node-connector[a:id='openflow:1:2']</inventory-node-connector-ref>
- </termination-point>
- </node>
- <node>
- <node-id>openflow:2</node-id>
- <inventory-node-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:2']</inventory-node-ref>
- <termination-point>
- <tp-id>openflow:2:2</tp-id>
- <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:2']/a:node-connector[a:id='openflow:2:2']</inventory-node-connector-ref>
- </termination-point>
- <termination-point>
- <tp-id>openflow:2:LOCAL</tp-id>
- <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:2']/a:node-connector[a:id='openflow:2:LOCAL']</inventory-node-connector-ref>
- </termination-point>
- <termination-point>
- <tp-id>openflow:2:1</tp-id>
- <inventory-node-connector-ref xmlns="urn:opendaylight:model:topology:inventory" xmlns:a="urn:opendaylight:inventory">/a:nodes/a:node[a:id='openflow:2']/a:node-connector[a:id='openflow:2:1']</inventory-node-connector-ref>
- </termination-point>
- </node>
- <link>
- <link-id>openflow:2:2</link-id>
- <source>
- <source-node>openflow:2</source-node>
- <source-tp>openflow:2:2</source-tp>
- </source>
- <destination>
- <dest-node>openflow:1</dest-node>
- <dest-tp>openflow:1:2</dest-tp>
- </destination>
- </link>
- <link>
- <link-id>openflow:1:2</link-id>
- <source>
- <source-node>openflow:1</source-node>
- <source-tp>openflow:1:2</source-tp>
- </source>
- <destination>
- <dest-node>openflow:2</dest-node>
- <dest-tp>openflow:2:2</dest-tp>
- </destination>
- </link>
- </topology>
-
-.. note:: In the example above the OpenFlow node is represented as openflow:1
+.. note:: In the examples above the OpenFlow node is represented as openflow:1
where 1 is the datapath ID of the OpenFlow-enabled device.
-.. note:: In the example above the OpenFlow node connector is represented as
+.. note:: In the examples above the OpenFlow node connector is represented as
openflow:1:2 where 1 is the datapath ID and 2 is the port ID of the
OpenFlow-enabled device.
To view the inventory data of a connected node, send the following request to
the controller:
-**Headers:**
+**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1``
-- **Content-type:** ``application/xml``
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1?content=nonconfig``
-- **Accept:** ``application/xml``
+**Method:** ``GET``
-- **Authentication:** ``admin:admin``
+.. tabs::
-**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1``
+ .. tab:: XML
-**Method:** ``GET``
+ **Headers:**
-**Sample output:**
+ **Content-type:** ``application/xml``
-.. code-block:: none
+ **Accept:** ``application/xml``
- <node>
- <hardware xmlns="urn:opendaylight:flow:inventory">Open vSwitch</hardware>
- <description xmlns="urn:opendaylight:flow:inventory">None</description>
- <switch-features xmlns="urn:opendaylight:flow:inventory">
- <max_tables>254</max_tables>
- <max_buffers>0</max_buffers>
- <capabilities>flow-feature-capability-queue-stats</capabilities>
- <capabilities>flow-feature-capability-table-stats</capabilities>
- <capabilities>flow-feature-capability-flow-stats</capabilities>
- <capabilities>flow-feature-capability-port-stats</capabilities>
- <capabilities>flow-feature-capability-group-stats</capabilities>
- </switch-features>
- <manufacturer xmlns="urn:opendaylight:flow:inventory">Nicira, Inc.</manufacturer>
- <serial-number xmlns="urn:opendaylight:flow:inventory">None</serial-number>
- <software xmlns="urn:opendaylight:flow:inventory">2.8.1</software>
- <ip-address xmlns="urn:opendaylight:flow:inventory">192.168.0.24</ip-address>
-
- --- Omitted output —--
-
-.. note:: In the example above the OpenFlow node is represented as openflow:1
- where 1 is the datapath ID of the OpenFlow-enabled device.
+ **Authentication:** ``admin:admin``
-Example of port description and port statistics
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ .. code-block:: none
-To view the port description and port statistics of a connected node, send the
-following request to the controller:
+ <node xmlns="urn:opendaylight:inventory">
+ <id>openflow:1</id>
+ <serial-number xmlns="urn:opendaylight:flow:inventory">None</serial-number>
+ <port-number xmlns="urn:opendaylight:flow:inventory">45170</port-number>
+ <description xmlns="urn:opendaylight:flow:inventory">None</description>
+ <hardware xmlns="urn:opendaylight:flow:inventory">Open vSwitch</hardware>
+ <manufacturer xmlns="urn:opendaylight:flow:inventory">Nicira, Inc.</manufacturer>
+ <switch-features xmlns="urn:opendaylight:flow:inventory">
+ <max_tables>254</max_tables>
+ <capabilities>flow-feature-capability-queue-stats</capabilities>
+ <capabilities>flow-feature-capability-flow-stats</capabilities>
+ <capabilities>flow-feature-capability-port-stats</capabilities>
+ <capabilities>flow-feature-capability-table-stats</capabilities>
+ <max_buffers>256</max_buffers>
+ </switch-features>
-**Headers:**
+ --- Omitted output —--
-- **Content-type:** ``application/xml``
+ .. tab:: JSON
-- **Accept:** ``application/xml``
+ **Headers:**
-- **Authentication:** ``admin:admin``
+ **Content-type:** ``application/json``
-**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:2``
+ **Accept:** ``application/json``
-**Method:** ``GET``
+ **Authentication:** ``admin:admin``
-**Sample output:**
+ .. code-block:: none
-.. code-block:: none
+ {
+ "opendaylight-inventory:nodes": {
+ "node": [
+ {
+ "id": "openflow:1",
+ "flow-node-inventory:serial-number": "None",
+ "flow-node-inventory:port-number": 45170,
+ "flow-node-inventory:description": "None",
+ "flow-node-inventory:hardware": "Open vSwitch",
+ "flow-node-inventory:manufacturer": "Nicira, Inc.",
+ "flow-node-inventory:switch-features": {
+ "max_tables": 254,
+ "capabilities": [
+ "flow-node-inventory:flow-feature-capability-queue-stats",
+ "flow-node-inventory:flow-feature-capability-flow-stats",
+ "flow-node-inventory:flow-feature-capability-port-stats",
+ "flow-node-inventory:flow-feature-capability-table-stats"
+ ],
+ "max_buffers": 256
+ },
+ "flow-node-inventory:software": "2.0.2",
+ "flow-node-inventory:ip-address": "192.168.56.106",
+ "flow-node-inventory:table": [
+ {
+ "id": 88,
+ "opendaylight-flow-table-statistics:flow-table-statistics": {
+ "packets-looked-up": "0",
+ "active-flows": 0,
+ "packets-matched": "0"
+ }
+ },
+
+ --- Omitted output —--
+
+.. note:: In the examples above the OpenFlow node is represented as openflow:1
+ where 1 is the datapath ID of the OpenFlow-enabled device.
- <node-connector xmlns="urn:opendaylight:inventory">
- <id>openflow:1:2</id>
- <supported xmlns="urn:opendaylight:flow:inventory"></supported>
- <peer-features xmlns="urn:opendaylight:flow:inventory"></peer-features>
- <port-number xmlns="urn:opendaylight:flow:inventory">2</port-number>
- <hardware-address xmlns="urn:opendaylight:flow:inventory">4e:92:4a:c8:4c:fa</hardware-address>
- <current-feature xmlns="urn:opendaylight:flow:inventory">ten-gb-fd copper</current-feature>
- <maximum-speed xmlns="urn:opendaylight:flow:inventory">0</maximum-speed>
- <reason xmlns="urn:opendaylight:flow:inventory">update</reason>
- <configuration xmlns="urn:opendaylight:flow:inventory"></configuration>
- <advertised-features xmlns="urn:opendaylight:flow:inventory"></advertised-features>
- <current-speed xmlns="urn:opendaylight:flow:inventory">10000000</current-speed>
- <name xmlns="urn:opendaylight:flow:inventory">s1-eth2</name>
- <state xmlns="urn:opendaylight:flow:inventory">
- <link-down>false</link-down>
- <blocked>false</blocked>
- <live>true</live>
- </state>
- <flow-capable-node-connector-statistics xmlns="urn:opendaylight:port:statistics">
- <receive-errors>0</receive-errors>
- <packets>
- <transmitted>444</transmitted>
- <received>444</received>
- </packets>
- <receive-over-run-error>0</receive-over-run-error>
- <transmit-drops>0</transmit-drops>
- <collision-count>0</collision-count>
- <receive-frame-error>0</receive-frame-error>
- <bytes>
- <transmitted>37708</transmitted>
- <received>37708</received>
- </bytes>
- <receive-drops>0</receive-drops>
- <transmit-errors>0</transmit-errors>
- <duration>
- <second>2181</second>
- <nanosecond>550000000</nanosecond>
- </duration>
- <receive-crc-error>0</receive-crc-error>
- </flow-capable-node-connector-statistics>
- </node-connector>
+Example of port description and port statistics
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To view the port description and port statistics of a connected node, send the
+following request to the controller:
+
+**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:2``
+
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/node-connector=openflow%3A1%3A2?content=nonconfig``
-.. note:: In the example above the OpenFlow node connector is represented as
+**Method:** ``GET``
+
+.. tabs::
+
+ .. tab:: XML
+
+ **Headers:**
+
+ **Content-type:** ``application/xml``
+
+ **Accept:** ``application/xml``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <node-connector xmlns="urn:opendaylight:inventory">
+ <id>openflow:1:2</id>
+ <supported xmlns="urn:opendaylight:flow:inventory"></supported>
+ <peer-features xmlns="urn:opendaylight:flow:inventory"></peer-features>
+ <port-number xmlns="urn:opendaylight:flow:inventory">2</port-number>
+ <hardware-address xmlns="urn:opendaylight:flow:inventory">4e:92:4a:c8:4c:fa</hardware-address>
+ <current-feature xmlns="urn:opendaylight:flow:inventory">ten-gb-fd copper</current-feature>
+ <maximum-speed xmlns="urn:opendaylight:flow:inventory">0</maximum-speed>
+ <reason xmlns="urn:opendaylight:flow:inventory">update</reason>
+ <configuration xmlns="urn:opendaylight:flow:inventory"></configuration>
+ <advertised-features xmlns="urn:opendaylight:flow:inventory"></advertised-features>
+ <current-speed xmlns="urn:opendaylight:flow:inventory">10000000</current-speed>
+ <name xmlns="urn:opendaylight:flow:inventory">s1-eth2</name>
+ <state xmlns="urn:opendaylight:flow:inventory">
+ <link-down>false</link-down>
+ <blocked>false</blocked>
+ <live>true</live>
+ </state>
+ <flow-capable-node-connector-statistics xmlns="urn:opendaylight:port:statistics">
+ <receive-errors>0</receive-errors>
+ <packets>
+ <transmitted>444</transmitted>
+ <received>444</received>
+ </packets>
+ <receive-over-run-error>0</receive-over-run-error>
+ <transmit-drops>0</transmit-drops>
+ <collision-count>0</collision-count>
+ <receive-frame-error>0</receive-frame-error>
+ <bytes>
+ <transmitted>37708</transmitted>
+ <received>37708</received>
+ </bytes>
+ <receive-drops>0</receive-drops>
+ <transmit-errors>0</transmit-errors>
+ <duration>
+ <second>2181</second>
+ <nanosecond>550000000</nanosecond>
+ </duration>
+ <receive-crc-error>0</receive-crc-error>
+ </flow-capable-node-connector-statistics>
+ </node-connector>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "node-connector": [
+ {
+ "id": "openflow:1:2",
+ "flow-node-inventory:hardware-address": "ca:56:91:bf:07:c9",
+ "flow-node-inventory:supported": "",
+ "flow-node-inventory:peer-features": "",
+ "flow-node-inventory:advertised-features": "",
+ "flow-node-inventory:name": "s1-eth2",
+ "flow-node-inventory:port-number": 2,
+ "flow-node-inventory:current-speed": 10000000,
+ "flow-node-inventory:configuration": "",
+ "flow-node-inventory:current-feature": "ten-gb-fd copper",
+ "flow-node-inventory:maximum-speed": 0,
+ "flow-node-inventory:state": {
+ "blocked": false,
+ "link-down": false,
+ "live": false
+ },
+ "opendaylight-port-statistics:flow-capable-node-connector-statistics": {
+ "packets": {
+ "transmitted": 203,
+ "received": 203
+ },
+ "receive-frame-error": 0,
+ "collision-count": 0,
+ "receive-errors": 0,
+ "transmit-errors": 0,
+ "bytes": {
+ "transmitted": 17255,
+ "received": 17255
+ },
+ "receive-crc-error": 0,
+ "duration": {
+ "nanosecond": 246000000,
+ "second": 1008
+ },
+ "receive-drops": 0,
+ "transmit-drops": 0,
+ "receive-over-run-error": 0
+ }
+ }
+ ]
+ }
+
+.. note:: In the examples above the OpenFlow node connector is represented as
openflow:1:2 where 1 is the datapath ID and 2 is the port ID of the
OpenFlow-enabled device.
To view the flow table and flow aggregated statistics for a connected node,
send the following request to the controller:
-**Headers:**
-
-- **Content-type:** ``application/xml``
-
-- **Accept:** ``application/xml``
-
-- **Authentication:** ``admin:admin``
-
**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/``
-**Method:** ``GET``
-
-**Sample output:**
-
-.. code-block:: none
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0?content=nonconfig``
- <table xmlns="urn:opendaylight:flow:inventory">
- <id>0</id>
- <flow-table-statistics xmlns="urn:opendaylight:flow:table:statistics">
- <active-flows>3</active-flows>
- <packets-looked-up>548</packets-looked-up>
- <packets-matched>535</packets-matched>
- </flow-table-statistics>
+**Method:** ``GET``
- --- Omitted output —--
+.. tabs::
+
+ .. tab:: XML
+
+ **Headers:**
+
+ **Content-type:** ``application/xml``
+
+ **Accept:** ``application/xml``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <table xmlns="urn:opendaylight:flow:inventory">
+ <id>0</id>
+ <flow-table-statistics xmlns="urn:opendaylight:flow:table:statistics">
+ <packets-looked-up>1570</packets-looked-up>
+ <active-flows>1</active-flows>
+ <packets-matched>1570</packets-matched>
+ </flow-table-statistics>
+ <flow>
+ <id>#UF$TABLE*0-1</id>
+ <table_id>0</table_id>
+ <flow-statistics xmlns="urn:opendaylight:flow:statistics">
+ <duration>
+ <second>4004</second>
+ <nanosecond>706000000</nanosecond>
+ </duration>
+ <packet-count>786</packet-count>
+ <byte-count>66810</byte-count>
+ </flow-statistics>
+ <priority>0</priority>
+ <hard-timeout>0</hard-timeout>
+ <match/>
+ <cookie_mask>0</cookie_mask>
+ <cookie>10</cookie>
+ <flags>SEND_FLOW_REM</flags>
+ <instructions>
+ <instruction>
+ <order>0</order>
+ <apply-actions>
+ <action>
+ <order>0</order>
+ <output-action>
+ <output-node-connector>CONTROLLER</output-node-connector>
+ <max-length>65535</max-length>
+ </output-action>
+ </action>
+ </apply-actions>
+ </instruction>
+ </instructions>
+ <idle-timeout>0</idle-timeout>
+ </flow>
+ </table>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "flow-node-inventory:table": [
+ {
+ "id": 0,
+ "opendaylight-flow-table-statistics:flow-table-statistics": {
+ "packets-looked-up": 1581,
+ "active-flows": 1,
+ "packets-matched": 1581
+ },
+ "flow": [
+ {
+ "id": "#UF$TABLE*0-1",
+ "table_id": 0,
+ "opendaylight-flow-statistics:flow-statistics": {
+ "duration": {
+ "second": 4056,
+ "nanosecond": 4000000
+ },
+ "packet-count": 797,
+ "byte-count": 67745
+ },
+ "priority": 0,
+ "hard-timeout": 0,
+ "cookie_mask": 0,
+ "cookie": 10,
+ "flags": "SEND_FLOW_REM",
+ "instructions": {
+ "instruction": [
+ {
+ "order": 0,
+ "apply-actions": {
+ "action": [
+ {
+ "order": 0,
+ "output-action": {
+ "output-node-connector": "CONTROLLER",
+ "max-length": 65535
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "idle-timeout": 0
+ }
+ ]
+ }
+ ]
+ }
-.. note:: In the example above the OpenFlow node table is 0.
+.. note:: In the examples above the OpenFlow node table is 0.
.. _example-of-individual-flow-statistics:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To view the individual flow statistics, send the following request to the
-controller:
-
-**Headers:**
-
-- **Content-type:** ``application/xml``
-
-- **Accept:** ``application/xml``
-
-- **Authentication:** ``admin:admin``
+controller but before that :
**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/fm-sr-link-discovery``
-**Method:** ``GET``
-
-**Sample output:**
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0/flow=fm-sr-link-discovery?content=nonconfig``
-.. code-block:: none
-
- <flow>
- <id>fm-sr-link-discovery</id>
- <flow-statistics xmlns="urn:opendaylight:flow:statistics">
- <packet-count>536</packet-count>
- <duration>
- <nanosecond>174000000</nanosecond>
- <second>2681</second>
- </duration>
- <byte-count>45560</byte-count>
- </flow-statistics>
- <priority>99</priority>
- <table_id>0</table_id>
- <cookie_mask>0</cookie_mask>
- <hard-timeout>0</hard-timeout>
- <match>
- <ethernet-match>
- <ethernet-type>
- <type>35020</type>
- </ethernet-type>
- </ethernet-match>
- </match>
- <cookie>1000000000000001</cookie>
- <flags></flags>
- <instructions>
- <instruction>
- <order>0</order>
- <apply-actions>
- <action>
- <order>0</order>
- <output-action>
- <max-length>65535</max-length>
- <output-node-connector>CONTROLLER</output-node-connector>
- </output-action>
- </action>
- </apply-actions>
- </instruction>
- </instructions>
- <idle-timeout>0</idle-timeout>
- </flow>
+**Method:** ``GET``
-.. note:: In the example above the flow ID fm-sr-link-discovery is internal to
+.. tabs::
+
+ .. tab:: XML
+
+ **Headers:**
+
+ **Content-type:** ``application/xml``
+
+ **Accept:** ``application/xml``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <flow>
+ <id>fm-sr-link-discovery</id>
+ <flow-statistics xmlns="urn:opendaylight:flow:statistics">
+ <packet-count>536</packet-count>
+ <duration>
+ <nanosecond>174000000</nanosecond>
+ <second>2681</second>
+ </duration>
+ <byte-count>45560</byte-count>
+ </flow-statistics>
+ <priority>99</priority>
+ <table_id>0</table_id>
+ <cookie_mask>0</cookie_mask>
+ <hard-timeout>0</hard-timeout>
+ <match>
+ <ethernet-match>
+ <ethernet-type>
+ <type>35020</type>
+ </ethernet-type>
+ </ethernet-match>
+ </match>
+ <cookie>1000000000000001</cookie>
+ <flags></flags>
+ <instructions>
+ <instruction>
+ <order>0</order>
+ <apply-actions>
+ <action>
+ <order>0</order>
+ <output-action>
+ <max-length>65535</max-length>
+ <output-node-connector>CONTROLLER</output-node-connector>
+ </output-action>
+ </action>
+ </apply-actions>
+ </instruction>
+ </instructions>
+ <idle-timeout>0</idle-timeout>
+ </flow>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "flow-node-inventory:flow": [
+ {
+ "id": "fm-sr-link-discovery",
+ "table_id": 0,
+ "opendaylight-flow-statistics:flow-statistics": {
+ "duration": {
+ "second": 2681,
+ "nanosecond": 174000000
+ },
+ "packet-count": 536,
+ "byte-count": 45560
+ },
+ "priority": 99,
+ "hard-timeout": 0,
+ "match": {
+ "ethernet-match": {
+ "ethernet-type": {
+ "type": 35020
+ }
+ }
+ },
+ "cookie_mask": 0,
+ "cookie": 1000000000000001,
+ "flags": "",
+ "instructions": {
+ "instruction": [
+ {
+ "order": 0,
+ "apply-actions": {
+ "action": [
+ {
+ "order": 0,
+ "output-action": {
+ "output-node-connector": "CONTROLLER",
+ "max-length": 65535
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "idle-timeout": 0
+ }
+ ]
+ }
+
+.. note:: In the examples above the flow ID fm-sr-link-discovery is internal to
the controller and has to match the datastore configured flow ID.
For more information see flow ID match section
:ref:`flow-id-match-function`.
To view the group description and group statistics, send the following request
to the controller:
-**Headers:**
-
-- **Content-type:** ``application/xml``
-
-- **Accept:** ``application/xml``
-
-- **Authentication:** ``admin:admin``
-
**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/group/2``
-**Method:** ``GET``
-
-**Sample output:**
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/group=2?content=nonconfig``
-.. code-block:: none
+**Method:** ``GET``
- <group xmlns="urn:opendaylight:flow:inventory">
- <group-id>2</group-id>
- <buckets>
- <bucket>
- <bucket-id>0</bucket-id>
- <action>
- <order>1</order>
- <output-action>
- <max-length>0</max-length>
- <output-node-connector>2</output-node-connector>
- </output-action>
- </action>
- <action>
- <order>0</order>
- <pop-mpls-action>
- <ethernet-type>34887</ethernet-type>
- </pop-mpls-action>
- </action>
- <watch_group>4294967295</watch_group>
- <weight>0</weight>
- <watch_port>2</watch_port>
- </bucket>
- </buckets>
- <group-type>group-ff</group-type>
- <group-statistics xmlns="urn:opendaylight:group:statistics">
- <buckets>
- <bucket-counter>
- <bucket-id>0</bucket-id>
+.. tabs::
+
+ .. tab:: XML
+
+ **Headers:**
+
+ **Content-type:** ``application/xml``
+
+ **Accept:** ``application/xml``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <group xmlns="urn:opendaylight:flow:inventory">
+ <group-id>2</group-id>
+ <buckets>
+ <bucket>
+ <bucket-id>0</bucket-id>
+ <action>
+ <order>1</order>
+ <output-action>
+ <max-length>0</max-length>
+ <output-node-connector>2</output-node-connector>
+ </output-action>
+ </action>
+ <action>
+ <order>0</order>
+ <pop-mpls-action>
+ <ethernet-type>34887</ethernet-type>
+ </pop-mpls-action>
+ </action>
+ <watch_group>4294967295</watch_group>
+ <weight>0</weight>
+ <watch_port>2</watch_port>
+ </bucket>
+ </buckets>
+ <group-type>group-ff</group-type>
+ <group-statistics xmlns="urn:opendaylight:group:statistics">
+ <buckets>
+ <bucket-counter>
+ <bucket-id>0</bucket-id>
+ <packet-count>0</packet-count>
+ <byte-count>0</byte-count>
+ </bucket-counter>
+ </buckets>
+ <group-id>2</group-id>
<packet-count>0</packet-count>
<byte-count>0</byte-count>
- </bucket-counter>
- </buckets>
- <group-id>2</group-id>
- <packet-count>0</packet-count>
- <byte-count>0</byte-count>
- <duration>
- <second>4116</second>
- <nanosecond>746000000</nanosecond>
- </duration>
- <ref-count>1</ref-count>
- </group-statistics>
- </group>
-
-.. note:: In the example above the group ID 2 matches the switch stored
+ <duration>
+ <second>4116</second>
+ <nanosecond>746000000</nanosecond>
+ </duration>
+ <ref-count>1</ref-count>
+ </group-statistics>
+ </group>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "flow-node-inventory:group": [
+ {
+ "group-id": 2,
+ "buckets": {
+ "bucket": [
+ {
+ "bucket-id": 0,
+ "watch_group": 4294967295,
+ "action": [
+ {
+ "order": 0,
+ "pop-mpls-action": {
+ "ethernet-type": 34887
+ }
+ },
+ {
+ "order": 1,
+ "output-action": {
+ "output-node-connector": "2",
+ "max-length": 0
+ }
+ }
+ ],
+ "weight": 0,
+ "watch_port": 2
+ }
+ ]
+ },
+ "group-type": "group-ff",
+ "opendaylight-group-statistics:group-statistics": {
+ "byte-count": 0,
+ "group-id": 2,
+ "buckets": {
+ "bucket-counter": [
+ {
+ "bucket-id": 0,
+ "packet-count": 0,
+ "byte-count": 0
+ }
+ ]
+ },
+ "duration": {
+ "nanosecond": 746000000,
+ "second": 4116
+ },
+ "ref-count": 1,
+ "packet-count": 0
+ }
+ }
+ ]
+ }
+
+.. note:: In the examples above the group ID 2 matches the switch stored
group ID.
.. _example-of-meter-description-and-meter-statistics:
To view the meter description and meter statistics, send the following request
to the controller:
-**Headers:**
-
-- **Content-type:** ``application/xml``
-
-- **Accept:** ``application/xml``
-
-- **Authentication:** ``admin:admin``
-
**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/meter/2``
-**Method:** ``GET``
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/meter=2?content=nonconfig``
-**Sample output:**
+**Method:** ``GET``
-.. code-block:: none
+.. tabs::
+
+ .. tab:: XML
+
+ **Headers:**
+
+ **Content-type:** ``application/xml``
+
+ **Accept:** ``application/xml``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <?xml version="1.0"?>
+ <meter xmlns="urn:opendaylight:flow:inventory">
+ <meter-id>2</meter-id>
+ <flags>meter-kbps</flags>
+ <meter-statistics xmlns="urn:opendaylight:meter:statistics">
+ <packet-in-count>0</packet-in-count>
+ <byte-in-count>0</byte-in-count>
+ <meter-band-stats>
+ <band-stat>
+ <band-id>0</band-id>
+ <byte-band-count>0</byte-band-count>
+ <packet-band-count>0</packet-band-count>
+ </band-stat>
+ </meter-band-stats>
+ <duration>
+ <nanosecond>364000000</nanosecond>
+ <second>114</second>
+ </duration>
+ <meter-id>2</meter-id>
+ <flow-count>0</flow-count>
+ </meter-statistics>
+ <meter-band-headers>
+ <meter-band-header>
+ <band-id>0</band-id>
+ <band-rate>100</band-rate>
+ <band-burst-size>0</band-burst-size>
+ <meter-band-types>
+ <flags>ofpmbt-drop</flags>
+ </meter-band-types>
+ <drop-burst-size>0</drop-burst-size>
+ <drop-rate>100</drop-rate>
+ </meter-band-header>
+ </meter-band-headers>
+ </meter>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "flow-node-inventory:meter": [
+ {
+ "meter-id": 2,
+ "meter-band-headers": {
+ "meter-band-header": [
+ {
+ "band-id": 0,
+ "drop-rate": 100,
+ "drop-burst-size": 0,
+ "band-rate": 100,
+ "band-burst-size": 0,
+ "meter-band-types": {
+ "flags": "ofpmbt-drop"
+ }
+ }
+ ]
+ },
+ "opendaylight-meter-statistics:meter-statistics": {
+ "packet-in-count": 0,
+ "flow-count": 0,
+ "meter-id": 2,
+ "byte-in-count": 0,
+ "meter-band-stats": {
+ "band-stat": [
+ {
+ "band-id": 0,
+ "packet-band-count": 0,
+ "byte-band-count": 0
+ }
+ ]
+ },
+ "duration": {
+ "nanosecond": 364000000,
+ "second": 114
+ }
+ },
+ "flags": "meter-kbps"
+ }
+ ]
+ }
- <?xml version="1.0"?>
- <meter xmlns="urn:opendaylight:flow:inventory">
- <meter-id>2</meter-id>
- <flags>meter-kbps</flags>
- <meter-statistics xmlns="urn:opendaylight:meter:statistics">
- <packet-in-count>0</packet-in-count>
- <byte-in-count>0</byte-in-count>
- <meter-band-stats>
- <band-stat>
- <band-id>0</band-id>
- <byte-band-count>0</byte-band-count>
- <packet-band-count>0</packet-band-count>
- </band-stat>
- </meter-band-stats>
- <duration>
- <nanosecond>364000000</nanosecond>
- <second>114</second>
- </duration>
- <meter-id>2</meter-id>
- <flow-count>0</flow-count>
- </meter-statistics>
- <meter-band-headers>
- <meter-band-header>
- <band-id>0</band-id>
- <band-rate>100</band-rate>
- <band-burst-size>0</band-burst-size>
- <meter-band-types>
- <flags>ofpmbt-drop</flags>
- </meter-band-types>
- <drop-burst-size>0</drop-burst-size>
- <drop-rate>100</drop-rate>
- </meter-band-header>
- </meter-band-headers>
- </meter>
-
-.. note:: In the example above the meter ID 2 matches the switch stored
+.. note:: In the examples above the meter ID 2 matches the switch stored
meter ID.
.. _openflow-programming-overview:
with destination address in the 10.0.10.0/24 subnet and sends them to port 1.
The flow is installed in table 0 of the switch with datapath ID 1.
-**Headers:**
+**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1``
-- **Content-type:** ``application/xml``
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0/flow=1``
-- **Accept:** ``application/xml``
+**Method:** ``PUT``
-- **Authentication:** ``admin:admin``
+.. tabs::
-**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1``
+ .. tab:: XML
-**Method:** ``PUT``
+ **Headers:**
-**Request body:**
+ **Content-type:** ``application/xml``
-.. code-block:: none
+ **Accept:** ``application/xml``
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <flow xmlns="urn:opendaylight:flow:inventory">
- <hard-timeout>0</hard-timeout>
- <idle-timeout>0</idle-timeout>
- <cookie>1</cookie>
- <priority>2</priority>
- <flow-name>flow1</flow-name>
- <match>
- <ethernet-match>
- <ethernet-type>
- <type>2048</type>
- </ethernet-type>
- </ethernet-match>
- <ipv4-destination>10.0.10.0/24</ipv4-destination>
- </match>
- <id>1</id>
- <table_id>0</table_id>
- <instructions>
- <instruction>
- <order>0</order>
- <apply-actions>
- <action>
- <output-action>
- <output-node-connector>1</output-node-connector>
- </output-action>
- <order>0</order>
- </action>
- </apply-actions>
- </instruction>
- </instructions>
- </flow>
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
-.. note:: In the example above the flow ID 1 is internal to the controller and
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ <flow xmlns="urn:opendaylight:flow:inventory">
+ <hard-timeout>0</hard-timeout>
+ <idle-timeout>0</idle-timeout>
+ <cookie>1</cookie>
+ <priority>2</priority>
+ <flow-name>flow1</flow-name>
+ <match>
+ <ethernet-match>
+ <ethernet-type>
+ <type>2048</type>
+ </ethernet-type>
+ </ethernet-match>
+ <ipv4-destination>10.0.10.0/24</ipv4-destination>
+ </match>
+ <id>1</id>
+ <table_id>0</table_id>
+ <instructions>
+ <instruction>
+ <order>0</order>
+ <apply-actions>
+ <action>
+ <output-action>
+ <output-node-connector>1</output-node-connector>
+ </output-action>
+ <order>0</order>
+ </action>
+ </apply-actions>
+ </instruction>
+ </instructions>
+ </flow>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "flow-node-inventory:flow": [
+ {
+ "id": "1",
+ "priority": 2,
+ "table_id": 0,
+ "hard-timeout": 0,
+ "match": {
+ "ethernet-match": {
+ "ethernet-type": {
+ "type": 2048
+ }
+ },
+ "ipv4-destination": "10.0.10.0/24"
+ },
+ "cookie": 1,
+ "flow-name": "flow1",
+ "instructions": {
+ "instruction": [
+ {
+ "order": 0,
+ "apply-actions": {
+ "action": [
+ {
+ "order": 0,
+ "output-action": {
+ "output-node-connector": "1"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "idle-timeout": 0
+ }
+ ]
+ }
+
+.. note:: In the examples above the flow ID 1 is internal to the controller and
the same ID can be found when retrieving the flow statistics if
controller finds a match between the configured flow and the flow
received from switch. For more information see flow ID match section
**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1``
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0/flow=1``
+
**Method:** ``DELETE``
You can also use the below URL to delete all flows in table 0 of the switch
with destination address in the 10.0.10.0/24 subnet and sends them to port 1.
The flow is installed in table 0 of the switch with datapath ID 1.
-**Headers:**
+**URL:** ``/restconf/operations/sal-flow:add-flow``
-- **Content-type:** ``application/xml``
+**RFC8040 URL:** ``/rests/operations/sal-flow:add-flow``
-- **Accept:** ``application/xml``
+**Method:** ``POST``
-- **Authentication:** ``admin:admin``
+.. tabs::
-**URL:** ``/restconf/operations/sal-flow:add-flow``
+ .. tab:: XML
-**Method:** ``POST``
+ **Headers:**
-**Request body:**
+ **Content-type:** ``application/xml``
-.. code-block:: none
+ **Accept:** ``application/xml``
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <input xmlns="urn:opendaylight:flow:service">
- <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>
- <table_id>0</table_id>
- <priority>2</priority>
- <match>
- <ethernet-match>
- <ethernet-type>
- <type>2048</type>
- </ethernet-type>
- </ethernet-match>
- <ipv4-destination>10.0.1.0/24</ipv4-destination>
- </match>
- <instructions>
- <instruction>
- <order>0</order>
- <apply-actions>
- <action>
- <output-action>
- <output-node-connector>1</output-node-connector>
- </output-action>
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ <input xmlns="urn:opendaylight:flow:service">
+ <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>
+ <table_id>0</table_id>
+ <priority>2</priority>
+ <match>
+ <ethernet-match>
+ <ethernet-type>
+ <type>2048</type>
+ </ethernet-type>
+ </ethernet-match>
+ <ipv4-destination>10.0.1.0/24</ipv4-destination>
+ </match>
+ <instructions>
+ <instruction>
<order>0</order>
- </action>
- </apply-actions>
- </instruction>
- </instructions>
- </input>
+ <apply-actions>
+ <action>
+ <output-action>
+ <output-node-connector>1</output-node-connector>
+ </output-action>
+ <order>0</order>
+ </action>
+ </apply-actions>
+ </instruction>
+ </instructions>
+ </input>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "input": {
+ "node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']",
+ "table_id": 0,
+ "priority": 2,
+ "match": {
+ "ipv4-destination": "10.0.1.0/24",
+ "ethernet-match": {
+ "ethernet-type": {
+ "type": 2048
+ }
+ }
+ },
+ "instructions": {
+ "instruction": [
+ {
+ "order": 0,
+ "apply-actions": {
+ "action": [
+ {
+ "order": 0,
+ "output-action": {
+ "output-node-connector": "1",
+ "max-length": 0
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ }
.. note:: This payload does not require flow ID as this value is internal to
controller and only used to store flows in the datastore. When
with destination address in the 10.0.10.0/24 subnet from table 0 of the switch
with datapath ID 1.
-**Headers:**
+**URL:** ``/restconf/operations/sal-flow:remove-flow``
-- **Content-type:** ``application/xml``
+**RFC8040 URL:** ``/rests/operations/sal-flow:remove-flow``
-- **Accept:** ``application/xml``
+**Method:** ``POST``
-- **Authentication:** ``admin:admin``
+.. tabs::
-**URL:** ``/restconf/operations/sal-flow:remove-flow``
+ .. tab:: XML
-**Method:** ``POST``
+ **Headers:**
-**Request body:**
+ **Content-type:** ``application/xml``
-.. code-block:: none
+ **Accept:** ``application/xml``
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <input xmlns="urn:opendaylight:flow:service">
- <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>
- <table_id>0</table_id>
- <priority>2</priority>
- <strict>true</strict>
- <match>
- <ethernet-match>
- <ethernet-type>
- <type>2048</type>
- </ethernet-type>
- </ethernet-match>
- <ipv4-destination>10.0.10.0/24</ipv4-destination>
- </match>
- </input>
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ <input xmlns="urn:opendaylight:flow:service">
+ <node xmlns:inv="urn:opendaylight:inventory">/inv:nodes/inv:node[inv:id="openflow:1"]</node>
+ <table_id>0</table_id>
+ <priority>2</priority>
+ <strict>true</strict>
+ <match>
+ <ethernet-match>
+ <ethernet-type>
+ <type>2048</type>
+ </ethernet-type>
+ </ethernet-match>
+ <ipv4-destination>10.0.10.0/24</ipv4-destination>
+ </match>
+ </input>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "input": {
+ "node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']",
+ "table_id": 0,
+ "priority": 2,
+ "strict": true,
+ "match": {
+ "ipv4-destination": "10.0.1.0/24",
+ "ethernet-match": {
+ "ethernet-type": {
+ "type": 2048
+ }
+ }
+ }
+ }
+ }
To verify that the flow has been correctly programmed in the switch, issue the
RESTCONF request as provided in :ref:`example-of-table-statistics`.
This example programs a select group to equally load balance traffic across
port 1 and port 2 in switch with datapath ID 1.
-**Headers:**
+**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/2``
-- **Content-type:** ``application/json``
-
-- **Accept:** ``application/json``
-
-- **Authentication:** ``admin:admin``
-
-**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/1``
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/group=2``
**Method:** ``PUT``
-**Request body:**
-
-.. code-block:: none
-
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <group xmlns="urn:opendaylight:flow:inventory">
- <group-type>group-select</group-type>
- <buckets>
- <bucket>
- <weight>1</weight>
- <action>
- <output-action>
- <output-node-connector>1</output-node-connector>
- </output-action>
- <order>1</order>
- </action>
- <bucket-id>1</bucket-id>
- </bucket>
- <bucket>
- <weight>1</weight>
- <action>
- <output-action>
- <output-node-connector>2</output-node-connector>
- </output-action>
- <order>1</order>
- </action>
- <bucket-id>2</bucket-id>
- </bucket>
- </buckets>
- <barrier>false</barrier>
- <group-name>SelectGroup</group-name>
- <group-id>1</group-id>
- </group>
+.. tabs::
+
+ .. tab:: XML
+
+ **Headers:**
+
+ **Content-type:** ``application/xml``
+
+ **Accept:** ``application/xml``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ <group xmlns="urn:opendaylight:flow:inventory">
+ <group-type>group-select</group-type>
+ <buckets>
+ <bucket>
+ <weight>1</weight>
+ <action>
+ <output-action>
+ <output-node-connector>1</output-node-connector>
+ </output-action>
+ <order>1</order>
+ </action>
+ <bucket-id>1</bucket-id>
+ </bucket>
+ <bucket>
+ <weight>1</weight>
+ <action>
+ <output-action>
+ <output-node-connector>2</output-node-connector>
+ </output-action>
+ <order>1</order>
+ </action>
+ <bucket-id>2</bucket-id>
+ </bucket>
+ </buckets>
+ <barrier>false</barrier>
+ <group-name>SelectGroup</group-name>
+ <group-id>2</group-id>
+ </group>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "flow-node-inventory:group": [
+ {
+ "group-id": 2,
+ "barrier": false,
+ "group-name": "SelectGroup",
+ "buckets": {
+ "bucket": [
+ {
+ "bucket-id": 1,
+ "weight": 1,
+ "action": [
+ {
+ "order": 1,
+ "output-action": {
+ "output-node-connector": "1"
+ }
+ }
+ ]
+ },
+ {
+ "bucket-id": 2,
+ "weight": 1,
+ "action": [
+ {
+ "order": 1,
+ "output-action": {
+ "output-node-connector": "2"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "group-type": "group-select"
+ }
+ ]
+ }
.. note:: In the example above the group ID 1 will be stored in the switch
and will be used by the switch to report group statistics.
- **Authentication:** ``admin:admin``
-**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/1``
+**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/2``
+
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/group=2``
**Method:** ``DELETE``
This example programs a meter to drop traffic exceeding 256 kbps with a burst
size of 512 in switch with datapath ID 1.
-**Headers:**
+**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/2``
-- **Content-type:** ``application/json``
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/meter=2``
-- **Accept:** ``application/json``
+**Method:** ``PUT``
-- **Authentication:** ``admin:admin``
+.. tabs::
-**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/1``
+ .. tab:: XML
-**Method:** ``PUT``
+ **Headers:**
-**Request body:**
+ **Content-type:** ``application/xml``
-.. code-block:: none
+ **Accept:** ``application/xml``
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <meter xmlns="urn:opendaylight:flow:inventory">
- <flags>meter-kbps</flags>
- <meter-band-headers>
- <meter-band-header>
- <band-id>0</band-id>
- <drop-rate>256</drop-rate>
- <drop-burst-size>512</drop-burst-size>
- <meter-band-types>
- <flags>ofpmbt-drop</flags>
- </meter-band-types>
- </meter-band-header>
- </meter-band-headers>
- <meter-id>1</meter-id>
- <meter-name>Foo</meter-name>
- </meter>
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ <meter xmlns="urn:opendaylight:flow:inventory">
+ <flags>meter-kbps</flags>
+ <meter-band-headers>
+ <meter-band-header>
+ <band-id>0</band-id>
+ <drop-rate>256</drop-rate>
+ <drop-burst-size>512</drop-burst-size>
+ <meter-band-types>
+ <flags>ofpmbt-drop</flags>
+ </meter-band-types>
+ </meter-band-header>
+ </meter-band-headers>
+ <meter-id>2</meter-id>
+ <meter-name>Foo</meter-name>
+ </meter>
+
+ .. tab:: JSON
+
+ **Headers:**
+
+ **Content-type:** ``application/json``
+
+ **Accept:** ``application/json``
+
+ **Authentication:** ``admin:admin``
+
+ .. code-block:: none
+
+ {
+ "flow-node-inventory:meter": [
+ {
+ "meter-id": 2,
+ "meter-band-headers": {
+ "meter-band-header": [
+ {
+ "band-id": 0,
+ "drop-rate": 256,
+ "drop-burst-size": 512,
+ "meter-band-types": {
+ "flags": "ofpmbt-drop"
+ }
+ }
+ ]
+ },
+ "flags": "meter-kbps",
+ "meter-name": "Foo"
+ }
+ ]
+ }
.. note:: In the example above the meter ID 1 will be stored in the switch
and will be used by the switch to report group statistics.
- **Authentication:** ``admin:admin``
-**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/1``
+**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/2``
+
+**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/meter=2``
**Method:** ``DELETE``
**URL:** ``/restconf/operational/entity-owners:entity-owners``
+**RFC8040 URL:** ``/rests/data/entity-owners:entity-owners?content=nonconfig``
+
**Method:** ``GET``
-**Sample output:**
+**Sample JSON output:**
.. code-block:: none
- {
+ {
"entity-owners":{
"entity-type":[
{
}
}
-In the above sample output, ``member 3`` is the master controller
+In the above sample outputs, ``member 3`` is the master controller
(EOS owner) for the OpenFlow device with datapath ID ``1``, and
``member-1`` is the master controller (EOS owner) for the OpenFlow
devices with the datapath IDs of ``2`` and ``3``.
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.eric.codec.match;
import static org.junit.Assert.assertEquals;
assertEquals(shouldBe, ericHeader.toString());
}
- private long createHeader() {
+ private static long createHeader() {
long result = 0;
int oxmClass = 4096 << 16;
result = result | oxmClass;
result = result | length;
return result;
}
-
}
\ No newline at end of file
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.eric.codec.match;
import static org.junit.Assert.assertEquals;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.eric.match.rev180730.oxm.container.match.entry.value.Icmpv6NdOptionsTypeCaseValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.eric.match.rev180730.oxm.container.match.entry.value.Icmpv6NdOptionsTypeCaseValueBuilder;
-
public class Icmpv6NDOptionsTypeCodecTest {
private static final int ERIC_FIELD_CODE = 2;
assertEquals(2, result.getIcmpv6NdOptionsTypeValues().getIcmpv6NdOptionsType().shortValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final Icmpv6NdOptionsTypeCaseValueBuilder caseBuilder = new Icmpv6NdOptionsTypeCaseValueBuilder();
final Icmpv6NdOptionsTypeValuesBuilder valuesBuilder = new Icmpv6NdOptionsTypeValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EricConstants.ERICOXM_OF_EXPERIMENTER_ID);
int fieldMask = ERIC_FIELD_CODE << 1;
message.writeByte(VALUE_LENGTH);
message.writeByte(2);
}
-
}
\ No newline at end of file
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.eric.codec.match;
import static org.junit.Assert.assertEquals;
assertEquals(2, result.getIcmpv6NdReservedValues().getIcmpv6NdReserved().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final Icmpv6NdReservedCaseValueBuilder caseBuilder = new Icmpv6NdReservedCaseValueBuilder();
final Icmpv6NdReservedValuesBuilder valuesBuilder = new Icmpv6NdReservedValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EricConstants.ERICOXM_OF_EXPERIMENTER_ID);
int fieldMask = ERIC_FIELD_CODE << 1;
message.writeByte(fieldMask);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.action;
import com.google.common.net.InetAddresses;
serializeCtAction(outBuffer,action);
}
- private int getActionLength(final ActionConntrack action) {
+ private static int getActionLength(final ActionConntrack action) {
int length = 0;
List<CtActions> ctActionsList = action.getNxActionConntrack().getCtActions();
if (ctActionsList == null) {
return length;
}
- private int getNatActionLength(final NxActionNat natAction) {
+ private static int getNatActionLength(final NxActionNat natAction) {
int natLength = NX_NAT_LENGTH;
short rangePresent = natAction.getRangePresent().shortValue();
if (0 != (rangePresent & NxActionNatRangePresent.NXNATRANGEIPV4MIN.getIntValue())) {
natLength += SHORT_LENGTH;
}
return natLength;
-
}
- private void serializeCtAction(final ByteBuf outBuffer, final ActionConntrack action) {
+ private static void serializeCtAction(final ByteBuf outBuffer, final ActionConntrack action) {
List<CtActions> ctActionsList = action.getNxActionConntrack().getCtActions();
if (ctActionsList != null) {
for (CtActions ctActions : ctActionsList) {
return actionBuilder.build();
}
- private void deserializeCtAction(final ByteBuf message, final NxActionConntrackBuilder nxActionConntrackBuilder,
- final int ctActionsLength) {
+ private static void deserializeCtAction(final ByteBuf message,
+ final NxActionConntrackBuilder nxActionConntrackBuilder, final int ctActionsLength) {
List<CtActions> ctActionsList = new ArrayList<>();
int processedCtActionsLength = ctActionsLength;
nxActionConntrackBuilder.setCtActions(ctActionsList);
}
- private short deserializeCtHeaderWithoutSubtype(final ByteBuf message) {
+ private static short deserializeCtHeaderWithoutSubtype(final ByteBuf message) {
// size of experimenter type / size of set field code (in case of ct_mark)
message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
// size of length
return length;
}
- private short deserializeCtHeader(final ByteBuf message) {
+ private static short deserializeCtHeader(final ByteBuf message) {
short length = deserializeCtHeaderWithoutSubtype(message);
// subtype
message.skipBytes(EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
Mockito.verify(deserializer).deserialize(buffer);
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
//size of experiment type
message.writeShort(1);
//size of length
message.writeShort(SUBTYPE);
}
- private void createBufferWithWrongExperimentId(ByteBuf message) {
+ private static void createBufferWithWrongExperimentId(ByteBuf message) {
//size of experiment type
message.writeShort(1);
//size of length
Assert.assertEquals(4, result.getNxActionConntrack().getRecircTable().byteValue());
}
- private Action createAction() {
+ private static Action createAction() {
NxActionConntrackBuilder nxActionConntrackBuilder = new NxActionConntrackBuilder();
nxActionConntrackBuilder.setFlags(1);
return actionBuilder.build();
}
- private Action createActionWithoutCtAction() {
+ private static Action createActionWithoutCtAction() {
NxActionConntrackBuilder nxActionConntrackBuilder = new NxActionConntrackBuilder();
nxActionConntrackBuilder.setFlags(1);
}
- private Action createAction() {
+ private static Action createAction() {
NxActionCtClearBuilder nxActionCtClearBuilder = new NxActionCtClearBuilder();
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
assertFalse(buffer.isReadable());
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
message.writeInt((int) PACKET_TYPE);
}
- private Action createAction() {
+ private static Action createAction() {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
assertFalse(buffer.isReadable());
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
message.writeInt((int) PACKET_TYPE);
}
- private Action createAction() {
+ private static Action createAction() {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
assertEquals(0, buffer.readableBytes());
}
- private Action createAction(Short idleTimeout, Short hardTimeout) {
+ private static Action createAction(Short idleTimeout, Short hardTimeout) {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
@Test
public void deserializeTest() {
- createBufer(buffer);
+ createBuffer(buffer);
action = learnCodec.deserialize(buffer);
ActionLearn result = (ActionLearn) action.getActionChoice();
Assert.assertEquals(0, buffer.readableBytes());
}
-
-
- private Action createAction() {
+ private static Action createAction() {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private List<FlowMods> createFlowMods() {
+ private static List<FlowMods> createFlowMods() {
final List<FlowMods> flowMods = new ArrayList<>();
//length = 14
return flowMods;
}
- private void createBufer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LEARN_HEADER_LEN + 56);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
message.writeShort(10);
}
- private void toFlowModSpecHeader(ByteBuf message, int src, int dst) {
+ private static void toFlowModSpecHeader(ByteBuf message, int src, int dst) {
short value = 0;
short bitNum = 48;
value |= src << 13;
}
- private Action createAction() {
+ private static Action createAction() {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
assertFalse(buffer.isReadable());
}
- private Action createAction(final Uint64 src) {
+ private static Action createAction(final Uint64 src) {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private void createBuffer(final ByteBuf message, final boolean withExpSrc) {
+ private static void createBuffer(final ByteBuf message, final boolean withExpSrc) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
}
- private Action createAction() {
+ private static Action createAction() {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
assertEquals(RegLoad2Codec.SUBTYPE, out.readUnsignedShort());
}
- private Action createAction() {
+ private static Action createAction() {
ExperimenterBuilder experimenterBuilder = new ExperimenterBuilder();
experimenterBuilder.setExperimenter(new ExperimenterId(NiciraConstants.NX_NSH_VENDOR_ID));
ExperimenterIdCaseBuilder expCaseBuilder = new ExperimenterIdCaseBuilder();
assertEquals(0, buffer.readableBytes());
}
- private Action createAction() {
+ private static Action createAction() {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
assertEquals(0, buffer.readableBytes());
}
- private Action createAction(Uint64 src, Uint64 dst) {
+ private static Action createAction(Uint64 src, Uint64 dst) {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private void createBuffer(ByteBuf message, boolean withExpSrc, boolean withExpDst) {
+ private static void createBuffer(ByteBuf message, boolean withExpSrc, boolean withExpDst) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
int length = withExpSrc || withExpDst ? 32 : 24;
message.writeShort(length);
*/
@Test
public void getSubTypeTest2() {
- Byte table = new Byte((byte)1);
- action = createAction(null, table);
+ action = createAction(null, (byte)1);
ActionResubmit actionResubmit = (ActionResubmit) action.getActionChoice();
byte result = resubmitCodec.getSubType(actionResubmit);
assertEquals(0, buffer.readableBytes());
}
- private Action createAction(Short inPort, Byte table) {
+ private static Action createAction(Short inPort, Byte table) {
ExperimenterId experimenterId = new ExperimenterId(NiciraConstants.NX_VENDOR_ID);
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setExperimenterId(experimenterId);
return actionBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(EncodeConstants.EXPERIMENTER_VALUE);
message.writeShort(LENGTH);
message.writeInt(NiciraConstants.NX_VENDOR_ID.intValue());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.match;
import static org.junit.Assert.assertEquals;
assertFalse(buffer.isReadable());
}
-
- private NxExpMatchEntryValue createMatchEntryValue(final Long value, final Long mask) {
+ private static NxExpMatchEntryValue createMatchEntryValue(final Long value, final Long mask) {
return new NshcCaseValueBuilder().setNshc(value).setMask(mask).build();
}
- private void writeBuffer(final ByteBuf message, final Long value, final Long mask) {
+ private static void writeBuffer(final ByteBuf message, final Long value, final Long mask) {
message.writeInt(value.intValue());
if (mask != null) {
message.writeInt(mask.intValue());
assertEquals(2, result.getArpOpValues().getValue().shortValue());
}
-
-
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final ArpOpCaseValueBuilder caseBuilder = new ArpOpCaseValueBuilder();
final ArpOpValuesBuilder valuesBuilder = new ArpOpValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final ArpShaCaseValueBuilder caseBuilder = new ArpShaCaseValueBuilder();
final ArpShaValuesBuilder valuesBuilder = new ArpShaValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getArpSpaValues().getValue().shortValue());
}
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final ArpSpaCaseValueBuilder caseBuilder = new ArpSpaCaseValueBuilder();
final ArpSpaValuesBuilder valuesBuilder = new ArpSpaValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(TEST_ADDRESS, result.getArpThaValues().getMacAddress());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final ArpThaCaseValueBuilder caseBuilder = new ArpThaCaseValueBuilder();
final ArpThaValuesBuilder valuesBuilder = new ArpThaValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getArpTpaValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final ArpTpaCaseValueBuilder caseBuilder = new ArpTpaCaseValueBuilder();
final ArpTpaValuesBuilder valuesBuilder = new ArpTpaValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getCtStateValues().getMask().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final CtStateCaseValueBuilder caseBuilder = new CtStateCaseValueBuilder();
final CtStateValuesBuilder valuesBuilder = new CtStateValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getCtTpDstValues().getCtTpDst().shortValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final CtTpDstCaseValueBuilder caseBuilder = new CtTpDstCaseValueBuilder();
final CtTpDstValuesBuilder valuesBuilder = new CtTpDstValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getCtTpSrcValues().getCtTpSrc().shortValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final CtTpSrcCaseValueBuilder caseBuilder = new CtTpSrcCaseValueBuilder();
final CtTpSrcValuesBuilder valuesBuilder = new CtTpSrcValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final CtZoneCaseValueBuilder caseBuilder = new CtZoneCaseValueBuilder();
final CtZoneValuesBuilder valuesBuilder = new CtZoneValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(TEST_ADDRESS, result.getEthDstValues().getMacAddress());
}
-
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final EthDstCaseValueBuilder caseBuilder = new EthDstCaseValueBuilder();
final EthDstValuesBuilder valuesBuilder = new EthDstValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(TEST_ADDRESS, result.getEthSrcValues().getMacAddress());
}
-
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final EthSrcCaseValueBuilder caseBuilder = new EthSrcCaseValueBuilder();
final EthSrcValuesBuilder valuesBuilder = new EthSrcValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getEthTypeValues().getValue().shortValue());
}
-
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final EthTypeCaseValueBuilder caseBuilder = new EthTypeCaseValueBuilder();
final EthTypeValuesBuilder valuesBuilder = new EthTypeValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getIcmpTypeValues().getValue().shortValue());
}
-
-
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final IcmpTypeCaseValueBuilder caseBuilder = new IcmpTypeCaseValueBuilder();
final IcmpTypeValuesBuilder valuesBuilder = new IcmpTypeValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getIpDstValues().getValue().intValue());
}
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
final IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getIpSrcValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
final IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getIpDstValues().getValue().intValue());
}
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final IpDstCaseValueBuilder caseBuilder = new IpDstCaseValueBuilder();
final IpDstValuesBuilder valuesBuilder = new IpDstValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(2, result.getIpSrcValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final IpSrcCaseValueBuilder caseBuilder = new IpSrcCaseValueBuilder();
final IpSrcValuesBuilder valuesBuilder = new IpSrcValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.match;
import static org.junit.Assert.assertEquals;
assertEquals(false, input.isHasMask());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
matchEntryBuilder.setOxmClass(Nxm0Class.class);
matchEntryBuilder.setOxmMatchField(NxmOfMetadata.class);
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
- int fieldMask = (NXM_FIELD_CODE << 1);
+ int fieldMask = NXM_FIELD_CODE << 1;
message.writeByte(fieldMask);
message.writeByte(VALUE_LENGTH);
}
-
}
\ No newline at end of file
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.match;
import static org.junit.Assert.assertEquals;
assertFalse(buffer.isReadable());
}
-
- private NxExpMatchEntryValue createMatchEntryValue(Short value, Short mask) {
+ private static NxExpMatchEntryValue createMatchEntryValue(Short value, Short mask) {
NshFlagsValues nshFlagsValues = new NshFlagsValuesBuilder().setNshFlags(value).setMask(mask).build();
return new NshFlagsCaseValueBuilder().setNshFlagsValues(nshFlagsValues).build();
}
- private void writeBuffer(ByteBuf message, Short value, Short mask) {
+ private static void writeBuffer(ByteBuf message, Short value, Short mask) {
message.writeByte(value.intValue());
if (mask != null) {
message.writeByte(mask.intValue());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.match;
import static org.junit.Assert.assertEquals;
assertFalse(buffer.isReadable());
}
- private NxExpMatchEntryValue createMatchEntryValue(Short value) {
+ private static NxExpMatchEntryValue createMatchEntryValue(Short value) {
NshMdtypeValues nshMdtypeValues = new NshMdtypeValuesBuilder().setValue(value).build();
return new NshMdtypeCaseValueBuilder().setNshMdtypeValues(nshMdtypeValues).build();
}
- private void writeBuffer(ByteBuf message, Short value) {
+ private static void writeBuffer(ByteBuf message, Short value) {
message.writeByte(value.intValue());
}
}
\ No newline at end of file
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.match;
import static org.junit.Assert.assertEquals;
assertFalse(buffer.isReadable());
}
- private NxExpMatchEntryValue createMatchEntryValue(Short value) {
+ private static NxExpMatchEntryValue createMatchEntryValue(Short value) {
NshNpValues nshNpValues = new NshNpValuesBuilder().setValue(value).build();
return new NshNpCaseValueBuilder().setNshNpValues(nshNpValues).build();
}
- private void writeBuffer(ByteBuf message, Short value) {
+ private static void writeBuffer(ByteBuf message, Short value) {
message.writeByte(value.intValue());
}
}
\ No newline at end of file
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.match;
import static org.junit.Assert.assertEquals;
assertFalse(buffer.isReadable());
}
-
- private NxExpMatchEntryValue createMatchEntryValue(final Short value, final Short mask) {
+ private static NxExpMatchEntryValue createMatchEntryValue(final Short value, final Short mask) {
NshTtlValues nshTtlValues = new NshTtlValuesBuilder().setNshTtl(value).setMask(mask).build();
return new NshTtlCaseValueBuilder().setNshTtlValues(nshTtlValues).build();
}
- private void writeBuffer(final ByteBuf message, final Short value, final Short mask) {
+ private static void writeBuffer(final ByteBuf message, final Short value, final Short mask) {
message.writeByte(value.intValue());
if (mask != null) {
message.writeByte(mask.intValue());
assertFalse(buffer.isReadable());
}
- private NxExpMatchEntryValue createMatchEntryValue(Short value, Short mask) {
+ private static NxExpMatchEntryValue createMatchEntryValue(Short value, Short mask) {
NsiValues nsiValues = new NsiValuesBuilder().setNsi(value).setMask(mask).build();
return new NsiCaseValueBuilder().setNsiValues(nsiValues).build();
}
- private void writeBuffer(ByteBuf message, Short value, Short mask) {
+ private static void writeBuffer(ByteBuf message, Short value, Short mask) {
message.writeByte(value.intValue());
if (mask != null) {
message.writeByte(mask.intValue());
assertFalse(buffer.isReadable());
}
-
- private NxExpMatchEntryValue createMatchEntryValue(final Long value, final Long mask) {
+ private static NxExpMatchEntryValue createMatchEntryValue(final Long value, final Long mask) {
NspValues nspValues = new NspValuesBuilder().setNsp(value).setMask(mask).build();
return new NspCaseValueBuilder().setNspValues(nspValues).build();
}
- private void writeBuffer(final ByteBuf message, final Long value, final Long mask) {
+ private static void writeBuffer(final ByteBuf message, final Long value, final Long mask) {
message.writeInt(value.intValue());
if (mask != null) {
message.writeInt(mask.intValue());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.nx.codec.match;
import static org.junit.Assert.assertEquals;
assertEquals(2, result.getPktMarkValues().getPktMark().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final PktMarkCaseValueBuilder caseBuilder = new PktMarkCaseValueBuilder();
final PktMarkValuesBuilder valuesBuilder = new PktMarkValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getRegValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final RegCaseValueBuilder caseBuilder = new RegCaseValueBuilder();
final RegValuesBuilder valuesBuilder = new RegValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(0xffff, result.getTcpDstValues().getMask().shortValue() & 0xffff);
}
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final TcpDstCaseValueBuilder caseBuilder = new TcpDstCaseValueBuilder();
final TcpDstValuesBuilder valuesBuilder = new TcpDstValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(0xffff, result.getTcpSrcValues().getMask().shortValue() & 0xffff);
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final TcpSrcCaseValueBuilder caseBuilder = new TcpSrcCaseValueBuilder();
final TcpSrcValuesBuilder valuesBuilder = new TcpSrcValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(0, result.getTunIdValues().getValue().longValue());
}
-
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final TunIdCaseValueBuilder caseBuilder = new TunIdCaseValueBuilder();
final TunIdValuesBuilder valuesBuilder = new TunIdValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getTunIpv4DstValues().getValue().intValue());
}
-
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final TunIpv4DstCaseValueBuilder caseBuilder = new TunIpv4DstCaseValueBuilder();
final TunIpv4DstValuesBuilder valuesBuilder = new TunIpv4DstValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(1, result.getTunIpv4SrcValues().getValue().intValue());
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final TunIpv4SrcCaseValueBuilder caseBuilder = new TunIpv4SrcCaseValueBuilder();
final TunIpv4SrcValuesBuilder valuesBuilder = new TunIpv4SrcValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_1_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(0xffff, result.getUdpDstValues().getMask().shortValue() & 0xffff);
}
-
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final UdpDstCaseValueBuilder caseBuilder = new UdpDstCaseValueBuilder();
final UdpDstValuesBuilder valuesBuilder = new UdpDstValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
assertEquals(0xffff, result.getUdpSrcValues().getMask().shortValue() & 0xffff);
}
- private MatchEntry createMatchEntry() {
+ private static MatchEntry createMatchEntry() {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
final UdpSrcCaseValueBuilder caseBuilder = new UdpSrcCaseValueBuilder();
final UdpSrcValuesBuilder valuesBuilder = new UdpSrcValuesBuilder();
return matchEntryBuilder.build();
}
- private void createBuffer(ByteBuf message) {
+ private static void createBuffer(ByteBuf message) {
message.writeShort(OxmMatchConstants.NXM_0_CLASS);
int fieldMask = NXM_FIELD_CODE << 1;
grouping flow-and-statistics-map-list {
description "List of flow and statistics map";
list flow-and-statistics-map-list {
- key "flow-id";
leaf flow-id {
type flow-id;
}
if (getClass() != obj.getClass()) {
return false;
}
- ExperimenterIdMeterSubTypeSerializerKey other = (ExperimenterIdMeterSubTypeSerializerKey) obj;
+ ExperimenterIdMeterSubTypeSerializerKey<?> other = (ExperimenterIdMeterSubTypeSerializerKey<?>) obj;
if (meterSubType == null) {
if (other.meterSubType != null) {
return false;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.api.keys;
import org.junit.Assert;
* @author michal.polkorab
*/
public class ActionSerializerKeyTest {
+ private static final Uint32 FORTY_TWO = Uint32.valueOf(42);
+ private static final Uint32 FIFTY_FIVE = Uint32.valueOf(55);
/**
* Test ActionSerializerKey equals and hashCode.
@Test
public void test() {
ActionSerializerKey<CopyTtlInCase> key1 =
- new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 42L);
+ new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, FORTY_TWO);
ActionSerializerKey<?> key2 =
- new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 42L);
+ new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, FORTY_TWO);
Assert.assertTrue("Wrong equals", key1.equals(key2));
Assert.assertTrue("Wrong hashCode", key1.hashCode() == key2.hashCode());
key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, (Uint32) null);
key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, (Uint32) null);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
- key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlOutCase.class, 42L);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlOutCase.class, FORTY_TWO);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
- key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, 55L);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, FIFTY_FIVE);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
- key2 = new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, CopyTtlInCase.class, 55L);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF13_VERSION_ID, CopyTtlInCase.class, FIFTY_FIVE);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashCode", key1.hashCode() == key2.hashCode());
}
*/
@Test
public void testEquals() {
- ActionSerializerKey<?> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
+ ActionSerializerKey<?> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, FORTY_TWO);
ActionSerializerKey<?> key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
- CopyTtlInCase.class, 42L);
+ CopyTtlInCase.class, FORTY_TWO);
Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
Assert.assertFalse("Wrong equal by actionType", key1.equals(key2));
- key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, 42L);
+ key2 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, null, FORTY_TWO);
Assert.assertTrue("Wrong equal by action type", key1.equals(key2));
key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID, CopyTtlInCase.class, (Uint32) null);
Assert.assertFalse("Wrong equal by experimenterId", key1.equals(key2));
@Test
public void testToString() {
ActionSerializerKey<CopyTtlInCase> key1 = new ActionSerializerKey<>(EncodeConstants.OF10_VERSION_ID,
- CopyTtlInCase.class, 42L);
+ CopyTtlInCase.class, FORTY_TWO);
Assert.assertEquals("Wrong toString()", "msgVersion: 1 objectType: org.opendaylight.yang.gen.v1.urn"
+ ".opendaylight.openflow.common.action.rev150203.actions.grouping.Action action type:"
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.ExperimenterActionSubType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.InPort;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.OpenflowBasicClass;
+import org.opendaylight.yangtools.yang.common.Uint32;
/**
* Unit tests for keys.
@Test
public void testEqualsAndHashcodeOfActionDeserializerKeys() {
ActionSerializerKey<ExperimenterIdCase> actionSerializerKey = new ActionSerializerKey<>(
- EncodeConstants.OF13_VERSION_ID, ExperimenterIdCase.class, 1L);
+ EncodeConstants.OF13_VERSION_ID, ExperimenterIdCase.class, Uint32.ONE);
ExperimenterActionSerializerKey experimenterActionSerializerKey = new ExperimenterActionSerializerKey(
- EncodeConstants.OF13_VERSION_ID, 1L, ExpSubType.class);
+ EncodeConstants.OF13_VERSION_ID, Uint32.ONE, ExpSubType.class);
Assert.assertFalse(actionSerializerKey.equals(experimenterActionSerializerKey));
Assert.assertFalse(experimenterActionSerializerKey.equals(actionSerializerKey));
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.api.keys.experimenter;
import org.junit.Assert;
* @author michal.polkorab
*/
public class ExperimenterActionSerializerKeyTest {
+ private static final Uint32 FORTY_TWO = Uint32.valueOf(42);
+ private static final Uint32 FIFTY_FIVE = Uint32.valueOf(55);
/**
* Test ExperimenterActionSerializerKey equals and hashCode.
@Test
public void test() {
ExperimenterActionSerializerKey key1 =
- new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType.class);
+ new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FORTY_TWO, TestSubType.class);
ExperimenterActionSerializerKey key2 =
- new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType.class);
+ new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FORTY_TWO, TestSubType.class);
Assert.assertTrue("Wrong equals", key1.equals(key2));
Assert.assertTrue("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF13_VERSION_ID, 42L, TestSubType.class);
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF13_VERSION_ID, FORTY_TWO, TestSubType.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, (Uint32) null, TestSubType.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 55L, TestSubType.class);
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FIFTY_FIVE, TestSubType.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 55L, null);
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FIFTY_FIVE, null);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
- key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 55L, TestSubType2.class);
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FIFTY_FIVE, TestSubType2.class);
Assert.assertFalse("Wrong equals", key1.equals(key2));
Assert.assertFalse("Wrong hashcode", key1.hashCode() == key2.hashCode());
}
public void testEquals() {
ExperimenterActionSerializerKey key1;
ExperimenterActionSerializerKey key2;
- key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, null);
+ key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FORTY_TWO, null);
Assert.assertTrue("Wrong equal to identical object.", key1.equals(key1));
- key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType2.class);
+ key2 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FORTY_TWO, TestSubType2.class);
Assert.assertFalse("Wrong equal by actionSubType.", key1.equals(key2));
- key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, 42L, TestSubType.class);
+ key1 = new ExperimenterActionSerializerKey(EncodeConstants.OF10_VERSION_ID, FORTY_TWO, TestSubType.class);
Assert.assertFalse("Wrong equal by actionSubType.", key1.equals(key2));
}
private interface TestSubType2 extends ExperimenterActionSubType {
// empty class - only used in test for comparation
}
-
-
}
}
}
- private String getSslErrorCause(Throwable cause) {
+ private static String getSslErrorCause(Throwable cause) {
String sslError = null;
- while ((cause != null) && (cause.getCause() != null)) {
+ while (cause != null && cause.getCause() != null) {
sslError = cause.getCause().getMessage();
cause = cause.getCause();
}
return new TableConfig(deprecated);
}
- private MultipartRequestDescCase setDesc(ByteBuf input) {
+ private static MultipartRequestDescCase setDesc(ByteBuf input) {
MultipartRequestDescCaseBuilder caseBuilder = new MultipartRequestDescCaseBuilder();
MultipartRequestDescBuilder descBuilder = new MultipartRequestDescBuilder();
descBuilder.setEmpty(Empty.getInstance());
return caseBuilder.build();
}
- private MultipartRequestPortDescCase setPortDesc(ByteBuf input) {
+ private static MultipartRequestPortDescCase setPortDesc(ByteBuf input) {
MultipartRequestPortDescCaseBuilder caseBuilder = new MultipartRequestPortDescCaseBuilder();
MultipartRequestPortDescBuilder portBuilder = new MultipartRequestPortDescBuilder();
portBuilder.setEmpty(Empty.getInstance());
return caseBuilder.build();
}
- private MultipartRequestPortStatsCase setPortStats(ByteBuf input) {
+ private static MultipartRequestPortStatsCase setPortStats(ByteBuf input) {
MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
MultipartRequestPortStatsBuilder portBuilder = new MultipartRequestPortStatsBuilder();
portBuilder.setPortNo(input.readUnsignedInt());
return caseBuilder.build();
}
- private MultipartRequestQueueCase setQueue(ByteBuf input) {
+ private static MultipartRequestQueueCase setQueue(ByteBuf input) {
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder queueBuilder = new MultipartRequestQueueBuilder();
queueBuilder.setPortNo(input.readUnsignedInt());
return caseBuilder.build();
}
- private MultipartRequestGroupCase setGroup(ByteBuf input) {
+ private static MultipartRequestGroupCase setGroup(ByteBuf input) {
MultipartRequestGroupCaseBuilder caseBuilder = new MultipartRequestGroupCaseBuilder();
MultipartRequestGroupBuilder groupBuilder = new MultipartRequestGroupBuilder();
groupBuilder.setGroupId(new GroupId(input.readUnsignedInt()));
return caseBuilder.build();
}
- private MultipartRequestGroupDescCase setGroupDesc(ByteBuf input) {
+ private static MultipartRequestGroupDescCase setGroupDesc(ByteBuf input) {
MultipartRequestGroupDescCaseBuilder caseBuilder = new MultipartRequestGroupDescCaseBuilder();
MultipartRequestGroupDescBuilder groupBuilder = new MultipartRequestGroupDescBuilder();
groupBuilder.setEmpty(Empty.getInstance());
return caseBuilder.build();
}
- private MultipartRequestGroupFeaturesCase setGroupFeatures(ByteBuf input) {
+ private static MultipartRequestGroupFeaturesCase setGroupFeatures(ByteBuf input) {
MultipartRequestGroupFeaturesCaseBuilder caseBuilder = new MultipartRequestGroupFeaturesCaseBuilder();
MultipartRequestGroupFeaturesBuilder groupBuilder = new MultipartRequestGroupFeaturesBuilder();
groupBuilder.setEmpty(Empty.getInstance());
return caseBuilder.build();
}
- private MultipartRequestMeterCase setMeter(ByteBuf input) {
+ private static MultipartRequestMeterCase setMeter(ByteBuf input) {
MultipartRequestMeterCaseBuilder caseBuilder = new MultipartRequestMeterCaseBuilder();
MultipartRequestMeterBuilder meterBuilder = new MultipartRequestMeterBuilder();
meterBuilder.setMeterId(new MeterId(input.readUnsignedInt()));
return caseBuilder.build();
}
- private MultipartRequestMeterConfigCase setMeterConfig(ByteBuf input) {
+ private static MultipartRequestMeterConfigCase setMeterConfig(ByteBuf input) {
MultipartRequestMeterConfigCaseBuilder caseBuilder = new MultipartRequestMeterConfigCaseBuilder();
MultipartRequestMeterConfigBuilder meterBuilder = new MultipartRequestMeterConfigBuilder();
meterBuilder.setMeterId(new MeterId(input.readUnsignedInt()));
return caseBuilder.build();
}
- private MultipartRequestMeterFeaturesCase setMeterFeatures(ByteBuf input) {
+ private static MultipartRequestMeterFeaturesCase setMeterFeatures(ByteBuf input) {
MultipartRequestMeterFeaturesCaseBuilder caseBuilder = new MultipartRequestMeterFeaturesCaseBuilder();
MultipartRequestMeterFeaturesBuilder meterBuilder = new MultipartRequestMeterFeaturesBuilder();
meterBuilder.setEmpty(Empty.getInstance());
return caseBuilder.build();
}
- private MultipartRequestTableCase setTable(ByteBuf input) {
+ private static MultipartRequestTableCase setTable(ByteBuf input) {
MultipartRequestTableCaseBuilder caseBuilder = new MultipartRequestTableCaseBuilder();
MultipartRequestTableBuilder tableBuilder = new MultipartRequestTableBuilder();
tableBuilder.setEmpty(Empty.getInstance());
return caseBuilder.build();
}
- private MultipartRequestExperimenterCase setExperimenter(ByteBuf input) {
+ private static MultipartRequestExperimenterCase setExperimenter(ByteBuf input) {
MultipartRequestExperimenterCaseBuilder caseBuilder = new MultipartRequestExperimenterCaseBuilder();
MultipartRequestExperimenterBuilder experimenterBuilder = new MultipartRequestExperimenterBuilder();
caseBuilder.setMultipartRequestExperimenter(experimenterBuilder.build());
return builder.build();
}
- private MultipartRequestExperimenterCase setExperimenter(ByteBuf input) {
+ private static MultipartRequestExperimenterCase setExperimenter(ByteBuf input) {
MultipartRequestExperimenterCaseBuilder caseBuilder = new MultipartRequestExperimenterCaseBuilder();
MultipartRequestExperimenterBuilder experimenterBuilder = new MultipartRequestExperimenterBuilder();
caseBuilder.setMultipartRequestExperimenter(experimenterBuilder.build());
return caseBuilder.build();
}
- private MultipartRequestQueueCase setQueue(ByteBuf input) {
+ private static MultipartRequestQueueCase setQueue(ByteBuf input) {
final MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder queueBuilder = new MultipartRequestQueueBuilder();
queueBuilder.setPortNo((long) input.readUnsignedShort());
return caseBuilder.build();
}
- private MultipartRequestPortStatsCase setPortStats(ByteBuf input) {
+ private static MultipartRequestPortStatsCase setPortStats(ByteBuf input) {
MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
MultipartRequestPortStatsBuilder portBuilder = new MultipartRequestPortStatsBuilder();
portBuilder.setPortNo((long) input.readUnsignedShort());
return caseBuilder.build();
}
- private MultipartRequestTableCase setTable(ByteBuf input) {
+ private static MultipartRequestTableCase setTable(ByteBuf input) {
MultipartRequestTableCaseBuilder caseBuilder = new MultipartRequestTableCaseBuilder();
MultipartRequestTableBuilder tableBuilder = new MultipartRequestTableBuilder();
tableBuilder.setEmpty(Empty.getInstance());
return caseBuilder.build();
}
- private MultipartRequestDescCase setDesc(ByteBuf input) {
+ private static MultipartRequestDescCase setDesc(ByteBuf input) {
MultipartRequestDescCaseBuilder caseBuilder = new MultipartRequestDescCaseBuilder();
MultipartRequestDescBuilder descBuilder = new MultipartRequestDescBuilder();
descBuilder.setEmpty(Empty.getInstance());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.serialization.action;
import io.netty.buffer.ByteBuf;
@Override
public void serialize(final Action action, final ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(((SetDlDstCase) action.getActionChoice())
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(((SetDlDstCase) action.getActionChoice())
.getSetDlDstAction().getDlDstAddress()));
outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.serialization.action;
import io.netty.buffer.ByteBuf;
@Override
public void serialize(final Action action, final ByteBuf outBuffer) {
super.serialize(action, outBuffer);
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(((SetDlSrcCase) action.getActionChoice())
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(((SetDlSrcCase) action.getActionChoice())
.getSetDlSrcAction().getDlSrcAddress()));
outBuffer.writeZero(ActionConstants.PADDING_IN_DL_ADDRESS_ACTION);
}
protected int getLength() {
return ActionConstants.LARGER_ACTION_LENGTH;
}
-
}
// TODO: experimenterBody does not have get methods
}
- private void writeFlags(final MultipartRequestFlags flags, final ByteBuf outBuffer) {
+ private static void writeFlags(final MultipartRequestFlags flags, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, flags.isOFPMPFREQMORE());
int bitmap = ByteBufUtils.fillBitMaskFromMap(map);
return result;
}
- private void writeTableConfig(final TableConfig tableConfig, final ByteBuf outBuffer) {
+ private static void writeTableConfig(final TableConfig tableConfig, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, tableConfig.isOFPTCDEPRECATEDMASK());
int bitmap = ByteBufUtils.fillBitMaskFromMap(map);
outBuffer.writeInt(bitmap);
}
- private void serializeMeterFeaturesBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeMeterFeaturesBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyMeterFeaturesCase meterFeaturesCase = (MultipartReplyMeterFeaturesCase) body;
MultipartReplyMeterFeatures meterFeatures = meterFeaturesCase.getMultipartReplyMeterFeatures();
outBuffer.writeInt(meterFeatures.getMaxMeter().intValue());
outBuffer.writeZero(METER_FEATURES_PADDING);
}
- private void writeBandTypes(final MeterBandTypeBitmap bandTypes, final ByteBuf outBuffer) {
+ private static void writeBandTypes(final MeterBandTypeBitmap bandTypes, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, bandTypes.isOFPMBTDROP());
map.put(1, bandTypes.isOFPMBTDSCPREMARK());
outBuffer.writeInt(bitmap);
}
- private void serializeMeterConfigBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeMeterConfigBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyMeterConfigCase meterConfigCase = (MultipartReplyMeterConfigCase) body;
MultipartReplyMeterConfig meter = meterConfigCase.getMultipartReplyMeterConfig();
for (MeterConfig meterConfig : meter.getMeterConfig()) {
outBuffer.writeInt(meterBand.getBurstSize().intValue());
}
- private void writeMeterFlags(final MeterFlags flags, final ByteBuf outBuffer) {
+ private static void writeMeterFlags(final MeterFlags flags, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, flags.isOFPMFKBPS());
map.put(1, flags.isOFPMFPKTPS());
outBuffer.writeShort(bitmap);
}
- private void serializeMeterBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeMeterBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyMeterCase meterCase = (MultipartReplyMeterCase) body;
MultipartReplyMeter meter = meterCase.getMultipartReplyMeter();
for (MeterStats meterStats : meter.getMeterStats()) {
}
}
- private void serializeGroupFeaturesBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeGroupFeaturesBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyGroupFeaturesCase groupFeaturesCase = (MultipartReplyGroupFeaturesCase) body;
MultipartReplyGroupFeatures groupFeatures = groupFeaturesCase.getMultipartReplyGroupFeatures();
writeGroupTypes(groupFeatures.getTypes(), outBuffer);
}
}
- private void writeActionType(final ActionType action, final ByteBuf outBuffer) {
+ private static void writeActionType(final ActionType action, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, action.isOFPATOUTPUT());
map.put(1, action.isOFPATCOPYTTLOUT());
outBuffer.writeInt(bitmap);
}
- private void writeGroupCapabilities(final GroupCapabilities capabilities, final ByteBuf outBuffer) {
+ private static void writeGroupCapabilities(final GroupCapabilities capabilities, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, capabilities.isOFPGFCSELECTWEIGHT());
map.put(1, capabilities.isOFPGFCSELECTLIVENESS());
outBuffer.writeInt(bitmap);
}
- private void writeGroupTypes(final GroupTypes types, final ByteBuf outBuffer) {
+ private static void writeGroupTypes(final GroupTypes types, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, types.isOFPGTALL());
map.put(1, types.isOFPGTSELECT());
}
}
- private void serializeGroupBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeGroupBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyGroupCase groupCase = (MultipartReplyGroupCase) body;
MultipartReplyGroup group = groupCase.getMultipartReplyGroup();
for (GroupStats groupStats : group.getGroupStats()) {
}
}
- private void serializeQueueBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeQueueBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyQueueCase queueCase = (MultipartReplyQueueCase) body;
MultipartReplyQueue queue = queueCase.getMultipartReplyQueue();
for (QueueStats queueStats : queue.getQueueStats()) {
}
}
- private void serializePortStatsBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializePortStatsBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyPortStatsCase portStatsCase = (MultipartReplyPortStatsCase) body;
MultipartReplyPortStats portStats = portStatsCase.getMultipartReplyPortStats();
for (PortStats portStat : portStats.getPortStats()) {
}
}
- private void serializeTableBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeTableBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyTableCase tableCase = (MultipartReplyTableCase) body;
MultipartReplyTable table = tableCase.getMultipartReplyTable();
for (TableStats tableStats : table.getTableStats()) {
}
}
- private void serializeAggregateBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeAggregateBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyAggregateCase aggregateCase = (MultipartReplyAggregateCase) body;
MultipartReplyAggregate aggregate = aggregateCase.getMultipartReplyAggregate();
outBuffer.writeLong(aggregate.getPacketCount().longValue());
}
}
- private void serializeDescBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializeDescBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyDescCase descCase = (MultipartReplyDescCase) body;
MultipartReplyDesc desc = descCase.getMultipartReplyDesc();
write256String(desc.getMfrDesc(), outBuffer);
write256String(desc.getDpDesc(), outBuffer);
}
- private void write256String(final String toWrite, final ByteBuf outBuffer) {
+ private static void write256String(final String toWrite, final ByteBuf outBuffer) {
byte[] nameBytes = toWrite.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 256) {
byte[] nameBytesPadding = new byte[256];
}
}
- private void write32String(final String toWrite, final ByteBuf outBuffer) {
+ private static void write32String(final String toWrite, final ByteBuf outBuffer) {
byte[] nameBytes = toWrite.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 32) {
byte[] nameBytesPadding = new byte[32];
}
}
- private void serializePortDescBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
+ private static void serializePortDescBody(final MultipartReplyBody body, final ByteBuf outBuffer) {
MultipartReplyPortDescCase portCase = (MultipartReplyPortDescCase) body;
MultipartReplyPortDesc portDesc = portCase.getMultipartReplyPortDesc();
for (Ports port : portDesc.getPorts()) {
outBuffer.writeInt(port.getPortNo().intValue()); // Assuming PortNo
// = PortId
outBuffer.writeZero(PORT_DESC_PADDING_1);
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(port.getHwAddr()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(port.getHwAddr()));
outBuffer.writeZero(PORT_DESC_PADDING_2);
writeName(port.getName(), outBuffer);
writePortConfig(port.getConfig(), outBuffer);
}
}
- private void writeName(final String name, final ByteBuf outBuffer) {
+ private static void writeName(final String name, final ByteBuf outBuffer) {
byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 16) {
byte[] nameBytesPadding = new byte[16];
} else {
outBuffer.writeBytes(nameBytes);
}
-
}
- private void writePortConfig(final PortConfig config, final ByteBuf outBuffer) {
+ private static void writePortConfig(final PortConfig config, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, config.isPortDown());
map.put(2, config.isNoRecv());
outBuffer.writeInt(bitmap);
}
- private void writePortState(final PortState state, final ByteBuf outBuffer) {
+ private static void writePortState(final PortState state, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, state.isLinkDown());
map.put(1, state.isBlocked());
outBuffer.writeInt(bitmap);
}
- private void writePortFeatures(final PortFeatures features, final ByteBuf outBuffer) {
+ private static void writePortFeatures(final PortFeatures features, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, features.is_10mbHd());
map.put(1, features.is_10mbFd());
outBuffer.writeInt(createActionsV10(message.getActionsV10()));
for (PhyPort port : message.getPhyPort()) {
outBuffer.writeShort(port.getPortNo().intValue());
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(port.getHwAddr()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(port.getHwAddr()));
writeName(port.getName(), outBuffer);
writePortConfig(port.getConfigV10(), outBuffer);
writePortState(port.getStateV10(), outBuffer);
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
- private void writePortFeature(final PortFeaturesV10 feature, final ByteBuf outBuffer) {
+ private static void writePortFeature(final PortFeaturesV10 feature, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, feature.is_10mbHd());
map.put(1, feature.is_10mbFd());
outBuffer.writeInt(bitmap);
}
- private void writePortState(final PortStateV10 state, final ByteBuf outBuffer) {
+ private static void writePortState(final PortStateV10 state, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, state.isLinkDown());
map.put(1, state.isBlocked());
outBuffer.writeInt(bitmap);
}
- private void writePortConfig(final PortConfigV10 config, final ByteBuf outBuffer) {
+ private static void writePortConfig(final PortConfigV10 config, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, config.isPortDown());
map.put(1, config.isNoStp());
}
- private void writeName(final String name, final ByteBuf outBuffer) {
+ private static void writeName(final String name, final ByteBuf outBuffer) {
byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 16) {
byte[] nameBytesPadding = new byte[16];
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
import io.netty.buffer.ByteBuf;
public void serialize(final PortModInput message, final ByteBuf outBuffer) {
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeShort(message.getPortNo().getValue().intValue());
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(message.getHwAddress()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHwAddress()));
outBuffer.writeInt(createPortConfigBitmask(message.getConfigV10()));
outBuffer.writeInt(createPortConfigBitmask(message.getMaskV10()));
outBuffer.writeInt(createPortFeaturesBitmask(message.getAdvertiseV10()));
outBuffer.writeByte(message.getReason().getIntValue());
outBuffer.writeZero(PADDING);
outBuffer.writeShort(message.getPortNo().intValue());
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(message.getHwAddr()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHwAddr()));
writeName(message.getName(), outBuffer);
writePortConfig(message.getConfigV10(), outBuffer);
writePortState(message.getStateV10(), outBuffer);
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
- private void writePortFeature(final PortFeaturesV10 feature, final ByteBuf outBuffer) {
+ private static void writePortFeature(final PortFeaturesV10 feature, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, feature.is_10mbHd());
map.put(1, feature.is_10mbFd());
outBuffer.writeInt(bitmap);
}
- private void writePortState(final PortStateV10 state, final ByteBuf outBuffer) {
+ private static void writePortState(final PortStateV10 state, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, state.isLinkDown());
map.put(1, state.isBlocked());
outBuffer.writeInt(bitmap);
}
- private void writePortConfig(final PortConfigV10 config, final ByteBuf outBuffer) {
+ private static void writePortConfig(final PortConfigV10 config, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, config.isPortDown());
map.put(1, config.isNoStp());
outBuffer.writeInt(bitmap);
}
- private void writeName(final String name, final ByteBuf outBuffer) {
+ private static void writeName(final String name, final ByteBuf outBuffer) {
byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 16) {
byte[] nameBytesPadding = new byte[16];
// TODO: experimenterBody does not have get methods
}
- private void serializeQueueBody(MultipartReplyBody body, ByteBuf outBuffer) {
+ private static void serializeQueueBody(MultipartReplyBody body, ByteBuf outBuffer) {
MultipartReplyQueueCase queueCase = (MultipartReplyQueueCase) body;
MultipartReplyQueue queue = queueCase.getMultipartReplyQueue();
for (QueueStats queueStats : queue.getQueueStats()) {
}
}
- private void serializePortStatsBody(MultipartReplyBody body, ByteBuf outBuffer) {
+ private static void serializePortStatsBody(MultipartReplyBody body, ByteBuf outBuffer) {
MultipartReplyPortStatsCase portStatsCase = (MultipartReplyPortStatsCase) body;
MultipartReplyPortStats portStats = portStatsCase.getMultipartReplyPortStats();
for (PortStats portStat : portStats.getPortStats()) {
}
}
- private void serializeTableBody(MultipartReplyBody body, ByteBuf outBuffer) {
+ private static void serializeTableBody(MultipartReplyBody body, ByteBuf outBuffer) {
MultipartReplyTableCase tableCase = (MultipartReplyTableCase) body;
MultipartReplyTable table = tableCase.getMultipartReplyTable();
for (TableStats tableStats : table.getTableStats()) {
}
}
- private void writeFlowWildcardsV10(FlowWildcardsV10 feature, ByteBuf outBuffer) {
+ private static void writeFlowWildcardsV10(FlowWildcardsV10 feature, ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, feature.isINPORT());
map.put(1, feature.isDLVLAN());
outBuffer.writeInt(bitmap);
}
- private void serializeAggregateBody(MultipartReplyBody body, ByteBuf outBuffer) {
+ private static void serializeAggregateBody(MultipartReplyBody body, ByteBuf outBuffer) {
MultipartReplyAggregateCase aggregateCase = (MultipartReplyAggregateCase) body;
MultipartReplyAggregate aggregate = aggregateCase.getMultipartReplyAggregate();
outBuffer.writeLong(aggregate.getPacketCount().longValue());
}
}
- private void writeFlags(MultipartRequestFlags flags, ByteBuf outBuffer) {
+ private static void writeFlags(MultipartRequestFlags flags, ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, flags.isOFPMPFREQMORE());
int bitmap = ByteBufUtils.fillBitMaskFromMap(map);
outBuffer.writeShort(bitmap);
}
- private void serializeDescBody(MultipartReplyBody body, ByteBuf outBuffer) {
+ private static void serializeDescBody(MultipartReplyBody body, ByteBuf outBuffer) {
MultipartReplyDescCase descCase = (MultipartReplyDescCase) body;
MultipartReplyDesc desc = descCase.getMultipartReplyDesc();
write256String(desc.getMfrDesc(), outBuffer);
write256String(desc.getDpDesc(), outBuffer);
}
- private void write256String(String toWrite, ByteBuf outBuffer) {
+ private static void write256String(String toWrite, ByteBuf outBuffer) {
byte[] nameBytes = toWrite.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 256) {
byte[] nameBytesPadding = new byte[256];
}
}
- private void write16String(String toWrite, ByteBuf outBuffer) {
+ private static void write16String(String toWrite, ByteBuf outBuffer) {
byte[] nameBytes = toWrite.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 16) {
byte[] nameBytesPadding = new byte[16];
}
}
- private void write32String(String toWrite, ByteBuf outBuffer) {
+ private static void write32String(String toWrite, ByteBuf outBuffer) {
byte[] nameBytes = toWrite.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 32) {
byte[] nameBytesPadding = new byte[32];
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
import io.netty.buffer.ByteBuf;
ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH);
outBuffer.writeInt(message.getPortNo().getValue().intValue());
outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_01);
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(message.getHwAddress()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHwAddress()));
outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_02);
outBuffer.writeInt(createPortConfigBitmask(message.getConfig()));
outBuffer.writeInt(createPortConfigBitmask(message.getMask()));
outBuffer.writeZero(PADDING);
outBuffer.writeInt(message.getPortNo().intValue());
outBuffer.writeZero(PORT_PADDING_1);
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(message.getHwAddr()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHwAddr()));
outBuffer.writeZero(PORT_PADDING_2);
writeName(message.getName(), outBuffer);
writePortConfig(message.getConfig(), outBuffer);
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
- private void writePortConfig(final PortConfig config, final ByteBuf outBuffer) {
+ private static void writePortConfig(final PortConfig config, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, config.isPortDown());
map.put(2, config.isNoRecv());
outBuffer.writeInt(bitmap);
}
- private void writeName(final String name, final ByteBuf outBuffer) {
+ private static void writeName(final String name, final ByteBuf outBuffer) {
byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8);
if (nameBytes.length < 16) {
byte[] nameBytesPadding = new byte[16];
} else {
outBuffer.writeBytes(nameBytes);
}
-
}
- private void writePortState(final PortState state, final ByteBuf outBuffer) {
+ private static void writePortState(final PortState state, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, state.isLinkDown());
map.put(1, state.isBlocked());
outBuffer.writeInt(bitmap);
}
- private void writePortFeatures(final PortFeatures features, final ByteBuf outBuffer) {
+ private static void writePortFeatures(final PortFeatures features, final ByteBuf outBuffer) {
Map<Integer, Boolean> map = new HashMap<>();
map.put(0, features.is_10mbHd());
map.put(1, features.is_10mbFd());
ByteBufUtils.updateOFHeaderLength(outBuffer);
}
- private void serializeRateBody(RateQueueProperty body, ByteBuf outBuffer) {
+ private static void serializeRateBody(RateQueueProperty body, ByteBuf outBuffer) {
outBuffer.writeShort(body.getRate().toJava());
outBuffer.writeZero(PROPERTY_RATE_PADDING);
}
- private void serializeExperimenterBody(ExperimenterIdQueueProperty body, ByteBuf outBuffer) {
+ private static void serializeExperimenterBody(ExperimenterIdQueueProperty body, ByteBuf outBuffer) {
// TODO: Experimenter Data is vendor specific that should implement its
// own serializer
outBuffer.writeInt(body.getExperimenter().getValue().intValue());
public abstract class AbstractOxmMacAddressSerializer extends AbstractOxmMatchEntrySerializer {
protected void writeMacAddress(final MacAddress address, final ByteBuf outBuffer) {
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(address)); // 48 b + mask [OF 1.3.2 spec]
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address)); // 48 b + mask [OF 1.3.2 spec]
}
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.util;
import io.netty.buffer.ByteBuf;
* @author michal.polkorab
*/
public class OF10MatchSerializer implements OFSerializer<MatchV10> {
-
private static final byte PADDING_IN_MATCH = 1;
private static final byte PADDING_IN_MATCH_2 = 2;
private static final byte NW_SRC_SHIFT = 8;
outBuffer.writeInt(encodeWildcards(match.getWildcards(), match.getNwSrcMask().toJava(),
match.getNwDstMask().toJava()));
outBuffer.writeShort(match.getInPort().toJava());
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(match.getDlSrc()));
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(match.getDlDst()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(match.getDlSrc()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(match.getDlDst()));
outBuffer.writeShort(match.getDlVlan().toJava());
outBuffer.writeByte(match.getDlVlanPcp().toJava());
outBuffer.writeZero(PADDING_IN_MATCH);
}
- private List<Instruction> createInstructions() {
+ private static List<Instruction> createInstructions() {
final List<Instruction> instructions = new ArrayList<>();
InstructionBuilder insBuilder = new InstructionBuilder();
GotoTableCaseBuilder goToCaseBuilder = new GotoTableCaseBuilder();
return instructions;
}
- private Match createMatch() {
+ private static Match createMatch() {
MatchBuilder matchBuilder = new MatchBuilder();
matchBuilder.setType(OxmMatchType.class);
final List<MatchEntry> entries = new ArrayList<>();
Assert.assertArrayEquals("Wrong data", data, deserializedMessage.getData());
}
- private List<Action> createAction() {
+ private static List<Action> createAction() {
final List<Action> actions = new ArrayList<>();
ActionBuilder actionBuilder = new ActionBuilder();
PushVlanCaseBuilder pushVlanCaseBuilder = new PushVlanCaseBuilder();
actions.add(actionBuilder.build());
return actions;
}
-
}
serializedBuffer.skipBytes(6);
}
- private List<Queues> createQueues() {
+ private static List<Queues> createQueues() {
List<Queues> list = new ArrayList<>();
QueuesBuilder builder = new QueuesBuilder();
builder.setQueueId(new QueueId(1L));
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowjava.protocol.impl.serialization.match;
import static org.junit.Assert.assertEquals;
assertEquals(packetType, buffer.readUnsignedInt());
}
- private MatchEntry createMatchEntry(long packetType) {
+ private static MatchEntry createMatchEntry(long packetType) {
PacketTypeCase packetTypeCase = new PacketTypeCaseBuilder()
.setPacketType(new PacketTypeBuilder().setPacketType(packetType).build())
.build();
}
}
- private void logErrors(final InetSocketAddress remoteAddress, final RpcResult<EchoOutput> echoReplyValue) {
+ private static void logErrors(final InetSocketAddress remoteAddress, final RpcResult<EchoOutput> echoReplyValue) {
for (RpcError replyError : echoReplyValue.getErrors()) {
Throwable cause = replyError.getCause();
if (LOG.isWarnEnabled()) {
@Override
public void onSslConnectionError(SslConnectionError notification) {
IpAddress ip = null;
- if ((connectionContext.getConnectionAdapter() != null)
- && (connectionContext.getConnectionAdapter().getRemoteAddress() != null)
- && (connectionContext.getConnectionAdapter().getRemoteAddress().getAddress() != null)) {
+ if (connectionContext.getConnectionAdapter() != null
+ && connectionContext.getConnectionAdapter().getRemoteAddress() != null
+ && connectionContext.getConnectionAdapter().getRemoteAddress().getAddress() != null) {
ip = IpAddressBuilder.getDefaultInstance(
connectionContext.getConnectionAdapter().getRemoteAddress().getAddress().getHostAddress());
}
@Override
public void storeStatistics(final FlowAndStatisticsMapList statistics, final boolean withParents) {
- statistics.nonnullFlowAndStatisticsMapList().values()
+ statistics.nonnullFlowAndStatisticsMapList()
.forEach(stat -> {
final FlowBuilder flow = new FlowBuilder(stat)
.addAugmentation(
};
}
- private String getDpnIdFromNodeName(final String nodeName) {
+ private static String getDpnIdFromNodeName(final String nodeName) {
return nodeName.substring(nodeName.lastIndexOf(SEPARATOR) + 1);
}
return Optional.empty();
}
- private org.opendaylight.mdsal.eos.binding.api.Entity createNodeEntity(final String nodeId) {
+ private static org.opendaylight.mdsal.eos.binding.api.Entity createNodeEntity(final String nodeId) {
return new org.opendaylight.mdsal.eos.binding.api.Entity(ASYNC_SERVICE_ENTITY_TYPE, nodeId);
}
}
import org.opendaylight.openflowplugin.impl.util.MatchUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.multipart.reply.multipart.reply.body.MultipartReplyFlowStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
public MultipartReplyBody deserialize(ByteBuf message) {
final MultipartReplyFlowStatsBuilder builder = new MultipartReplyFlowStatsBuilder();
final List<FlowAndStatisticsMapList> items = new ArrayList<>();
- int key = 0;
while (message.readableBytes() > 0) {
final FlowAndStatisticsMapListBuilder itemBuilder = new FlowAndStatisticsMapListBuilder();
.build());
}
- itemBuilder.withKey(new FlowAndStatisticsMapListKey(new FlowId(String.valueOf(key++))));
items.add(itemBuilder.build());
}
.build();
}
- private TableConfig readTableConfig(final ByteBuf message) {
+ private static TableConfig readTableConfig(final ByteBuf message) {
final long input = message.readUnsignedInt();
final boolean deprecated = (input & 3) != 0;
.build();
}
- private List<SetFieldMatch> readMatchFields(final ByteBuf message, final int length) {
+ private static List<SetFieldMatch> readMatchFields(final ByteBuf message, final int length) {
final List<SetFieldMatch> matchFields = new ArrayList<>();
final int startIndex = message.readerIndex();
*/
protected static void writeMacAddress(final MacAddress address, final ByteBuf outBuffer) {
// 48 b + mask [OF 1.3.2 spec]
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(address));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address));
}
/**
outBuffer.writeInt(OpenflowPortsUtil
.getProtocolPortNumber(OpenflowVersion.OF13, message.getPortNumber()).intValue());
outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_01);
- outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(message.getHardwareAddress()));
+ outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHardwareAddress()));
outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_02);
outBuffer.writeInt(createPortConfigBitMask(message.getConfiguration()));
outBuffer.writeInt(MoreObjects
return transform(echoService.handleServiceCall(echoInputBld));
}
- private ListenableFuture<RpcResult<SendEchoOutput>>
+ private static ListenableFuture<RpcResult<SendEchoOutput>>
transform(final ListenableFuture<RpcResult<EchoOutput>> rpcResultListenableFuture) {
return Futures.transform(rpcResultListenableFuture, input -> {
Preconditions.checkNotNull(input, "echoOutput value is never expected to be NULL");
return mdInput.build();
}
- private Port getPortFromInput(final UpdatePortInput input) {
+ private static Port getPortFromInput(final UpdatePortInput input) {
return input.getUpdatedPort().getPort().nonnullPort().values().iterator().next();
}
}
}
@VisibleForTesting
- protected List<Class<? extends MeterBand>> extractSupportedMeterBand(MultipartReplyMeterFeatures replyBody,
+ protected static List<Class<? extends MeterBand>> extractSupportedMeterBand(MultipartReplyMeterFeatures replyBody,
MeterBandTypeBitmap bandTypes) {
List<Class<? extends MeterBand>> supportedMeterBand = new ArrayList<>();
if (bandTypes.isOFPMBTDROP()) {
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.MultipartReplyFlowCase;
for (final FlowAndStatisticsMapList part : flowAndStatisticsMapLists) {
final FlowId flowId = new FlowId(generateFlowId(part).getValue());
statsList.add(new FlowAndStatisticsMapListBuilder(part)
- .withKey(new FlowAndStatisticsMapListKey(flowId))
.setFlowId(flowId)
.build());
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.multipart.reply.multipart.reply.body.MultipartReplyFlowStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.multipart.request.flow.stats.FlowStatsBuilder;
.setFlowAndStatisticsMapList(input
.stream()
.flatMap(multipartReply -> ((MultipartReplyFlowStats) multipartReply.getMultipartReplyBody())
- .nonnullFlowAndStatisticsMapList().values()
+ .nonnullFlowAndStatisticsMapList()
.stream())
.map(flowAndStatisticsMapList -> {
final FlowId flowId = new FlowId(generateFlowId(flowAndStatisticsMapList));
return new FlowAndStatisticsMapListBuilder(flowAndStatisticsMapList)
- .withKey(new FlowAndStatisticsMapListKey(flowId))
.setFlowId(flowId)
.build();
})
return Uint8.valueOf(flowRemoved.getTableId().getValue());
}
- private RemovedFlowReason translateReason(final FlowRemoved removedFlow) {
+ private static RemovedFlowReason translateReason(final FlowRemoved removedFlow) {
LOG.debug("--Entering translateReason within FlowRemovedTranslator with reason: {}", removedFlow.getReason());
switch (removedFlow.getReason()) {
case OFPRRIDLETIMEOUT:
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.common;
import org.junit.Assert;
Assert.assertEquals(xid, mpRqInput.getXid().longValue());
}
- private void checkEmptyBody(Class<? extends DataContainer> mpRqBody, Class<? extends
+ private static void checkEmptyBody(Class<? extends DataContainer> mpRqBody, Class<? extends
MultipartRequestBody> expectedMpRqBodyClass) {
Assert.assertTrue(expectedMpRqBodyClass.isAssignableFrom(mpRqBody));
Assert.assertEquals(expectedMpRqBodyClass, mpRqBody);
verify(writeTx).commit();
}
- private ConnectionContext prepareConnectionContext() {
+ private static ConnectionContext prepareConnectionContext() {
final ConnectionContext mockedConnectionContext = mock(ConnectionContext.class);
final FeaturesReply mockedFeaturesReply = mock(FeaturesReply.class);
when(mockedFeaturesReply.getAuxiliaryId()).thenReturn(DUMMY_AUXILIARY_ID);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import static org.junit.Assert.assertEquals;
final MacAddress arpSourceHardwareAddressMask = new MacAddress("00:00:00:00:00:00");
writeHeader(in, false);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpSourceHardwareAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpSourceHardwareAddress));
assertEquals(arpSourceHardwareAddress.getValue(),
((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceHardwareAddress().getAddress()
assertEquals(0, in.readableBytes());
writeHeader(in, true);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpSourceHardwareAddress));
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpSourceHardwareAddressMask));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpSourceHardwareAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpSourceHardwareAddressMask));
final ArpSourceHardwareAddress desAddress =
((ArpMatch) deserialize(in).getLayer3Match()).getArpSourceHardwareAddress();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import static org.junit.Assert.assertEquals;
final MacAddress arpTargetHardwareAddressMask = new MacAddress("00:00:00:00:00:00");
writeHeader(in, false);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpTargetHardwareAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpTargetHardwareAddress));
assertEquals(arpTargetHardwareAddress.getValue(),
((ArpMatch) deserialize(in).getLayer3Match()).getArpTargetHardwareAddress().getAddress()
assertEquals(0, in.readableBytes());
writeHeader(in, true);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpTargetHardwareAddress));
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(arpTargetHardwareAddressMask));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpTargetHardwareAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(arpTargetHardwareAddressMask));
final ArpTargetHardwareAddress desAddress =
((ArpMatch) deserialize(in).getLayer3Match()).getArpTargetHardwareAddress();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import static org.junit.Assert.assertEquals;
final MacAddress ethernetDestinationAddressMask = new MacAddress("00:00:00:00:00:00");
writeHeader(in, false);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(ethernetDestinationAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetDestinationAddress));
assertEquals(ethernetDestinationAddress.getValue(), deserialize(in).getEthernetMatch().getEthernetDestination()
.getAddress().getValue());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(ethernetDestinationAddress));
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(ethernetDestinationAddressMask));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetDestinationAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetDestinationAddressMask));
final EthernetDestination desAddress = deserialize(in).getEthernetMatch().getEthernetDestination();
assertEquals(ethernetDestinationAddress.getValue(), desAddress.getAddress().getValue());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import static org.junit.Assert.assertEquals;
final MacAddress ethernetSourceAddressMask = new MacAddress("00:00:00:00:00:00");
writeHeader(in, false);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(ethernetSourceAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetSourceAddress));
assertEquals(ethernetSourceAddress.getValue(),
deserialize(in).getEthernetMatch().getEthernetSource().getAddress().getValue());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(ethernetSourceAddress));
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(ethernetSourceAddressMask));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetSourceAddress));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethernetSourceAddressMask));
final EthernetSource desAddress = deserialize(in).getEthernetMatch().getEthernetSource();
assertEquals(ethernetSourceAddress.getValue(), desAddress.getAddress().getValue());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import static org.junit.Assert.assertEquals;
final MacAddress address = new MacAddress("00:01:02:03:04:05");
writeHeader(in, false);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(address));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address));
Ipv6Match match = (Ipv6Match) deserialize(in).getLayer3Match();
assertEquals(address.getValue(), match.getIpv6NdSll().getValue());
protected int getValueLength() {
return EncodeConstants.MAC_ADDRESS_LENGTH;
}
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.match;
import static org.junit.Assert.assertEquals;
final MacAddress address = new MacAddress("00:01:02:03:04:05");
writeHeader(in, false);
- in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(address));
+ in.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(address));
Ipv6Match match = (Ipv6Match) deserialize(in).getLayer3Match();
assertEquals(address.getValue(), match.getIpv6NdTll().getValue());
protected int getValueLength() {
return EncodeConstants.MAC_ADDRESS_LENGTH;
}
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.messages;
import static org.junit.Assert.assertEquals;
buffer.writeInt(XID);
buffer.writeInt(PORT);
buffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_1);
- buffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(ADDRESS));
+ buffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ADDRESS));
final int config = ByteBufUtils.fillBitMaskFromMap(ImmutableMap
.<Integer, Boolean>builder()
final MultipartReplyFlowStats reply = (MultipartReplyFlowStats) deserializeMultipart(buffer);
final FlowAndStatisticsMapList flowAndStatisticsMapList =
- reply.nonnullFlowAndStatisticsMapList().values().iterator().next();
+ reply.nonnullFlowAndStatisticsMapList().iterator().next();
assertEquals(TABLE_ID, flowAndStatisticsMapList.getTableId().shortValue());
assertEquals(SECOND, flowAndStatisticsMapList.getDuration().getSecond().getValue().intValue());
assertEquals(NANOSECOND, flowAndStatisticsMapList.getDuration().getNanosecond().getValue().intValue());
assertEquals(XID, message.getXid().intValue());
final FlowAndStatisticsMapList flowAndStatisticsMapList =
- reply.nonnullFlowAndStatisticsMapList().values().iterator().next();
+ reply.nonnullFlowAndStatisticsMapList().iterator().next();
assertEquals(TABLE_ID, flowAndStatisticsMapList.getTableId().shortValue());
assertEquals(SECOND, flowAndStatisticsMapList.getDuration().getSecond().getValue().intValue());
assertEquals(NANOSECOND, flowAndStatisticsMapList.getDuration().getNanosecond().getValue().intValue());
return MultipartType.OFPMPMETERCONFIG.getIntValue();
}
- private void writeCommonAtributes(final ByteBuf buffer) {
+ private static void writeCommonAtributes(final ByteBuf buffer) {
buffer.writeShort(ITEM_LENGTH);
buffer.writeShort(ByteBufUtils.fillBitMask(0,
FLAGS.isMeterKbps(),
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart;
import static org.junit.Assert.assertEquals;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.set.field.match.SetFieldMatch;
public class TableFeaturesMatchFieldDeserializerTest {
- private TableFeaturesMatchFieldDeserializer deserializer = new TableFeaturesMatchFieldDeserializer();
+ private final TableFeaturesMatchFieldDeserializer deserializer = new TableFeaturesMatchFieldDeserializer();
@Test
public void deserialize() {
assertEquals(0, buffer.readableBytes());
}
- private void addValues(ByteBuf buffer, int oxmClass, int oxmField) {
+ private static void addValues(ByteBuf buffer, int oxmClass, int oxmField) {
buffer.clear();
buffer.writeShort(oxmClass);
buffer.writeByte(oxmField << 1);
FlowsStatisticsUpdate flowStats = FLOWS_STATISTICS_UPDATE_BUILDER.build();
HashSet<FlowRegistryKey> flowRegistryKeys = new HashSet<>();
- for (FlowAndStatisticsMapList item : flowStats.nonnullFlowAndStatisticsMapList().values()) {
+ for (FlowAndStatisticsMapList item : flowStats.nonnullFlowAndStatisticsMapList()) {
final FlowRegistryKey key1 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), item);
final FlowRegistryKey key2 = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), item);
flowRegistryKeys.add(key1);
public void testGetHash() {
FlowsStatisticsUpdate flowStats = FLOWS_STATISTICS_UPDATE_BUILDER.build();
- for (FlowAndStatisticsMapList item : flowStats.nonnullFlowAndStatisticsMapList().values()) {
+ for (FlowAndStatisticsMapList item : flowStats.nonnullFlowAndStatisticsMapList()) {
FlowRegistryKey flowRegistryKey = FlowRegistryKeyFactory.create(deviceInfo.getVersion(), item);
FlowRegistryKey lastHash = null;
if (null != lastHash) {
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
matchBuilder.setEthernetMatch(ethernetMatchBuilder.build());
flowAndStatisticsMapListBuilder.setMatch(matchBuilder.build());
- flowAndStatisticsMapListBuilder.withKey(new FlowAndStatisticsMapListKey(new FlowId(String.valueOf(index))));
+ flowAndStatisticsMapListBuilder.setFlowId(new FlowId(String.valueOf(index)));
return flowAndStatisticsMapListBuilder;
}
}
import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collection;
+import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.openflowjava.protocol.api.connection.DeviceRequestFailedException;
public void onSuccess(final Object object) {
}
-
};
-
}
@Test
assertEquals(DUMMY_MESSAGE_ILLEGAL_STATE_EXCEPTION, rpcError.getMessage());
}
- private RpcError provideRpcError(final ListenableFuture futureResult) throws InterruptedException,
- java.util.concurrent.ExecutionException {
+ private static RpcError provideRpcError(final ListenableFuture futureResult)
+ throws InterruptedException, ExecutionException {
final Object result = futureResult.get();
assertTrue(result instanceof RpcResult);
RpcResult rpcResult = (RpcResult) result;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.batch;
import com.google.common.collect.Lists;
Assert.assertEquals("2", iterator.next().getFlowId().getValue());
}
- private FlatBatchAddFlow createAddFlowBatch(final String flowIdValue) {
+ private static FlatBatchAddFlow createAddFlowBatch(final String flowIdValue) {
return new FlatBatchAddFlowBuilder()
.setFlowId(new FlowId(flowIdValue))
.build();
}
- private FlatBatchRemoveFlow createRemoveFlowBatch(final String flowIdValue) {
+ private static FlatBatchRemoveFlow createRemoveFlowBatch(final String flowIdValue) {
return new FlatBatchRemoveFlowBuilder()
.setFlowId(new FlowId(flowIdValue))
.build();
}
- private FlatBatchUpdateFlow createUpdateFlowBatch(final String flowIdValue) {
+ private static FlatBatchUpdateFlow createUpdateFlowBatch(final String flowIdValue) {
return new FlatBatchUpdateFlowBuilder()
.setFlowId(new FlowId(flowIdValue))
.build();
Assert.assertEquals(0, rpcResult.getResult().nonnullBatchFailure().size());
}
- private BatchFailedFlowsOutput createBatchFailedFlowsOutput(final Integer batchOrder, final String flowIdValue) {
+ private static BatchFailedFlowsOutput createBatchFailedFlowsOutput(final Integer batchOrder,
+ final String flowIdValue) {
return new BatchFailedFlowsOutputBuilder()
.setFlowId(new FlowId(flowIdValue))
.setBatchOrder(batchOrder)
.build();
}
- private BatchFailure createChainFailure(final int batchOrder, final String flowIdValue) {
+ private static BatchFailure createChainFailure(final int batchOrder, final String flowIdValue) {
return new BatchFailureBuilder()
.setBatchOrder(batchOrder)
.setBatchItemIdChoice(new FlatBatchFailureFlowIdCaseBuilder()
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.batch;
import com.google.common.collect.Lists;
Assert.assertEquals(2L, iterator.next().getGroupId().getValue().longValue());
}
- private FlatBatchAddGroup createAddGroupBatch(final long groupIdValue) {
+ private static FlatBatchAddGroup createAddGroupBatch(final long groupIdValue) {
return new FlatBatchAddGroupBuilder()
.setGroupId(new GroupId(groupIdValue))
.build();
}
- private FlatBatchRemoveGroup createRemoveGroupBatch(final long groupIdValue) {
+ private static FlatBatchRemoveGroup createRemoveGroupBatch(final long groupIdValue) {
return new FlatBatchRemoveGroupBuilder()
.setGroupId(new GroupId(groupIdValue))
.build();
}
- private FlatBatchUpdateGroup createUpdateGroupBatch(final long groupIdValue) {
+ private static FlatBatchUpdateGroup createUpdateGroupBatch(final long groupIdValue) {
return new FlatBatchUpdateGroupBuilder()
.setOriginalBatchedGroup(new OriginalBatchedGroupBuilder()
.setGroupId(new GroupId(groupIdValue))
Assert.assertEquals(0, rpcResult.getResult().nonnullBatchFailure().size());
}
- private BatchFailedGroupsOutput createBatchFailedGroupsOutput(final Integer batchOrder, final long groupIdValue) {
+ private static BatchFailedGroupsOutput createBatchFailedGroupsOutput(final Integer batchOrder,
+ final long groupIdValue) {
return new BatchFailedGroupsOutputBuilder()
.setGroupId(new GroupId(groupIdValue))
.setBatchOrder(batchOrder)
.build();
}
- private BatchFailure createChainFailure(final int batchOrder, final long groupIdValue) {
+ private static BatchFailure createChainFailure(final int batchOrder, final long groupIdValue) {
return new BatchFailureBuilder()
.setBatchOrder(batchOrder)
.setBatchItemIdChoice(new FlatBatchFailureGroupIdCaseBuilder()
Assert.assertEquals(2L, it.next().getMeterId().getValue().longValue());
}
- private FlatBatchAddMeter createAddMeterBatch(final long groupIdValue) {
+ private static FlatBatchAddMeter createAddMeterBatch(final long groupIdValue) {
return new FlatBatchAddMeterBuilder()
.setMeterId(new MeterId(groupIdValue))
.build();
}
- private FlatBatchRemoveMeter createRemoveMeterBatch(final long groupIdValue) {
+ private static FlatBatchRemoveMeter createRemoveMeterBatch(final long groupIdValue) {
return new FlatBatchRemoveMeterBuilder()
.setMeterId(new MeterId(groupIdValue))
.build();
}
- private FlatBatchUpdateMeter createUpdateMeterBatch(final long groupIdValue) {
+ private static FlatBatchUpdateMeter createUpdateMeterBatch(final long groupIdValue) {
return new FlatBatchUpdateMeterBuilder()
.setOriginalBatchedMeter(new OriginalBatchedMeterBuilder()
.setMeterId(new MeterId(groupIdValue))
Assert.assertEquals(0, rpcResult.getResult().nonnullBatchFailure().size());
}
- private BatchFailedMetersOutput createBatchFailedMetersOutput(final Integer batchOrder, final long groupIdValue) {
+ private static BatchFailedMetersOutput createBatchFailedMetersOutput(final Integer batchOrder,
+ final long groupIdValue) {
return new BatchFailedMetersOutputBuilder()
.setMeterId(new MeterId(groupIdValue))
.setBatchOrder(batchOrder)
.build();
}
- private BatchFailure createChainFailure(final int batchOrder, final long groupIdValue) {
+ private static BatchFailure createChainFailure(final int batchOrder, final long groupIdValue) {
return new BatchFailureBuilder()
.setBatchOrder(batchOrder)
.setBatchItemIdChoice(new FlatBatchFailureMeterIdCaseBuilder()
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.sal;
import static org.junit.Assert.assertEquals;
assertEquals(DUMMY_XID_VALUE, setConfigInput.getXid());
}
- private SetConfigInput dummyConfigInput() {
+ private static SetConfigInput dummyConfigInput() {
SetConfigInputBuilder setConfigInputBuilder = new SetConfigInputBuilder();
setConfigInputBuilder.setFlag(DUMMY_FLAG_STR);
setConfigInputBuilder.setMissSearchLength(DUMMY_MISS_SEARCH_LENGTH);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.services.sal;
import com.google.common.collect.Lists;
return createFlowAddBatch(batchOrder, flowIdValue, 1);
}
- private Batch createFlowAddBatch(final int batchOrder, final String flowIdValue, final int amount) {
+ private static Batch createFlowAddBatch(final int batchOrder, final String flowIdValue, final int amount) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchAddFlowCaseBuilder()
.build();
}
- private List<FlatBatchAddFlow> repeatFlatBatchAddFlowInList(final String flowIdValue, final int amount) {
+ private static List<FlatBatchAddFlow> repeatFlatBatchAddFlowInList(final String flowIdValue, final int amount) {
final List<FlatBatchAddFlow> list = new ArrayList<>();
for (int i = 0; i < amount; i++) {
list.add(new FlatBatchAddFlowBuilder()
return list;
}
- private <T> List<T> repeatInList(final T item, final int amount) {
+ private static <T> List<T> repeatInList(final T item, final int amount) {
final List<T> list = new ArrayList<>();
for (int i = 0; i < amount; i++) {
list.add(item);
return list;
}
- private Batch createFlowRemoveBatch(final int batchOrder, final String flowIdValue) {
+ private static Batch createFlowRemoveBatch(final int batchOrder, final String flowIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchRemoveFlowCaseBuilder()
.build();
}
- private Batch createFlowUpdateBatch(final int batchOrder, final String flowIdValue) {
+ private static Batch createFlowUpdateBatch(final int batchOrder, final String flowIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.withKey(new BatchKey(batchOrder))
.build();
}
- private Batch createGroupAddBatch(final int batchOrder, final long groupIdValue) {
+ private static Batch createGroupAddBatch(final int batchOrder, final long groupIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchAddGroupCaseBuilder()
.build();
}
- private Batch createGroupRemoveBatch(final int batchOrder, final long groupIdValue) {
+ private static Batch createGroupRemoveBatch(final int batchOrder, final long groupIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchRemoveGroupCaseBuilder()
.build();
}
- private Batch createGroupUpdateBatch(final int batchOrder, final long groupIdValue) {
+ private static Batch createGroupUpdateBatch(final int batchOrder, final long groupIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchUpdateGroupCaseBuilder()
.build();
}
- private Batch createMeterAddBatch(final int batchOrder, final long groupIdValue) {
+ private static Batch createMeterAddBatch(final int batchOrder, final long groupIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchAddMeterCaseBuilder()
.build();
}
- private Batch createMeterRemoveBatch(final int batchOrder, final long groupIdValue) {
+ private static Batch createMeterRemoveBatch(final int batchOrder, final long groupIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchRemoveMeterCaseBuilder()
.build();
}
- private Batch createMeterUpdateBatch(final int batchOrder, final long groupIdValue) {
+ private static Batch createMeterUpdateBatch(final int batchOrder, final long groupIdValue) {
return new BatchBuilder()
.setBatchOrder(batchOrder)
.setBatchChoice(new FlatBatchUpdateMeterCaseBuilder()
.getFlowId().getValue());
}
- private BatchFailure createFlowBatchFailure(final int batchOrder, final String flowIdValue) {
+ private static BatchFailure createFlowBatchFailure(final int batchOrder, final String flowIdValue) {
return new BatchFailureBuilder()
.setBatchOrder(batchOrder)
.setBatchItemIdChoice(new FlatBatchFailureFlowIdCaseBuilder()
.build();
}
- private ProcessFlatBatchOutput createFlatBatchOutput(final BatchFailure... batchFailures) {
+ private static ProcessFlatBatchOutput createFlatBatchOutput(final BatchFailure... batchFailures) {
return new ProcessFlatBatchOutputBuilder()
.setBatchFailure(Lists.newArrayList(batchFailures))
.build();
final OfHeader ofHeader = salPortService.buildRequest(new Xid(DUMMY_XID), dummyUpdatePortInput());
}
- private UpdatePortInput dummyUpdatePortInput() {
+ private static UpdatePortInput dummyUpdatePortInput() {
org.opendaylight.yang.gen.v1.urn
.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder concretePortBuilder
= new org.opendaylight.yang.gen.v1.urn
verify(mockedRequestContextStack).createRequestContext();
}
- private UpdateTableInput prepareUpdateTable() {
+ private static UpdateTableInput prepareUpdateTable() {
UpdateTableInputBuilder updateTableInputBuilder = new UpdateTableInputBuilder();
UpdatedTableBuilder updatedTableBuilder = new UpdatedTableBuilder();
updatedTableBuilder.setTableFeatures(Collections.emptyList());
assertEquals(DUMMY_GROUPS_TYPE,groupDescStat.getGroupType());
}
- private MultipartReplyBody prepareMultipartReplyGroupDesc() {
+ private static MultipartReplyBody prepareMultipartReplyGroupDesc() {
GroupDescBuilder groupDescBuilder = new GroupDescBuilder();
groupDescBuilder.setGroupId(DUMMY_GROUP_ID);
groupDescBuilder.setBucketsList(Collections.emptyList());
return multipartReplyGroupDescCaseBuilder.build();
}
- private MultipartReplyBody prepareMultipartReplyGroup() {
+ private static MultipartReplyBody prepareMultipartReplyGroup() {
GroupStatsBuilder groupStatsBuilder = new GroupStatsBuilder();
groupStatsBuilder.setByteCount(DUMMY_BYTE_COUNT);
groupStatsBuilder.setBucketStats(Collections.emptyList());
return multipartReplyGroupCaseBuilder.build();
}
- private MultipartReplyBody prepareMultipartReplyPortStats() {
+ private static MultipartReplyBody prepareMultipartReplyPortStats() {
PortStatsBuilder dummyPortStatBuilder = new PortStatsBuilder();
dummyPortStatBuilder.setPortNo(DUMMY_PORT_NO);
dummyPortStatBuilder.setRxBytes(DUMMY_RX_BYTES);
}
- private MultipartReplyBody prepareMultipartReplyAggregate() {
+ private static MultipartReplyBody prepareMultipartReplyAggregate() {
MultipartReplyAggregateBuilder multipartReplyAggregateBuilder = new MultipartReplyAggregateBuilder();
multipartReplyAggregateBuilder.setByteCount(DUMMY_BYTE_COUNT);
multipartReplyAggregateBuilder.setPacketCount(DUMMY_PACKET_COUNT);
return multipartReplyAggregateCaseBuilder.build();
}
- private MultipartReplyBody prepareMultipartReplyFlow() {
+ private static MultipartReplyBody prepareMultipartReplyFlow() {
MultipartReplyFlowCaseBuilder multipartReplyFlowCaseBuilder = new MultipartReplyFlowCaseBuilder();
MultipartReplyFlowBuilder multipartReplyFlowBuilder = new MultipartReplyFlowBuilder();
multipartReplyFlowBuilder.setFlowStats(Collections.emptyList());
return multipartReplyFlowCaseBuilder.build();
}
- private MultipartReplyMessage prepareMocks(final DeviceContext mockedDeviceContext,
+ private static MultipartReplyMessage prepareMocks(final DeviceContext mockedDeviceContext,
final MultipartReplyBody multipartReplyBody,
final MultipartType multipartType) {
ConnectionContext mockedConnectionContext = mock(ConnectionContext.class);
return multipartReplyMessage;
}
- private DataContainer validateOutput(final DataContainer dataObject) {
+ private static DataContainer validateOutput(final DataContainer dataObject) {
return dataObject;
}
}
Assert.assertEquals(42, flow.getValue().getTableId().intValue());
}
- private Iterable<FlowsStatisticsUpdate> prepareFlowStatisticsData() {
+ private static Iterable<FlowsStatisticsUpdate> prepareFlowStatisticsData() {
final FlowAndStatisticsMapListBuilder flowAndStatsMapListBld = new FlowAndStatisticsMapListBuilder();
flowAndStatsMapListBld.setTableId((short) 42);
flowAndStatsMapListBld.setMatch(new MatchBuilder().build());
Assert.assertTrue(timeCounter.getAverageTimeBetweenMarks() >= 3);
}
- private void zzz(long length) {
+ private static void zzz(long length) {
try {
Thread.sleep(length);
} catch (InterruptedException e) {
import org.junit.Test;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
-
public class MessageIntelligenceAgencyImplTest {
@Test
"FROM_SWITCH: MSG[String] -> +1 | 1", "TO_SWITCH_ENTERED: MSG[Integer] -> +1 | 1");
}
- private void findExpectedStatistics(final List<String> statisticsInfo, String ... expectedValues) {
+ private static void findExpectedStatistics(final List<String> statisticsInfo, String ... expectedValues) {
for (String expectedValue : expectedValues) {
assertTrue("Expected value " + expectedValue + "wasn't found.",
findValueInStatistics(statisticsInfo, expectedValue));
}
}
- private boolean findValueInStatistics(List<String> statisticsInfo, String expectedValue) {
+ private static boolean findValueInStatistics(List<String> statisticsInfo, String expectedValue) {
for (String pieceOfInfo : statisticsInfo) {
if (pieceOfInfo.equals(expectedValue)) {
return true;
import java.math.BigInteger;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowAndStatisticsMap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
final GetFlowStatisticsOutput output = service.buildReply(input, true);
assertTrue(output.nonnullFlowAndStatisticsMapList().size() > 0);
- final FlowAndStatisticsMap stats = output.nonnullFlowAndStatisticsMapList().values().iterator().next();
+ final FlowAndStatisticsMap stats = output.nonnullFlowAndStatisticsMapList().iterator().next();
assertEquals(stats.getTableId(), TABLE_NO);
}
when(stat.getTableId()).thenReturn(TABLE_NO);
when(stat.getMatch()).thenReturn(new MatchBuilder().build());
- final Map<FlowAndStatisticsMapListKey, FlowAndStatisticsMapList> stats
- = Collections.singletonMap(stat.key(), stat);
+ final List<FlowAndStatisticsMapList> stats = Collections.singletonList(stat);
final GetFlowStatisticsOutput output = mock(GetFlowStatisticsOutput.class);
when(output.nonnullFlowAndStatisticsMapList()).thenReturn(stats);
import static org.mockito.Mockito.when;
import java.math.BigInteger;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.Map;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
import org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry;
import org.opendaylight.openflowplugin.impl.statistics.services.direct.AbstractDirectStatisticsServiceTest;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.direct.statistics.rev160511.GetFlowStatisticsOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowAndStatisticsMap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.and.statistics.map.list.FlowAndStatisticsMapListKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.multipart.reply.multipart.reply.body.MultipartReplyFlowStatsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.multipart.request.multipart.request.body.MultipartRequestFlowStats;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.DurationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartReply;
import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartReplyBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112.MultipartRequest;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.MultipartType;
+import org.opendaylight.yangtools.yang.common.Uint16;
import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint64;
import org.opendaylight.yangtools.yang.common.Uint8;
public class FlowDirectStatisticsServiceTest extends AbstractDirectStatisticsServiceTest {
@Override
public void setUp() {
+ final DeviceFlowRegistry registry = mock(DeviceFlowRegistry.class);
service = new FlowDirectStatisticsService(requestContextStack,
deviceContext,
convertorManager,
multipartWriterProvider);
- final DeviceFlowRegistry registry = mock(DeviceFlowRegistry.class);
when(registry.retrieveDescriptor(any())).thenReturn(FlowDescriptorFactory.create(TABLE_NO, new FlowId("1")));
when(deviceContext.getDeviceFlowRegistry()).thenReturn(registry);
}
final FlowAndStatisticsMapList flowStat = new FlowAndStatisticsMapListBuilder()
.setDuration(new DurationBuilder()
.setSecond(new Counter32(1L))
- .setNanosecond(new Counter32(1L))
+ .setNanosecond(new Counter32(2L))
.build())
- .setTableId(TABLE_NO)
- .setByteCount(new Counter64(BigInteger.ONE))
- .setPacketCount(new Counter64(BigInteger.ONE))
+ .setTableId(Uint8.valueOf(50))
+ .setByteCount(new Counter64(BigInteger.valueOf(7094)))
+ .setPacketCount(new Counter64(BigInteger.valueOf(63)))
+ .setCookie(new FlowCookie(Uint64.valueOf(134419365)))
.setFlags(new FlowModFlags(true, false, false, false, false))
- .setMatch(new MatchBuilder().build())
+ .setMatch(new MatchBuilder().setEthernetMatch(
+ new EthernetMatchBuilder()
+ .setEthernetDestination(
+ new EthernetDestinationBuilder()
+ .setAddress(new MacAddress("fa:16:3e:92:81:45"))
+ .build()).build()).build())
+ .setInstructions(new InstructionsBuilder().build())
+ .setPriority(Uint16.valueOf(20))
.build();
final MultipartReply reply = new MultipartReplyBuilder()
.build())
.build();
- final List<MultipartReply> input = Collections.singletonList(reply);
+ final FlowAndStatisticsMapList flowStat1 = new FlowAndStatisticsMapListBuilder()
+ .setDuration(new DurationBuilder()
+ .setSecond(new Counter32(1L))
+ .setNanosecond(new Counter32(2L))
+ .build())
+ .setTableId(Uint8.valueOf(51))
+ .setByteCount(new Counter64(BigInteger.valueOf(9853)))
+ .setPacketCount(new Counter64(BigInteger.valueOf(99)))
+ .setCookie(new FlowCookie(Uint64.valueOf(134550437)))
+ .setFlags(new FlowModFlags(true, false, false, false, false))
+ .setMatch(new MatchBuilder().setEthernetMatch(
+ new EthernetMatchBuilder()
+ .setEthernetDestination(
+ new EthernetDestinationBuilder()
+ .setAddress(new MacAddress("fa:16:3e:92:81:45"))
+ .build()).build()).build())
+ .setInstructions(new InstructionsBuilder().build())
+ .setPriority(Uint16.valueOf(20))
+ .build();
+
+ final MultipartReply reply1 = new MultipartReplyBuilder()
+ .setMultipartReplyBody(new MultipartReplyFlowStatsBuilder()
+ .setFlowAndStatisticsMapList(Collections.singletonList(flowStat1))
+ .build())
+ .build();
+ final List<MultipartReply> input = new ArrayList<>();
+ input.add(reply);
+ input.add(reply1);
final GetFlowStatisticsOutput output = service.buildReply(input, true);
assertTrue(output.getFlowAndStatisticsMapList().size() > 0);
-
- final FlowAndStatisticsMap stats = output.nonnullFlowAndStatisticsMapList().values().iterator().next();
-
- assertEquals(stats.getTableId(), TABLE_NO);
+ FlowAndStatisticsMap stats = output.nonnullFlowAndStatisticsMapList().iterator().next();
+ assertEquals(Uint8.valueOf(50),stats.getTableId());
+ stats = output.nonnullFlowAndStatisticsMapList().get(1);
+ assertEquals(Uint8.valueOf(51),stats.getTableId());
}
@Override
when(stat.getTableId()).thenReturn(TABLE_NO);
when(stat.getMatch()).thenReturn(new MatchBuilder().build());
- final Map<FlowAndStatisticsMapListKey, FlowAndStatisticsMapList> stats
- = Collections.singletonMap(stat.key(), stat);
+ final List<FlowAndStatisticsMapList> stats
+ = Collections.singletonList(stat);
final GetFlowStatisticsOutput output = mock(GetFlowStatisticsOutput.class);
when(output.nonnullFlowAndStatisticsMapList()).thenReturn(stats);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import com.google.common.collect.Lists;
checkSegment(batchPlanSteps.get(index++), BatchStepType.GROUP_UPDATE, 3);
}
- private void checkSegment(final BatchPlanStep planStep, final BatchStepType stepType, final int expected) {
+ private static void checkSegment(final BatchPlanStep planStep, final BatchStepType stepType, final int expected) {
Assert.assertEquals(stepType, planStep.getStepType());
Assert.assertEquals(expected, planStep.getTaskBag().size());
}
.build();
}
- private List<FlatBatchAddGroup> repeatFlatBatchAddGroupIntoList(final int size) {
+ private static List<FlatBatchAddGroup> repeatFlatBatchAddGroupIntoList(final int size) {
final List<FlatBatchAddGroup> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchAddGroupBuilder().withKey(new FlatBatchAddGroupKey(i)).build());
return list;
}
- private List<FlatBatchUpdateGroup> repeatFlatBatchUpdateGroupIntoList(final int size) {
+ private static List<FlatBatchUpdateGroup> repeatFlatBatchUpdateGroupIntoList(final int size) {
final List<FlatBatchUpdateGroup> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchUpdateGroupBuilder().withKey(new FlatBatchUpdateGroupKey(i)).build());
return list;
}
- private List<FlatBatchRemoveGroup> repeatFlatBatchRemoveGroupIntoList(final int size) {
+ private static List<FlatBatchRemoveGroup> repeatFlatBatchRemoveGroupIntoList(final int size) {
final List<FlatBatchRemoveGroup> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchRemoveGroupBuilder().withKey(new FlatBatchRemoveGroupKey(i)).build());
return list;
}
- private List<FlatBatchAddFlow> repeatFlatBatchAddFlowIntoList(final int size) {
+ private static List<FlatBatchAddFlow> repeatFlatBatchAddFlowIntoList(final int size) {
final List<FlatBatchAddFlow> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchAddFlowBuilder().withKey(new FlatBatchAddFlowKey(i)).build());
return list;
}
- private List<FlatBatchUpdateFlow> repeatFlatBatchUpdateFlowIntoList(final int size) {
+ private static List<FlatBatchUpdateFlow> repeatFlatBatchUpdateFlowIntoList(final int size) {
final List<FlatBatchUpdateFlow> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchUpdateFlowBuilder().withKey(new FlatBatchUpdateFlowKey(i)).build());
return list;
}
- private List<FlatBatchRemoveFlow> repeatFlatBatchRemoveFlowIntoList(final int size) {
+ private static List<FlatBatchRemoveFlow> repeatFlatBatchRemoveFlowIntoList(final int size) {
final List<FlatBatchRemoveFlow> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchRemoveFlowBuilder().withKey(new FlatBatchRemoveFlowKey(i)).build());
return list;
}
- private List<FlatBatchAddMeter> repeatFlatBatchAddMeterIntoList(final int size) {
+ private static List<FlatBatchAddMeter> repeatFlatBatchAddMeterIntoList(final int size) {
final List<FlatBatchAddMeter> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchAddMeterBuilder().withKey(new FlatBatchAddMeterKey(i)).build());
return list;
}
- private List<FlatBatchUpdateMeter> repeatFlatBatchUpdateMeterIntoList(final int size) {
+ private static List<FlatBatchUpdateMeter> repeatFlatBatchUpdateMeterIntoList(final int size) {
final List<FlatBatchUpdateMeter> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchUpdateMeterBuilder().withKey(new FlatBatchUpdateMeterKey(i)).build());
return list;
}
- private List<FlatBatchRemoveMeter> repeatFlatBatchRemoveMeterIntoList(final int size) {
+ private static List<FlatBatchRemoveMeter> repeatFlatBatchRemoveMeterIntoList(final int size) {
final List<FlatBatchRemoveMeter> list = new ArrayList<>();
for (int i = 0; i < size; i++) {
list.add(new FlatBatchRemoveMeterBuilder().withKey(new FlatBatchRemoveMeterKey(i)).build());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import com.google.common.collect.Lists;
checkBatchSuccessOutcomeTransformation(FlowUtil.FLOW_UPDATE_TRANSFORM.apply(input));
}
- private <T extends BatchFlowOutputListGrouping> void checkBatchSuccessOutcomeTransformation(
+ private static <T extends BatchFlowOutputListGrouping> void checkBatchSuccessOutcomeTransformation(
final RpcResult<T> output) {
Assert.assertTrue(output.isSuccessful());
Map<BatchFailedFlowsOutputKey, BatchFailedFlowsOutput> failedFlows
Assert.assertEquals(1, composite.getResult().getBatchFailedFlowsOutput().size());
}
- private RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
+ private static RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
return RpcResultBuilder.<SendBarrierOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error")
.build();
}
- private RpcResult<AddFlowsBatchOutput> createAddFlowsBatchSuccessOutput() {
+ private static RpcResult<AddFlowsBatchOutput> createAddFlowsBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddFlowsBatchOutputBuilder()
.setBatchFailedFlowsOutput(Collections.emptyList())
.build();
}
- private RpcResult<AddFlowsBatchOutput> createAddFlowsBatchFailureOutcome() {
+ private static RpcResult<AddFlowsBatchOutput> createAddFlowsBatchFailureOutcome() {
final RpcResult<List<BatchFailedFlowsOutput>> batchOutcomeWithError = createBatchOutcomeWithError();
return RpcResultBuilder.<AddFlowsBatchOutput>failed()
.withResult(new AddFlowsBatchOutputBuilder()
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import static org.junit.Assert.assertEquals;
assertEquals(GROUP_ACTION_BITMAP, groupActionsSupportBitmap.get(0).toJava());
}
- private RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
+ private static RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
return RpcResultBuilder.<SendBarrierOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error")
.build();
}
- private RpcResult<AddGroupsBatchOutput> createAddGroupsBatchSuccessOutput() {
+ private static RpcResult<AddGroupsBatchOutput> createAddGroupsBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddGroupsBatchOutputBuilder()
.setBatchFailedGroupsOutput(Collections.emptyList())
.build();
}
- private RpcResult<AddGroupsBatchOutput> createAddGroupsBatchFailureOutcome() {
+ private static RpcResult<AddGroupsBatchOutput> createAddGroupsBatchFailureOutcome() {
final RpcResult<List<BatchFailedGroupsOutput>> batchOutcomeWithError = createBatchOutcomeWithError();
return RpcResultBuilder.<AddGroupsBatchOutput>failed()
.withResult(new AddGroupsBatchOutputBuilder()
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import static org.junit.Assert.assertEquals;
assertEquals(expectedV10Match.build(),emptyV10Match.build());
}
- private MatchV10Builder expectedV10Match() {
+ private static MatchV10Builder expectedV10Match() {
Short zeroShort = Short.valueOf("0");
Integer zeroInteger = 0;
MatchV10Builder matchV10Builder = new MatchV10Builder();
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import com.google.common.base.Function;
Assert.assertEquals(1, output.getResult().get(0).getBatchOrder().intValue());
}
- private org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter createBatchMeter(
+ private static org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.Meter createBatchMeter(
final MeterId meterId) {
return new MeterBuilder()
.setMeterId(meterId)
Assert.assertEquals(1, composite.getResult().getBatchFailedMetersOutput().size());
}
- private RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
+ private static RpcResult<SendBarrierOutput> createBarrierFailureOutcome() {
return RpcResultBuilder.<SendBarrierOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error")
.build();
}
- private RpcResult<AddMetersBatchOutput> createAddMetersBatchSuccessOutput() {
+ private static RpcResult<AddMetersBatchOutput> createAddMetersBatchSuccessOutput() {
return RpcResultBuilder
.success(new AddMetersBatchOutputBuilder()
.setBatchFailedMetersOutput(Collections.emptyMap())
.build();
}
- private RpcResult<AddMetersBatchOutput> createAddMetersBatchFailureOutcome() {
+ private static RpcResult<AddMetersBatchOutput> createAddMetersBatchFailureOutcome() {
final RpcResult<List<BatchFailedMetersOutput>> batchOutcomeWithError = createBatchOutcomeWithError();
return RpcResultBuilder.<AddMetersBatchOutput>failed()
.withResult(new AddMetersBatchOutputBuilder()