package org.opendaylight.openflowplugin.droptestkaraf;
import java.io.PrintStream;
-
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
-import com.google.common.base.Preconditions;
-
-@Command(scope = "drop-test", name = "dropAllPackets", description="drop packet responder involving dataStore and FRM")
+@Command(scope = "drop-test", name = "dropAllPackets",
+ description = "drop packet responder involving dataStore and FRM")
public class DropAllPacketsCommandProvider extends OsgiCommandSupport {
- @Argument(index = 0, name = "on-off",
- description = "target state of drop responder",
+ @Argument(index = 0, name = "on-off",
+ description = "target state of drop responder",
required = true, multiValued = false)
String targetStateArg = null;
-
-
+
+
@Override
protected Object doExecute() throws Exception {
PrintStream out = session.getConsole();
/**
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* 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.droptestkaraf;
import java.util.List;
-
import org.apache.karaf.shell.console.Completer;
import org.apache.karaf.shell.console.completer.StringsCompleter;
/**
- * general dropAllPackets on/off argument completer
+ * General dropAllPackets on/off argument completer.
*/
public class DropAllPacketsCompleter implements Completer {
-
+
@Override
public int complete(String buffer, int cursor, List<String> candidates) {
StringsCompleter delegate = new StringsCompleter();
package org.opendaylight.openflowplugin.droptestkaraf;
import java.io.PrintStream;
-
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-
-import com.google.common.base.Preconditions;
-@Command(scope = "drop-test", name = "dropAllPacketsRpc", description="drop packet responder involving SalFlowService")
+@Command(scope = "drop-test", name = "dropAllPacketsRpc",
+ description = "drop packet responder involving SalFlowService")
public class DropAllPacketsRpcCommandProvider extends OsgiCommandSupport {
- @Argument(index = 0, name = "on-off",
- description = "target state of drop responder",
+ @Argument(index = 0, name = "on-off",
+ description = "target state of drop responder",
required = true, multiValued = false)
String targetStateArg = null;
-
+
@Override
protected Object doExecute() throws Exception {
PrintStream out = session.getConsole();
final DropTestRpcProvider provider = DropTestProviderImpl.getDropRpcProvider();
-
+
if ("on".equalsIgnoreCase(targetStateArg)) {
if (! provider.isActive()) {
provider.start();
// ci.println("Session not initiated, try again in a few seconds");
// }
// }
-
+
}
package org.opendaylight.openflowplugin.testcommon;
import static org.opendaylight.openflowjava.util.ByteBufUtils.macAddressToString;
+
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
static final int STARTUP_LOOP_MAX_RETRIES = 8;
private static final int PROCESSING_POOL_SIZE = 10000;
- private final int POOL_THREAD_AMOUNT = 8;
+ private static final int POOL_THREAD_AMOUNT = 8;
private final ExecutorService executorService;
- private static final AtomicIntegerFieldUpdater<AbstractDropTest> SENT_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "sent");
+ private static final AtomicIntegerFieldUpdater<AbstractDropTest> SENT_UPDATER = AtomicIntegerFieldUpdater
+ .newUpdater(AbstractDropTest.class, "sent");
private volatile int sent;
- private static final AtomicIntegerFieldUpdater<AbstractDropTest> RCVD_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "rcvd");
+ private static final AtomicIntegerFieldUpdater<AbstractDropTest> RCVD_UPDATER = AtomicIntegerFieldUpdater
+ .newUpdater(AbstractDropTest.class, "rcvd");
private volatile int rcvd;
- private static final AtomicIntegerFieldUpdater<AbstractDropTest> EXCS_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "excs");
+ private static final AtomicIntegerFieldUpdater<AbstractDropTest> EXCS_UPDATER = AtomicIntegerFieldUpdater
+ .newUpdater(AbstractDropTest.class, "excs");
private volatile int excs;
- protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_SUCCESS_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrSuccess");
+ protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_SUCCESS_UPDATER =
+ AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrSuccess");
protected volatile int ftrSuccess;
- protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_FAIL_UPDATER = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrFailed");
+ protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RPC_FUTURE_FAIL_UPDATER =
+ AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "ftrFailed");
protected volatile int ftrFailed;
- protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_EXECUTED = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "runablesExecuted");
+ protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_EXECUTED = AtomicIntegerFieldUpdater
+ .newUpdater(AbstractDropTest.class, "runablesExecuted");
protected volatile int runablesExecuted;
- protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_REJECTED = AtomicIntegerFieldUpdater.newUpdater(AbstractDropTest.class, "runablesRejected");
+ protected static final AtomicIntegerFieldUpdater<AbstractDropTest> RUNABLES_REJECTED = AtomicIntegerFieldUpdater
+ .newUpdater(AbstractDropTest.class, "runablesRejected");
protected volatile int runablesRejected;
public final DropTestStats getStats() {
- return new DropTestStats(this.sent, this.rcvd, this.excs, this.ftrFailed, this.ftrSuccess, this.runablesExecuted, this.runablesRejected);
+ return new DropTestStats(this.sent, this.rcvd, this.excs, this.ftrFailed, this.ftrSuccess,
+ this.runablesExecuted, this.runablesRejected);
}
- public AbstractDropTest() {
- final ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<Runnable>(PROCESSING_POOL_SIZE);
+ AbstractDropTest() {
+ final ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<>(PROCESSING_POOL_SIZE);
final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(POOL_THREAD_AMOUNT, POOL_THREAD_AMOUNT, 0,
TimeUnit.MILLISECONDS,
workQueue);
threadPool.setThreadFactory(new ThreadFactoryBuilder().setNameFormat("dropTest-%d").build());
- threadPool.setRejectedExecutionHandler(new RejectedExecutionHandler() {
- @Override
- public void rejectedExecution(final Runnable r, final ThreadPoolExecutor executor) {
- try {
- workQueue.put(r);
- } catch (final InterruptedException e) {
- throw new RejectedExecutionException("Interrupted while waiting on queue", e);
- }
+ threadPool.setRejectedExecutionHandler((rejected, executor) -> {
+ try {
+ workQueue.put(rejected);
+ } catch (final InterruptedException e) {
+ throw new RejectedExecutionException("Interrupted while waiting on queue", e);
}
});
this.runablesRejected = 0;
}
- private final void incrementRunableExecuted() {
+ private void incrementRunableExecuted() {
RUNABLES_EXECUTED.incrementAndGet(this);
}
- private final void incrementRunableRejected() {
+ private void incrementRunableRejected() {
RUNABLES_REJECTED.incrementAndGet(this);
}
RCVD_UPDATER.incrementAndGet(this);
try {
- executorService.submit(new Runnable() {
- @Override
- public void run() {
- incrementRunableExecuted();
- processPacket(notification);
- }
+ executorService.execute(() -> {
+ incrementRunableExecuted();
+ processPacket(notification);
});
- } catch (final Exception e) {
+ } catch (RejectedExecutionException e) {
incrementRunableRejected();
}
LOG.debug("onPacketReceived - Leaving", notification);
private static Instructions makeStaticDropActionInstructions() {
// Create an DropAction
- final DropActionCase dropAction = new DropActionCaseBuilder().setDropAction(new DropActionBuilder().build()).build();
+ final DropActionCase dropAction = new DropActionCaseBuilder().setDropAction(
+ new DropActionBuilder().build()).build();
// Create an Action
final Action ab = new ActionBuilder().setOrder(0).setAction(dropAction).build();
// Create an Apply Action
return new InstructionsBuilder().setInstruction(Collections.singletonList(ib)).build();
}
+ @SuppressWarnings("checkstyle:IllegalCatch")
private void processPacket(final PacketReceived notification) {
try {
final byte[] rawPacket = notification.getPayload();
processPacket(ncri.firstIdentifierOf(Node.class), match.build(), DROP_INSTRUCTIONS);
SENT_UPDATER.incrementAndGet(this);
- } catch (final Exception e) {
+ } catch (RuntimeException e) {
LOG.warn("Failed to process packet: {}", e.getMessage());
LOG.debug("Failed to process packet.. ", e);
EXCS_UPDATER.incrementAndGet(this);
package org.opendaylight.openflowplugin.testcommon;
import java.math.BigInteger;
-import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicLong;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.slf4j.LoggerFactory;
/**
- * provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
- * device using dataStore strategy (FRM involved)
+ * Provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
+ * device using dataStore strategy (FRM involved).
*/
public class DropTestCommiter extends AbstractDropTest {
private static final Logger LOG = LoggerFactory.getLogger(DropTestCommiter.class);
private ListenerRegistration<DropTestCommiter> notificationRegistration;
/**
- * start listening on packetIn
+ * start listening on packetIn.
*/
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void start() {
final SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
STARTUP_LOOP_MAX_RETRIES);
try {
- notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestCommiter>>() {
- @Override
- public ListenerRegistration<DropTestCommiter> call() throws Exception {
- return notificationService.registerNotificationListener(DropTestCommiter.this);
- }
- });
- } catch (final Exception e) {
+ notificationRegistration = looper.loopUntilNoException(() ->
+ notificationService.registerNotificationListener(DropTestCommiter.this));
+ } catch (Exception e) {
LOG.warn("DropTest committer notification listener registration fail!");
LOG.debug("DropTest committer notification listener registration fail! ..", e);
throw new IllegalStateException("DropTest startup fail! Try again later.", e);
}
}
- /**
- * @param dataService the dataService to set
- */
public void setDataService(final DataBroker dataService) {
this.dataService = dataService;
}
@Override
- protected void processPacket(final InstanceIdentifier<Node> node, final Match match, final Instructions instructions) {
+ protected void processPacket(final InstanceIdentifier<Node> node, final Match match,
+ final Instructions instructions) {
// Finally build our flow
final FlowBuilder fb = BUILDER.get();
}
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void close() {
super.close();
try {
if (notificationRegistration != null) {
notificationRegistration.close();
}
- } catch (final Exception e) {
+ } catch (RuntimeException e) {
LOG.warn("unregistration of notification listener failed: {}", e.getMessage());
LOG.debug("unregistration of notification listener failed.. ", e);
}
}
- /**
- * @param notificationService
- */
public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
import org.slf4j.LoggerFactory;
/**
- * provides activation and deactivation of drop responder service - responds on packetIn
+ * Provides activation and deactivation of drop responder service - responds on packetIn.
*/
public class DropTestDsProvider implements AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(DropTestDsProvider.class);
private boolean active = false;
/**
- * @return message counts
+ * Returns the message counts.
*/
public DropTestStats getStats() {
return commiter.getStats();
}
/**
- * reset message counts
+ * Reset message counts.
*/
public void clearStats() {
commiter.clearStats();
}
- /**
- * @param dataService value for setter
- */
public void setDataService(final DataBroker dataService) {
this.dataService = dataService;
}
-
- /**
- * @param notificationService value for setter
- */
public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
/**
- * activates the drop responder
+ * Activates the drop responder.
*/
public void start() {
commiter.setDataService(dataService);
}
/**
- * @return the active
+ * Returns the active state.
*/
public boolean isActive() {
return active;
import org.slf4j.LoggerFactory;
/**
- * provides activation and deactivation of drop responder service - responds on packetIn
+ * Provides activation and deactivation of drop responder service - responds on packetIn.
*/
public class DropTestRpcProvider implements AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(DropTestRpcProvider.class);
private SalFlowService flowService;
private NotificationService notificationService;
- private DropTestRpcSender commiter = new DropTestRpcSender();
+ private final DropTestRpcSender commiter = new DropTestRpcSender();
private boolean active = false;
- /**
- * @param flowService value for setter
- */
public void setFlowService(final SalFlowService flowService) {
this.flowService = flowService;
}
- /**
- * @param notificationService value for setter
- */
public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
/**
- * activates drop responder
+ * Activates drop responder.
*/
public void start() {
commiter.setFlowService(flowService);
}
/**
- * @return message counts
+ * Returns the message counts.
*/
public DropTestStats getStats() {
if (this.commiter != null) {
}
/**
- * reset message counts
+ * Reset message counts.
*/
public void clearStats() {
if (commiter != null) {
}
/**
- * @return the active
+ * Returns the active state.
*/
public boolean isActive() {
return active;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.math.BigInteger;
-import java.util.concurrent.Callable;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.openflowplugin.common.wait.SimpleTaskRetryLooper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.slf4j.LoggerFactory;
/**
- * provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
- * device using {@link SalFlowService} strategy
+ * Provides cbench responder behavior: upon packetIn arrival addFlow action is sent out to
+ * device using {@link SalFlowService} strategy.
*/
public class DropTestRpcSender extends AbstractDropTest {
private static final Logger LOG = LoggerFactory.getLogger(DropTestRpcSender.class);
private SalFlowService flowService;
- /**
- * @param flowService the flowService to set
- */
public void setFlowService(final SalFlowService flowService) {
this.flowService = flowService;
}
private ListenerRegistration<DropTestRpcSender> notificationRegistration;
/**
- * start listening on packetIn
+ * Start listening on packetIn.
*/
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void start() {
final SimpleTaskRetryLooper looper = new SimpleTaskRetryLooper(STARTUP_LOOP_TICK,
STARTUP_LOOP_MAX_RETRIES);
try {
- notificationRegistration = looper.loopUntilNoException(new Callable<ListenerRegistration<DropTestRpcSender>>() {
- @Override
- public ListenerRegistration<DropTestRpcSender> call() throws Exception {
- return notificationService.registerNotificationListener(DropTestRpcSender.this);
- }
- });
- } catch (final Exception e) {
+ notificationRegistration = looper.loopUntilNoException(
+ () -> notificationService.registerNotificationListener(DropTestRpcSender.this));
+ } catch (Exception e) {
LOG.warn("DropTest sender notification listener registration fail!");
LOG.debug("DropTest sender notification listener registration fail! ..", e);
throw new IllegalStateException("DropTest startup fail! Try again later.", e);
}
@Override
- protected void processPacket(final InstanceIdentifier<Node> node, final Match match, final Instructions instructions) {
+ protected void processPacket(final InstanceIdentifier<Node> node, final Match match,
+ final Instructions instructions) {
final AddFlowInputBuilder fb = BUILDER.get();
// Finally build our flow
if (LOG.isDebugEnabled()) {
LOG.debug("onPacketReceived - About to write flow (via SalFlowService) {}", flow);
}
- ListenableFuture<RpcResult<AddFlowOutput>> result = JdkFutureAdapters.listenInPoolThread(flowService.addFlow(flow));
+ ListenableFuture<RpcResult<AddFlowOutput>> result =
+ JdkFutureAdapters.listenInPoolThread(flowService.addFlow(flow));
Futures.addCallback(result, new FutureCallback<RpcResult<AddFlowOutput>>() {
@Override
- public void onSuccess(final RpcResult<AddFlowOutput> o) {
+ public void onSuccess(final RpcResult<AddFlowOutput> result) {
countFutureSuccess();
}
}, MoreExecutors.directExecutor());
}
- /**
- * @param notificationService
- */
public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void close() {
super.close();
try {
if (notificationRegistration != null) {
notificationRegistration.close();
}
- } catch (final Exception e) {
+ } catch (RuntimeException e) {
LOG.warn("unregistration of notification listener failed: {}", e.getMessage());
LOG.debug("unregistration of notification listener failed.. ", e);
}
runablesRejected = 0;
}
- public DropTestStats(int sent, int rcvd, int excs, int ftrFailed, int ftrSuccess, int runablesExecuted, int runablesRejected) {
+ public DropTestStats(int sent, int rcvd, int excs, int ftrFailed, int ftrSuccess,
+ int runablesExecuted, int runablesRejected) {
this.sent = sent;
this.rcvd = rcvd;
this.excs = excs;
import org.slf4j.LoggerFactory;
/**
- * dummy implementation flushing events into log
+ * Dummy implementation flushing events into log.
*/
public class FlowEventListenerLoggingImpl implements SalFlowListener {
import org.slf4j.LoggerFactory;
/**
- * dummy implementation flushing events into log
- * @author kramesha
+ * Dummy implementation flushing events into log.
+ *
+ * @author kramesha
*/
public class NodeErrorListenerLoggingImpl implements NodeErrorListener {
@Override
public void onBadActionErrorNotification(BadActionErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onBadInstructionErrorNotification(BadInstructionErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onBadMatchErrorNotification(BadMatchErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onBadRequestErrorNotification(BadRequestErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onExperimenterErrorNotification(ExperimenterErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onFlowModErrorNotification(FlowModErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onGroupModErrorNotification(GroupModErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onHelloFailedErrorNotification(HelloFailedErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onMeterModErrorNotification(MeterModErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onPortModErrorNotification(PortModErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onQueueOpErrorNotification(QueueOpErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onRoleRequestErrorNotification(RoleRequestErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onSwitchConfigErrorNotification(SwitchConfigErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onTableFeaturesErrorNotification(TableFeaturesErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
@Override
public void onTableModErrorNotification(TableModErrorNotification notification) {
- LOG.error("Error notification ----" + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()) );
+ LOG.error("Error notification ----"
+ + toStr(notification.getType(), notification.getCode(), notification.getTransactionId().getValue()));
}
private String toStr(ErrorType type, int code, BigInteger xid) {
- return "[Type="+type+", Code="+ code +", Xid ="+xid+"]";
+ return "[Type=" + type + ", Code=" + code + ", Xid =" + xid + "]";
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvider {
private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkGroupTransactionProvider.class);
private NodeBuilder testNode;
return builder;
}
+ private void createTestNode() {
+ NodeRef nodeOne = createNodeRef(OpenflowpluginTestActivator.NODE_ID);
+ NodeBuilder builder = new NodeBuilder();
+ builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
+ builder.setKey(new NodeKey(builder.getId()));
+ testNode12 = builder.build();
+ }
+
private static NodeRef createNodeRef(String string) {
NodeKey key = new NodeKey(new NodeId(string));
InstanceIdentifier<Node> path = InstanceIdentifier.create(Nodes.class).child(Node.class, key);
return "No help";
}
- /**
- * @return
- */
private static MatchBuilder createMatch1() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
return match;
}
- /**
- * @return
- */
private static InstructionsBuilder createDecNwTtlInstructions() {
DecNwTtlBuilder ta = new DecNwTtlBuilder();
DecNwTtl decNwTtl = ta.build();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
// Add our drop action to a list
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
- /**
- * @return
- */
private static MatchBuilder createMatch2() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch3() {
MatchBuilder match = new MatchBuilder();
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
// Add our drop action to a list
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
private static MatchBuilder createEthernetMatch() {
- MatchBuilder match = new MatchBuilder();
-
- byte[] mask1 = new byte[]{(byte) -1, (byte) -1, 0, 0, 0, 0};
- byte[] mask2 = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0};
-
EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
// match
EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
// ethsrc.setMask(mask2);
ethmatch.setEthernetSource(ethsrc.build());
+ MatchBuilder match = new MatchBuilder();
match.setEthernetMatch(ethmatch.build());
return match;
}
- /**
- * @return
- */
private static InstructionsBuilder createMeterInstructions() {
MeterBuilder aab = new MeterBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
ControllerActionBuilder controller = new ControllerActionBuilder();
controller.setMaxLength(5);
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction7() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
- VlanId a = new VlanId(4012);
- vl.setVlanId(a);
+ VlanId vlanId = new VlanId(4012);
+ vl.setVlanId(vlanId);
ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction21() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction2() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushMplsActionBuilder push = new PushMplsActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction3() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushPbbActionBuilder pbb = new PushPbbActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
LOG.warn("flow type not understood: {}", flowType);
}
- FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
+ final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
if (null == flow.isBarrier()) {
flow.setBarrier(Boolean.FALSE);
}
short table = 2;
try {
table = Short.parseShort(tableId);
- } catch (Exception ex) {
+ } catch (NumberFormatException ex) {
// ignore exception and continue with default value
}
GroupBuilder group7 = createTestGroup("a3", "g1", "add", "6");
writeGroup(ci, group6.build(), group7.build());
break;
-
+ default:
+ break;
}
-
}
private void createUserNode(String nodeRef) {
GroupBuilder group7 = createTestGroup("a29", "g1", "modify", "6");
writeGroup(ci, group6.build(), group7.build());
break;
+ default:
+ break;
}
}
return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
}
- private void createTestNode() {
- NodeRef nodeOne = createNodeRef(OpenflowpluginTestActivator.NODE_ID);
- NodeBuilder builder = new NodeBuilder();
- builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
- builder.setKey(new NodeKey(builder.getId()));
- testNode12 = builder.build();
- }
-
public void _removeGroups(CommandInterpreter ci) {
String nref = ci.nextArgument();
GroupBuilder group15 = createTestGroup("a29", "g1", "modify", "6");
writeGroup(ci, group14.build(), group15.build());
break;
-
+ default:
+ break;
}
-
}
private void writeGroup(final CommandInterpreter ci, Group group, Group group1) {
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
}, MoreExecutors.directExecutor());
}
- private GroupBuilder createTestGroup(String actiontype, String type, String mod, String iD) {
+ private GroupBuilder createTestGroup(String actionType, String groupType, String groupmod, String strId) {
// Sample data , committing to DataStore
- String GroupType = type;
- String ActionType = actiontype;
- String Groupmod = mod;
-
- long id = Long.parseLong(iD);
- GroupKey key = new GroupKey(new GroupId(id));
GroupBuilder group = new GroupBuilder();
BucketBuilder bucket = new BucketBuilder();
bucket.setBucketId(new BucketId((long) 12));
bucket.setKey(new BucketKey(new BucketId((long) 12)));
- if (GroupType == null) {
- GroupType = "g1";
+ if (groupType == null) {
+ groupType = "g1";
}
- if (ActionType == null) {
- ActionType = "a1";
+ if (actionType == null) {
+ actionType = "a1";
}
- switch (GroupType) {
+ switch (groupType) {
case "g1":
group.setGroupType(GroupTypes.GroupSelect);
break;
case "g4":
group.setGroupType(GroupTypes.GroupFf);
break;
+ default:
+ break;
}
- switch (ActionType) {
+ switch (actionType) {
case "a1":
bucket.setAction(createPopVlanAction());
break;
case "a29":
bucket.setAction(createNonAppyPushVlanAction());
break;
-
+ default:
+ break;
}
- if (Groupmod == "add") {
+ if (groupmod == "add") {
bucket.setWatchGroup((long) 14);
bucket.setWatchPort((long) 1234);
bucket.setWeight(50);
bucket.setWatchPort((long) 134);
bucket.setWeight(30);
}
+
+ long id = Long.parseLong(strId);
+ GroupKey key = new GroupKey(new GroupId(id));
group.setKey(key);
// group.setInstall(false);
group.setGroupId(new GroupId(id));
group.setGroupName(originalGroupName);
group.setBarrier(false);
BucketsBuilder value = new BucketsBuilder();
- List<Bucket> value1 = new ArrayList<Bucket>();
+ List<Bucket> value1 = new ArrayList<>();
value1.add(bucket.build());
value.setBucket(value1);
group.setBuckets(value.build());
ActionBuilder action = new ActionBuilder();
action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
action.setKey(new ActionKey(0));
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
private List<Action> createPushVlanAction() {
PushVlanActionBuilder vlan = new PushVlanActionBuilder();
vlan.setEthernetType(0x8100);
- VlanId v = new VlanId(2);
- vlan.setVlanId(v);
+ VlanId vlanId = new VlanId(2);
+ vlan.setVlanId(vlanId);
ActionBuilder action = new ActionBuilder();
action.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
push.setEthernetType(0x8847);
ActionBuilder action = new ActionBuilder();
action.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
popMplsActionBuilder.setEthernetType(0XB);
ActionBuilder action = new ActionBuilder();
action.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
pbb.setEthernetType(0x88E7);
ActionBuilder action = new ActionBuilder();
action.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
ActionBuilder action = new ActionBuilder();
action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
action.setKey(new ActionKey(0));
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
private static List<Action> createNonAppyPushVlanAction() {
- List<Action> actionList = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
GroupActionBuilder groupActionB = new GroupActionBuilder();
groupActionB.setGroupId(1L);
groupActionB.setGroup("0");
ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
+
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
return actionList;
}
-
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv6MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.node.error.service.rev140410.NodeErrorListener;
-import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkTransactionProvider.class);
private DataBroker dataBroker;
private final BundleContext ctx;
- private NodeBuilder testNode;
private ProviderContext pc;
- private FlowBuilder testFlow;
private final String originalFlowName = "Foo";
private final NodeErrorListener nodeErrorListener = new NodeErrorListenerLoggingImpl();
- private Registration listener1Reg;
- private Registration listener2Reg;
- private Node testNode12;
- private final String originalGroupName = "Foo";
private static NotificationService notificationService;
public OpenflowPluginBulkTransactionProvider(BundleContext ctx) {
public void onSessionInitiated(ProviderContext session) {
pc = session;
notificationService = session.getSALService(NotificationService.class);
- listener2Reg = notificationService.registerNotificationListener(nodeErrorListener);
+ notificationService.registerNotificationListener(nodeErrorListener);
dataBroker = session.getSALService(DataBroker.class);
ctx.registerService(CommandProvider.class.getName(), this, null);
createTestFlow(createTestNode(null), null, null);
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeId));
builder.setKey(new NodeKey(builder.getId()));
- testNode = builder;
return builder;
}
LOG.warn("flow type not understood: {}", flowType);
}
- FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
if (null == flow.isBarrier()) {
flow.setBarrier(Boolean.FALSE);
}
// flow
flow.setOutPort(outputPort);
+ FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
flow.setKey(key);
flow.setPriority(2);
flow.setFlowName(originalFlowName + "X" + flowType);
- testFlow = flow;
return flow;
}
short table = 2;
try {
table = Short.parseShort(tableId);
- } catch (Exception ex) {
+ } catch (NumberFormatException ex) {
// ignore exception and continue with default value
}
}
- private void createTestNode() {
- NodeRef nodeOne = createNodeRef(OpenflowpluginTestActivator.NODE_ID);
- NodeBuilder builder = new NodeBuilder();
- builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
- builder.setKey(new NodeKey(builder.getId()));
- testNode12 = builder.build();
- }
-
public void _addFlows(CommandInterpreter ci) {
NodeBuilder tn = createTestNode(ci.nextArgument());
String flowtype = ci.nextArgument();
tf2 = createTestFlow(tn, "f900", "9");
tf3 = createTestFlow(tn, "f1000", "10");
break;
+ default:
+ break;
}
InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
- modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+ true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path1, flow.build(), true);
- modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+ nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
InstanceIdentifier<Flow> path2 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow1.getTableId())).child(Flow.class, flow1.getKey());
- modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+ true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path2, flow1.build(), true);
- modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+ nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path2, flow1.build(), true);
InstanceIdentifier<Flow> path3 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow2.getTableId())).child(Flow.class, flow2.getKey());
- modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+ true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path3, flow2.build(), true);
- modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+ nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path3, flow2.build(), true);
InstanceIdentifier<Flow> path4 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow3.getTableId())).child(Flow.class, flow3.getKey());
- modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
+ true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path4, flow3.build(), true);
- modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder),
+ nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path4, flow3.build(), true);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
}, MoreExecutors.directExecutor());
}
- /**
- * @return
- */
private static InstructionsBuilder createDecNwTtlInstructions() {
DecNwTtlBuilder ta = new DecNwTtlBuilder();
DecNwTtl decNwTtl = ta.build();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
// Add our drop action to a list
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
- /**
- * @return
- */
private static InstructionsBuilder createMeterInstructions() {
MeterBuilder aab = new MeterBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
// Add our drop action to a list
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
ControllerActionBuilder controller = new ControllerActionBuilder();
controller.setMaxLength(5);
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
private static InstructionsBuilder createSentToControllerInstructions() {
- List<Action> actionList = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
+
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction2() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushMplsActionBuilder push = new PushMplsActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction3() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushPbbActionBuilder pbb = new PushPbbActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction6() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction7() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
- VlanId a = new VlanId(4012);
- vl.setVlanId(a);
+ VlanId vlanId = new VlanId(4012);
+ vl.setVlanId(vlanId);
ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction8() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction9() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
private static InstructionsBuilder createAppyActionInstruction16() {
-
- List<Action> actionList = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
GroupActionBuilder groupActionB = new GroupActionBuilder();
groupActionB.setGroupId(1L);
groupActionB.setGroup("0");
ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
+
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction160() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
FloodAllActionBuilder fldall = new FloodAllActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
private static InstructionsBuilder createAppyActionInstruction26() {
-
- List<Action> actionList = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
ipdst.setIpv4Address(prefixdst);
setNwDstActionBuilder.setAddress(ipdst.build());
ab.setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.build()).build());
+
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
private static InstructionsBuilder createAppyActionInstruction27() {
-
- List<Action> actionList = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
ipsrc.setIpv4Address(prefixsrc);
setNwsrcActionBuilder.setAddress(ipsrc.build());
ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
+
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction28() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction34() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SwPathActionBuilder swPathAction = new SwPathActionBuilder();
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
- List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch1() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch2() {
MatchBuilder match = new MatchBuilder();
Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch3() {
MatchBuilder match = new MatchBuilder();
EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
}
private static MatchBuilder createEthernetMatch() {
- MatchBuilder match = new MatchBuilder();
-
- byte[] mask1 = new byte[]{(byte) -1, (byte) -1, 0, 0, 0, 0};
- byte[] mask2 = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0};
-
EthernetMatchBuilder ethmatch = new EthernetMatchBuilder(); // ethernettype
// match
EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
// ethsrc.setMask(mask2);
ethmatch.setEthernetSource(ethsrc.build());
+
+ MatchBuilder match = new MatchBuilder();
match.setEthernetMatch(ethmatch.build());
return match;
}
- /**
- * @return
- */
private static MatchBuilder createL3IPv6Match() {
MatchBuilder match = new MatchBuilder();
Ipv6Prefix dstip6 = new Ipv6Prefix("2002::2/64");
Ipv6Prefix srcip6 = new Ipv6Prefix("2001:0:0:0:0:0:0:1/56");
Ipv6Address ndtarget = new Ipv6Address("2001:db8:0:1:fd97:f9f0:a810:782e");
- MacAddress ndsll = new MacAddress("c2:00:54:f5:00:00");
- MacAddress ndtll = new MacAddress("00:0c:29:0e:4c:67");
Ipv6ExtHeaderBuilder nextheader = new Ipv6ExtHeaderBuilder();
nextheader.setIpv6Exthdr(58);
Ipv6LabelBuilder ipv6label = new Ipv6LabelBuilder();
// ipv6match.setIpv6Source(srcip6);
// ipv6match.setIpv6Destination(dstip6);
// ipv6match.setIpv6ExtHeader(nextheader.build());
- ipv6match.setIpv6NdSll(ndsll);
- ipv6match.setIpv6NdTll(ndtll);
+
+ ipv6match.setIpv6NdSll(new MacAddress("c2:00:54:f5:00:00"));
+ ipv6match.setIpv6NdTll(new MacAddress("00:0c:29:0e:4c:67"));
// ipv6match.setIpv6NdTarget(ndtarget);
ipv6match.setIpv6Label(ipv6label.build());
return match;
}
- /**
- * @return
- */
private static MatchBuilder createICMPv6Match() {
MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMetadataMatch() {
MatchBuilder match = new MatchBuilder();
- byte[] metamask = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1};
MetadataBuilder metadata = new MetadataBuilder(); // metadata match
metadata.setMetadata(BigInteger.valueOf(500L));
// metadata.setMetadataMask(metamask);
return match;
}
-
}
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.osgi.framework.BundleContext;
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowpluginGroupTestCommandProvider implements CommandProvider {
private DataBroker dataBroker;
private ProviderContext pc;
private final BundleContext ctx;
private Group testGroup;
- private Group testGroup2;
private Node testNode;
private final String originalGroupName = "Foo";
- private final String updatedGroupName = "Bar";
public OpenflowpluginGroupTestCommandProvider(BundleContext ctx) {
this.ctx = ctx;
return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
}
- private GroupBuilder createTestGroup(String actiontype, String type, String mod) {
+ private GroupBuilder createTestGroup(String actionType, String groupType, String groupMod) {
// Sample data , committing to DataStore
- String GroupType = type;
- String ActionType = actiontype;
- String Groupmod = mod;
-
- long id = 1;
- GroupKey key = new GroupKey(new GroupId(id));
GroupBuilder group = new GroupBuilder();
BucketBuilder bucket = new BucketBuilder();
bucket.setBucketId(new BucketId((long) 12));
bucket.setKey(new BucketKey(new BucketId((long) 12)));
- if (GroupType == null) {
- GroupType = "g1";
+ if (groupType == null) {
+ groupType = "g1";
}
- if (ActionType == null) {
- ActionType = "a1";
+ if (actionType == null) {
+ actionType = "a1";
}
- switch (GroupType) {
+ switch (groupType) {
case "g1":
group.setGroupType(GroupTypes.GroupSelect);
break;
case "g4":
group.setGroupType(GroupTypes.GroupFf);
break;
+ default:
+ break;
}
- switch (ActionType) {
+ switch (actionType) {
case "a1":
bucket.setAction(createPopVlanAction());
break;
case "a28":
bucket.setAction(createNonAppyPushVlanAction());
break;
-
+ default:
+ break;
}
- if (Groupmod == "add") {
+ if (groupMod == "add") {
bucket.setWatchGroup((long) 14);
bucket.setWatchPort((long) 1234);
bucket.setWeight(50);
bucket.setWatchPort((long) 134);
bucket.setWeight(30);
}
+
+ long id = 1;
+ GroupKey key = new GroupKey(new GroupId(id));
group.setKey(key);
// group.setInstall(false);
group.setGroupId(new GroupId(id));
group.setGroupName(originalGroupName);
group.setBarrier(false);
BucketsBuilder value = new BucketsBuilder();
- List<Bucket> value1 = new ArrayList<Bucket>();
+ List<Bucket> value1 = new ArrayList<>();
value1.add(bucket.build());
value.setBucket(value1);
group.setBuckets(value.build());
ActionBuilder action = new ActionBuilder();
action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
action.setKey(new ActionKey(0));
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
vlan.setEthernetType(0x8100);
ActionBuilder action = new ActionBuilder();
action.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
push.setEthernetType(0x8847);
ActionBuilder action = new ActionBuilder();
action.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
popMplsActionBuilder.setEthernetType(0XB);
ActionBuilder action = new ActionBuilder();
action.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
pbb.setEthernetType(0x88E7);
ActionBuilder action = new ActionBuilder();
action.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
ActionBuilder action = new ActionBuilder();
- action.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(setMplsTtlActionBuilder.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ action.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(
+ setMplsTtlActionBuilder.build()).build());
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
setNwTtlActionBuilder.setNwTtl((short) 1);
ActionBuilder action = new ActionBuilder();
action.setAction(new SetNwTtlActionCaseBuilder().setSetNwTtlAction(setNwTtlActionBuilder.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
ActionBuilder action = new ActionBuilder();
action.setAction(new SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
action.setKey(new ActionKey(0));
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(nwttl.build()).build());
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
ab.setOrder(0);
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
actions.add(action.build());
return actions;
}
private List<Action> createFloodOutputAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> createAllOutputAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> createAnyOutputAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> createNormalOutputAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> createInportOutputAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> creatTableOutputAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> createControllerAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> createLocalOutputAction() {
-
- List<Action> actions = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(30);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setKey(new ActionKey(0));
+
+ List<Action> actions = new ArrayList<>();
actions.add(ab.build());
return actions;
}
private List<Action> createGroupAction() {
-
GroupActionBuilder groupActionB = new GroupActionBuilder();
groupActionB.setGroupId(1L);
groupActionB.setGroup("0");
ActionBuilder action = new ActionBuilder();
action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
action.setKey(new ActionKey(0));
- List<Action> actions = new ArrayList<Action>();
+ List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
private static List<Action> createNonAppyOutputAction() {
-
- List<Action> actionList = new ArrayList<Action>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
//output.setMaxLength(null);
output.setMaxLength(66000);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
+
+ List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
return actionList;
}
private static List<Action> createNonAppyPushMplsAction() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushMplsActionBuilder push = new PushMplsActionBuilder();
push.setEthernetType(0x8849);
ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
actionList.add(ab.build());
return actionList;
-
}
private static List<Action> createNonAppyPushPbbAction() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushPbbActionBuilder pbb = new PushPbbActionBuilder();
pbb.setEthernetType(0x88E8);
private static List<Action> createNonAppyPushVlanAction() {
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
PushVlanActionBuilder vlan = new PushVlanActionBuilder();
vlan.setEthernetType(0x8101);
ab.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
actionList.add(ab.build());
return actionList;
-
}
-
private GroupBuilder createTestRemoveGroup() {
long id = 123;
GroupKey key = new GroupKey(new GroupId(id));
// value1.add(bucket.build());
// value.setBucket(value1);
// group.setBuckets(value.build());
- testGroup2 = group.build();
return group;
}
-
public void _removeGroup(final CommandInterpreter ci) {
String nref = ci.nextArgument();
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
private NotificationProviderService notificationService;
/**
- * get group registration
+ * Get group registration.
*
* @return {@link #groupRegistration}
*/
}
/**
- * set {@link #groupRegistration}
- *
- * @param groupRegistration
+ * Set {@link #groupRegistration}.
*/
public void setGroupRegistration(
final RoutedRpcRegistration<SalGroupService> groupRegistration) {
}
/**
- * get notification service
+ * Get notification service.
*
* @return {@link #notificationService}
*/
}
/**
- * set {@link #notificationService}
- *
- * @param notificationService
+ * Set {@link #notificationService}.
*/
public void setNotificationService(
final NotificationProviderService notificationService) {
*/
@Override
public Future<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
- String plus = ("addGroup - " + input);
+ String plus = "addGroup - " + input;
OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
return null;
}
@Override
public Future<RpcResult<RemoveGroupOutput>> removeGroup(
RemoveGroupInput input) {
- String plus = ("removeGroup - " + input);
+ String plus = "removeGroup - " + input;
OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
return null;
}
@Override
public Future<RpcResult<UpdateGroupOutput>> updateGroup(
UpdateGroupInput input) {
- String plus = ("updateGroup - " + input);
+ String plus = "updateGroup - " + input;
OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
return null;
}
- /**
- * @param ctx
- * @return {@link ObjectRegistration}
- */
public ObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(
final ProviderContext ctx) {
RoutedRpcRegistration<SalGroupService> addRoutedRpcImplementation = ctx
- .<SalGroupService> addRoutedRpcImplementation(
+ .<SalGroupService>addRoutedRpcImplementation(
SalGroupService.class, this);
setGroupRegistration(addRoutedRpcImplementation);
InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
- .<Nodes> builder(Nodes.class);
+ .<Nodes>builder(Nodes.class);
NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
NodeKey nodeKey = new NodeKey(nodeId);
InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
- .<Node, NodeKey> child(Node.class, nodeKey);
+ .<Node, NodeKey>child(Node.class, nodeKey);
InstanceIdentifier<Node> instance = nodeIndentifier.build();
groupRegistration.registerPath(NodeContext.class, instance);
RoutedRpcRegistration<SalGroupService> groupRegistration1 = this
}
};
}
-
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestCommandProvider.class);
meter.setMeterId(new MeterId(9L));
meter.setMeterName(originalMeterName);
meter.setFlags(new MeterFlags(true, false, false, false));
- MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
- List<MeterBandHeader> bandHdr = new ArrayList<MeterBandHeader>();
MeterBandHeaderBuilder bandHeader = new MeterBandHeaderBuilder();
bandHeader.setBandRate((long) 234);
bandHeader.setBandBurstSize((long) 444);
bandTypes.setFlags(bandType);
bandHeader.setMeterBandTypes(bandTypes.build());
bandHeader.setBandId(new BandId(0L));
+
+ List<MeterBandHeader> bandHdr = new ArrayList<>();
bandHdr.add(bandHeader.build());
+
+ MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
bandHeaders.setMeterBandHeader(bandHdr);
meter.setMeterBandHeaders(bandHeaders.build());
bandHeader.setBandRate((long) 123);
}
meter.setFlags(new MeterFlags(true, false, false, false));
- MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
- List<MeterBandHeader> bandHdr = new ArrayList<MeterBandHeader>();
bandHeader.setBandBurstSize((long) 444);
DscpRemarkBuilder dscpRemark = new DscpRemarkBuilder();
bandTypes.setFlags(bandType);
bandHeader.setMeterBandTypes(bandTypes.build());
bandHeader.setBandId(new BandId(0L));
+
+ List<MeterBandHeader> bandHdr = new ArrayList<>();
bandHdr.add(bandHeader.build());
+
+ MeterBandHeadersBuilder bandHeaders = new MeterBandHeadersBuilder();
bandHeaders.setMeterBandHeader(bandHdr);
meter.setMeterBandHeaders(bandHeaders.build());
ci.println("User node added" + nref);
createUserNode(nref);
}
- MeterBuilder mBuilder = createTestMeter();
+ createTestMeter();
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey())
.augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(testMeter.getMeterId()));
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
switch (count) {
case 1:
- MeterBuilder mBuilder = createTestMeters("1", "remove");
+ createTestMeters("1", "remove");
InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
- MeterBuilder mBuilder1 = createTestMeters("2", "remove");
+ createTestMeters("2", "remove");
InstanceIdentifier<Meter> path2 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
break;
case 2:
- MeterBuilder mBuilder2 = createTestMeters("3", "remove");
+ createTestMeters("3", "remove");
InstanceIdentifier<Meter> path3 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path3);
- MeterBuilder mBuilder22 = createTestMeters("4", "remove");
+ createTestMeters("4", "remove");
InstanceIdentifier<Meter> path4 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path4);
break;
case 3:
- MeterBuilder mBuilder3 = createTestMeters("5", "remove");
+ createTestMeters("5", "remove");
InstanceIdentifier<Meter> path5 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path5);
- MeterBuilder mBuilder4 = createTestMeters("6", "remove");
+ createTestMeters("6", "remove");
InstanceIdentifier<Meter> path6 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path6);
break;
case 4:
- MeterBuilder mBuilder5 = createTestMeters("7", "remove");
+ createTestMeters("7", "remove");
InstanceIdentifier<Meter> path7 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path7);
- MeterBuilder mBuilder6 = createTestMeters("8", "remove");
+ createTestMeters("8", "remove");
InstanceIdentifier<Meter> path8 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path8);
break;
-
+ default:
+ break;
}
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
createTestMeters("8", "add");
writeMeter(ci, testMeter1, testMeter2);
break;
-
+ default:
+ break;
}
// createTestMeters();
// writeMeter(ci, testMeter);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
createTestMeters("4", "modify");
writeMeter(ci, testMeter1, testMeter2);
break;
+ default:
+ break;
}
}
private NotificationProviderService notificationService;
/**
- * get data service
+ * Gets the data service.
*
* @return {@link #dataService}
*/
}
/**
- * set {@link #dataService}
- *
- * @param dataService
+ * Sets the {@link #dataService}.
*/
public void setDataService(final DataBroker dataService) {
this.dataService = dataService;
}
/**
- * get meter registration
+ * Gets the meter registration.
*
* @return {@link #meterRegistration}
*/
}
/**
- * set {@link #meterRegistration}
- *
- * @param meterRegistration
+ * Sets the {@link #meterRegistration}.
*/
public void setMeterRegistration(
final RoutedRpcRegistration<SalMeterService> meterRegistration) {
}
/**
- * get notification service
+ * Gets the notification service.
*
* @return {@link #notificationService}
*/
}
/**
- * set {@link #notificationService}
- *
- * @param notificationService
+ * Sets the {@link #notificationService}.
*/
public void setNotificationService(
final NotificationProviderService notificationService) {
*
* @see java.lang.AutoCloseable#close()
*/
+ @Override
public void close() {
OpenflowpluginMeterTestServiceProvider.LOG
.info("SalMeterServiceProvide stopped.");
* #addMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.meter
* .service.rev130918.AddMeterInput)
*/
+ @Override
public Future<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
- String plus = ("addMeter - " + input);
+ String plus = "addMeter - " + input;
OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
return null;
}
* #removeMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
* .meter.service.rev130918.RemoveMeterInput)
*/
+ @Override
public Future<RpcResult<RemoveMeterOutput>> removeMeter(
final RemoveMeterInput input) {
- String plus = ("removeMeter - " + input);
+ String plus = "removeMeter - " + input;
OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
return null;
}
* #updateMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
* .meter.service.rev130918.UpdateMeterInput)
*/
+ @Override
public Future<RpcResult<UpdateMeterOutput>> updateMeter(
final UpdateMeterInput input) {
- String plus = ("updateMeter - " + input);
+ String plus = "updateMeter - " + input;
OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
return null;
}
- /**
- * @param ctx
- * @return {@link ObjectRegistration}
- */
public ObjectRegistration<OpenflowpluginMeterTestServiceProvider> register(
final ProviderContext ctx) {
RoutedRpcRegistration<SalMeterService> addRoutedRpcImplementation = ctx
- .<SalMeterService> addRoutedRpcImplementation(
+ .<SalMeterService>addRoutedRpcImplementation(
SalMeterService.class, this);
setMeterRegistration(addRoutedRpcImplementation);
InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
- .<Nodes> builder(Nodes.class);
+ .<Nodes>builder(Nodes.class);
NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
NodeKey nodeKey = new NodeKey(nodeId);
InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
- .<Node, NodeKey> child(Node.class, nodeKey);
+ .<Node, NodeKey>child(Node.class, nodeKey);
InstanceIdentifier<Node> instance = nodeIndentifier.build();
}
};
}
-
}
package org.opendaylight.openflowplugin.test;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowpluginStatsTestCommandProvider implements CommandProvider {
- private static final Logger LOG = LoggerFactory
- .getLogger(OpenflowpluginStatsTestCommandProvider.class);
- private DataBroker dataProviderService;
- private final BundleContext ctx;
-
- public OpenflowpluginStatsTestCommandProvider(BundleContext ctx) {
- this.ctx = ctx;
- }
-
- public void onSessionInitiated(ProviderContext session) {
- dataProviderService = session.getSALService(DataBroker.class);
- ctx.registerService(CommandProvider.class.getName(), this, null);
-
- }
-
- public void _portStats(CommandInterpreter ci) {
- int nodeConnectorCount = 0;
- int nodeConnectorStatsCount = 0;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeKey);
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
- nodeRef);
- if (node != null) {
- if (node.getNodeConnector() != null) {
- List<NodeConnector> ports = node.getNodeConnector();
-
- for (Iterator<NodeConnector> iterator2 = ports.iterator(); iterator2
- .hasNext();) {
- nodeConnectorCount++;
- NodeConnectorKey nodeConnectorKey = iterator2.next().getKey();
- InstanceIdentifier<NodeConnector> connectorRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .child(NodeConnector.class, nodeConnectorKey);
- NodeConnector nodeConnector = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, connectorRef);
- if (nodeConnector != null) {
- FlowCapableNodeConnectorStatisticsData data = nodeConnector
- .getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
- if (null != data) {
- nodeConnectorStatsCount++;
- }
- }
- }
+ private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginStatsTestCommandProvider.class);
+ private DataBroker dataProviderService;
+ private final BundleContext ctx;
+
+ public OpenflowpluginStatsTestCommandProvider(BundleContext ctx) {
+ this.ctx = ctx;
+ }
+
+ public void onSessionInitiated(ProviderContext session) {
+ dataProviderService = session.getSALService(DataBroker.class);
+ ctx.registerService(CommandProvider.class.getName(), this, null);
+
+ }
+
+ public void _portStats(CommandInterpreter ci) {
+ int nodeConnectorCount = 0;
+ int nodeConnectorStatsCount = 0;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ if (node.getNodeConnector() != null) {
+ List<NodeConnector> ports = node.getNodeConnector();
+
+ for (NodeConnector nodeConnector2 : ports) {
+ nodeConnectorCount++;
+ NodeConnectorKey nodeConnectorKey = nodeConnector2.getKey();
+ InstanceIdentifier<NodeConnector> connectorRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey);
+ NodeConnector nodeConnector = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
+ connectorRef);
+ if (nodeConnector != null) {
+ FlowCapableNodeConnectorStatisticsData data = nodeConnector
+ .getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
+ if (null != data) {
+ nodeConnectorStatsCount++;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (nodeConnectorCount == nodeConnectorStatsCount) {
+ LOG.debug("portStats - Success");
+ } else {
+ LOG.debug("portStats - Failed");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
+
+ }
+
+ public void _portDescStats(CommandInterpreter ci) {
+ int nodeConnectorCount = 0;
+ int nodeConnectorDescStatsCount = 0;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
+
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ if (node.getNodeConnector() != null) {
+ List<NodeConnector> ports = node.getNodeConnector();
+ for (NodeConnector nodeConnector2 : ports) {
+ nodeConnectorCount++;
+ NodeConnectorKey nodeConnectorKey = nodeConnector2.getKey();
+ InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier
+ .create(Nodes.class).child(Node.class, nodeKey)
+ .child(NodeConnector.class, nodeConnectorKey)
+ .augmentation(FlowCapableNodeConnector.class);
+ FlowCapableNodeConnector nodeConnector = TestProviderTransactionUtil
+ .getDataObject(readOnlyTransaction, connectorRef);
+ if (nodeConnector != null) {
+ if (null != nodeConnector.getName() && null != nodeConnector.getCurrentFeature()
+ && null != nodeConnector.getState() && null != nodeConnector.getHardwareAddress()
+ && null != nodeConnector.getPortNumber()) {
+ nodeConnectorDescStatsCount++;
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ if (nodeConnectorCount == nodeConnectorDescStatsCount) {
+ LOG.debug("portDescStats - Success");
+ } else {
+ LOG.debug("portDescStats - Failed");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
+
+ }
+
+ public void _flowStats(CommandInterpreter ci) {
+ int flowCount = 0;
+ int flowStatsCount = 0;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+
+ if (node != null) {
+ List<Table> tables = node.getTable();
+ for (Table table2 : tables) {
+ TableKey tableKey = table2.getKey();
+ InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Table.class, tableKey);
+ Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
+ if (table != null) {
+ if (table.getFlow() != null) {
+ List<Flow> flows = table.getFlow();
+ for (Flow flow2 : flows) {
+ flowCount++;
+ FlowKey flowKey = flow2.getKey();
+ InstanceIdentifier<Flow> flowRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Table.class, tableKey).child(Flow.class, flowKey);
+ Flow flow = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, flowRef);
+ if (flow != null) {
+ FlowStatisticsData data = flow.getAugmentation(FlowStatisticsData.class);
+ if (null != data) {
+ flowStatsCount++;
+ LOG.debug("--------------------------------------------");
+ ci.print(data);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (flowCount == flowStatsCount) {
+ LOG.debug("flowStats - Success");
+ } else {
+ LOG.debug("flowStats - Failed");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
+
}
- }
- }
-
- if (nodeConnectorCount == nodeConnectorStatsCount) {
- LOG.debug("portStats - Success");
- } else {
- LOG.debug("portStats - Failed");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
-
- }
-
- public void _portDescStats(CommandInterpreter ci) {
- int nodeConnectorCount = 0;
- int nodeConnectorDescStatsCount = 0;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeKey);
-
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
- nodeRef);
- if (node != null) {
- if (node.getNodeConnector() != null) {
- List<NodeConnector> ports = node.getNodeConnector();
- for (Iterator<NodeConnector> iterator2 = ports.iterator(); iterator2
- .hasNext();) {
- nodeConnectorCount++;
- NodeConnectorKey nodeConnectorKey = iterator2.next().getKey();
- InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .child(NodeConnector.class, nodeConnectorKey)
- .augmentation(FlowCapableNodeConnector.class);
- FlowCapableNodeConnector nodeConnector = TestProviderTransactionUtil
- .getDataObject(readOnlyTransaction, connectorRef);
- if (nodeConnector != null) {
- if (null != nodeConnector.getName()
- && null != nodeConnector.getCurrentFeature()
- && null != nodeConnector.getState()
- && null != nodeConnector.getHardwareAddress()
- && null != nodeConnector.getPortNumber()) {
- nodeConnectorDescStatsCount++;
- }
- }
- }
+
+ public void _tableStats(CommandInterpreter ci) {
+ int tableCount = 0;
+ int tableStatsCount = 0;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ List<Table> tables = node.getTable();
+ for (Table table2 : tables) {
+ tableCount++;
+ TableKey tableKey = table2.getKey();
+ InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Table.class, tableKey);
+ Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
+ if (table != null) {
+ FlowTableStatisticsData data = table.getAugmentation(FlowTableStatisticsData.class);
+ if (null != data) {
+ tableStatsCount++;
+ }
+ }
+ }
+ }
+ }
+
+ if (tableCount == tableStatsCount) {
+ LOG.debug("tableStats - Success");
+ } else {
+ LOG.debug("tableStats - Failed");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
+
}
- }
- }
-
- if (nodeConnectorCount == nodeConnectorDescStatsCount) {
- LOG.debug("portDescStats - Success");
- } else {
- LOG.debug("portDescStats - Failed");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
-
- }
-
- public void _flowStats(CommandInterpreter ci) {
- int flowCount = 0;
- int flowStatsCount = 0;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
-
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
-
- if (node != null) {
- List<Table> tables = node.getTable();
- for (Iterator<Table> iterator2 = tables.iterator(); iterator2.hasNext();) {
- TableKey tableKey = iterator2.next().getKey();
- InstanceIdentifier<Table> tableRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
- Table table = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, tableRef);
- if (table != null) {
- if (table.getFlow() != null) {
- List<Flow> flows = table.getFlow();
- for (Iterator<Flow> iterator3 = flows.iterator(); iterator3.hasNext();) {
- flowCount++;
- FlowKey flowKey = iterator3.next().getKey();
- InstanceIdentifier<Flow> flowRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Table.class, tableKey)
- .child(Flow.class, flowKey);
- Flow flow = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, flowRef);
- if (flow != null) {
- FlowStatisticsData data = flow
- .getAugmentation(FlowStatisticsData.class);
- if (null != data) {
- flowStatsCount++;
- LOG.debug("--------------------------------------------");
- ci.print(data);
- }
+ public void _groupStats(CommandInterpreter ci) {
+ int groupCount = 0;
+ int groupStatsCount = 0;
+ NodeGroupStatistics data = null;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ if (node.getGroup() != null) {
+ List<Group> groups = node.getGroup();
+ for (Group group2 : groups) {
+ groupCount++;
+ GroupKey groupKey = group2.getKey();
+ InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Group.class, groupKey);
+ Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
+ if (group != null) {
+ data = group.getAugmentation(NodeGroupStatistics.class);
+ if (null != data) {
+ groupStatsCount++;
+ }
+ }
+ }
+ }
+
+ }
}
- }
- }
- }
+ if (groupCount == groupStatsCount) {
+ LOG.debug("---------------------groupStats - Success-------------------------------");
+ } else {
+ LOG.debug("------------------------------groupStats - Failed--------------------------");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
}
- }
- }
-
- if (flowCount == flowStatsCount) {
- LOG.debug("flowStats - Success");
- } else {
- LOG.debug("flowStats - Failed");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
-
- }
-
- public void _tableStats(CommandInterpreter ci) {
- int tableCount = 0;
- int tableStatsCount = 0;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
-
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
- if (node != null) {
- List<Table> tables = node.getTable();
- for (Iterator<Table> iterator2 = tables.iterator(); iterator2.hasNext();) {
- tableCount++;
- TableKey tableKey = iterator2.next().getKey();
- InstanceIdentifier<Table> tableRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
- Table table = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, tableRef);
- if (table != null) {
- FlowTableStatisticsData data = table
- .getAugmentation(FlowTableStatisticsData.class);
- if (null != data) {
- tableStatsCount++;
- }
- }
+
+ public void _groupDescStats(CommandInterpreter ci) {
+ int groupCount = 0;
+ int groupDescStatsCount = 0;
+ NodeGroupDescStats data = null;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+
+ if (node != null) {
+ if (node.getGroup() != null) {
+ List<Group> groups = node.getGroup();
+ for (Group group2 : groups) {
+ groupCount++;
+ GroupKey groupKey = group2.getKey();
+ InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Group.class, groupKey);
+ Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
+ if (group != null) {
+ data = group.getAugmentation(NodeGroupDescStats.class);
+ if (null != data) {
+ groupDescStatsCount++;
+ }
+ }
+
+ }
+ }
+ }
+
+ if (groupCount == groupDescStatsCount) {
+ LOG.debug("---------------------groupDescStats - Success-------------------------------");
+ } else {
+ LOG.debug("------------------------------groupDescStats - Failed--------------------------");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
+ }
}
- }
- }
-
- if (tableCount == tableStatsCount) {
- LOG.debug("tableStats - Success");
- } else {
- LOG.debug("tableStats - Failed");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
-
- }
-
- public void _groupStats(CommandInterpreter ci) {
- int groupCount = 0;
- int groupStatsCount = 0;
- NodeGroupStatistics data = null;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
- if (node != null) {
- if (node.getGroup() != null) {
- List<Group> groups = node.getGroup();
- for (Iterator<Group> iterator2 = groups.iterator(); iterator2.hasNext();) {
- groupCount++;
- GroupKey groupKey = iterator2.next().getKey();
- InstanceIdentifier<Group> groupRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
- Group group = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, groupRef);
- if (group != null) {
- data = group.getAugmentation(NodeGroupStatistics.class);
- if (null != data) {
- groupStatsCount++;
- }
- }
- }
+
+ public void _meterStats(CommandInterpreter ci) {
+ int meterCount = 0;
+ int meterStatsCount = 0;
+ NodeMeterStatistics data = null;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ if (node.getMeter() != null) {
+ List<Meter> meters = node.getMeter();
+ for (Meter meter2 : meters) {
+ meterCount++;
+ MeterKey meterKey = meter2.getKey();
+ InstanceIdentifier<Meter> meterRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Meter.class, meterKey);
+ Meter meter = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, meterRef);
+ if (meter != null) {
+ data = meter.getAugmentation(NodeMeterStatistics.class);
+ if (null != data) {
+ meterStatsCount++;
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ if (meterCount == meterStatsCount) {
+ LOG.debug("---------------------------meterStats - Success-------------------------------------");
+ } else {
+ LOG.debug("----------------------------meterStats - Failed-------------------------------------");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
}
- }
- }
-
- if (groupCount == groupStatsCount) {
- LOG
- .debug("---------------------groupStats - Success-------------------------------");
- } else {
- LOG
- .debug("------------------------------groupStats - Failed--------------------------");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
- }
-
- public void _groupDescStats(CommandInterpreter ci) {
- int groupCount = 0;
- int groupDescStatsCount = 0;
- NodeGroupDescStats data = null;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
-
- if (node != null) {
- if (node.getGroup() != null) {
- List<Group> groups = node.getGroup();
- for (Iterator<Group> iterator2 = groups.iterator(); iterator2.hasNext();) {
- groupCount++;
- GroupKey groupKey = iterator2.next().getKey();
- InstanceIdentifier<Group> groupRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Group.class, groupKey);
- Group group = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, groupRef);
- if (group != null) {
- data = group.getAugmentation(NodeGroupDescStats.class);
- if (null != data) {
- groupDescStatsCount++;
- }
- }
-
- }
+ public void _meterConfigStats(CommandInterpreter ci) {
+ int meterCount = 0;
+ int meterConfigStatsCount = 0;
+ NodeMeterConfigStats data = null;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ if (node.getMeter() != null) {
+ List<Meter> meters = node.getMeter();
+ for (Meter meter2 : meters) {
+ meterCount++;
+ MeterKey meterKey = meter2.getKey();
+ InstanceIdentifier<Meter> meterRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Meter.class, meterKey);
+ Meter meter = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, meterRef);
+ if (meter != null) {
+ data = meter.getAugmentation(NodeMeterConfigStats.class);
+ if (null != data) {
+ meterConfigStatsCount++;
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ if (meterCount == meterConfigStatsCount) {
+ LOG.debug("---------------------------meterConfigStats - Success-------------------------------------");
+ ci.print(data);
+ } else {
+ LOG.debug("----------------------------meterConfigStats - Failed-------------------------------------");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
}
- }
-
- if (groupCount == groupDescStatsCount) {
- LOG
- .debug("---------------------groupDescStats - Success-------------------------------");
- } else {
- LOG
- .debug("------------------------------groupDescStats - Failed--------------------------");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
- }
- }
-
- public void _meterStats(CommandInterpreter ci) {
- int meterCount = 0;
- int meterStatsCount = 0;
- NodeMeterStatistics data = null;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
- if (node != null) {
- if (node.getMeter() != null) {
- List<Meter> meters = node.getMeter();
- for (Iterator<Meter> iterator2 = meters.iterator(); iterator2.hasNext();) {
- meterCount++;
- MeterKey meterKey = iterator2.next().getKey();
- InstanceIdentifier<Meter> meterRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
- Meter meter = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, meterRef);
- if (meter != null) {
- data = meter.getAugmentation(NodeMeterStatistics.class);
- if (null != data) {
- meterStatsCount++;
- }
- }
- }
+
+ public void _aggregateStats(CommandInterpreter ci) {
+ int aggregateFlowCount = 0;
+ int aggerateFlowStatsCount = 0;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ List<Table> tables = node.getTable();
+ for (Table table2 : tables) {
+ aggregateFlowCount++;
+ TableKey tableKey = table2.getKey();
+ InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
+ .child(Table.class, tableKey);
+ Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
+ if (table != null) {
+ AggregateFlowStatisticsData data = table.getAugmentation(AggregateFlowStatisticsData.class);
+ if (null != data) {
+ aggerateFlowStatsCount++;
+ }
+ }
+ }
+ }
+ }
+
+ if (aggregateFlowCount == aggerateFlowStatsCount) {
+ LOG.debug("aggregateStats - Success");
+ } else {
+ LOG.debug("aggregateStats - Failed");
+ LOG.debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
+ }
}
- }
- }
-
- if (meterCount == meterStatsCount) {
- LOG
- .debug("---------------------------meterStats - Success-------------------------------------");
- } else {
- LOG
- .debug("----------------------------meterStats - Failed-------------------------------------");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
- }
-
- public void _meterConfigStats(CommandInterpreter ci) {
- int meterCount = 0;
- int meterConfigStatsCount = 0;
- NodeMeterConfigStats data = null;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
- if (node != null) {
- if (node.getMeter() != null) {
- List<Meter> meters = node.getMeter();
- for (Iterator<Meter> iterator2 = meters.iterator(); iterator2.hasNext();) {
- meterCount++;
- MeterKey meterKey = iterator2.next().getKey();
- InstanceIdentifier<Meter> meterRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
- Meter meter = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, meterRef);
- if (meter != null) {
- data = meter.getAugmentation(NodeMeterConfigStats.class);
- if (null != data) {
- meterConfigStatsCount++;
- }
- }
- }
+
+ public void _descStats(CommandInterpreter ci) {
+ int descCount = 0;
+ int descStatsCount = 0;
+ List<Node> nodes = getNodes();
+ for (Node node2 : nodes) {
+ descCount++;
+ NodeKey nodeKey = node2.getKey();
+ InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
+ .child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ FlowCapableNode node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
+ if (node != null) {
+ if (null != node.getHardware() && null != node.getManufacturer() && null != node.getSoftware()) {
+ descStatsCount++;
+ }
+ }
+ }
+
+ if (descCount == descStatsCount) {
+ LOG.debug("descStats - Success");
+ } else {
+ LOG.debug("descStats - Failed");
+ LOG.debug("System fetches stats data in 50 seconds interval, so please wait and try again.");
+ }
}
- }
- }
-
- if (meterCount == meterConfigStatsCount) {
- LOG
- .debug("---------------------------meterConfigStats - Success-------------------------------------");
- ci.print(data);
- } else {
- LOG
- .debug("----------------------------meterConfigStats - Failed-------------------------------------");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
- }
-
- public void _aggregateStats(CommandInterpreter ci) {
- int aggregateFlowCount = 0;
- int aggerateFlowStatsCount = 0;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
- if (node != null) {
- List<Table> tables = node.getTable();
- for (Iterator<Table> iterator2 = tables.iterator(); iterator2.hasNext();) {
- aggregateFlowCount++;
- TableKey tableKey = iterator2.next().getKey();
- InstanceIdentifier<Table> tableRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class).child(Table.class, tableKey);
- Table table = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, tableRef);
- if (table != null) {
- AggregateFlowStatisticsData data = table
- .getAugmentation(AggregateFlowStatisticsData.class);
- if (null != data) {
- aggerateFlowStatsCount++;
- }
- }
+
+ private List<Node> getNodes() {
+ ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
+ InstanceIdentifier<Nodes> nodesID = InstanceIdentifier.create(Nodes.class);
+ Nodes nodes = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodesID);
+ if (nodes == null) {
+ throw new RuntimeException("nodes are not found, pls add the node.");
+ }
+ return nodes.getNode();
}
- }
- }
-
- if (aggregateFlowCount == aggerateFlowStatsCount) {
- LOG.debug("aggregateStats - Success");
- } else {
- LOG.debug("aggregateStats - Failed");
- LOG
- .debug("System fetchs stats data in 50 seconds interval, so pls wait and try again.");
- }
-
- }
-
- public void _descStats(CommandInterpreter ci) {
- int descCount = 0;
- int descStatsCount = 0;
- List<Node> nodes = getNodes();
- for (Iterator<Node> iterator = nodes.iterator(); iterator.hasNext();) {
- descCount++;
- NodeKey nodeKey = iterator.next().getKey();
- InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier
- .create(Nodes.class).child(Node.class, nodeKey)
- .augmentation(FlowCapableNode.class);
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- FlowCapableNode node = TestProviderTransactionUtil.getDataObject(
- readOnlyTransaction, nodeRef);
- if (node != null) {
- if (null != node.getHardware() && null != node.getManufacturer()
- && null != node.getSoftware()) {
- descStatsCount++;
+
+ @Override
+ public String getHelp() {
+ StringBuilder help = new StringBuilder();
+ help.append("---MD-SAL Stats test module---\n");
+ return help.toString();
}
- }
- }
-
- if (descCount == descStatsCount) {
- LOG.debug("descStats - Success");
- } else {
- LOG.debug("descStats - Failed");
- LOG
- .debug("System fetches stats data in 50 seconds interval, so please wait and try again.");
- }
-
- }
-
- private List<Node> getNodes() {
- ReadOnlyTransaction readOnlyTransaction = dataProviderService
- .newReadOnlyTransaction();
- InstanceIdentifier<Nodes> nodesID = InstanceIdentifier.create(Nodes.class);
- Nodes nodes = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
- nodesID);
- if (nodes == null) {
- throw new RuntimeException("nodes are not found, pls add the node.");
- }
- return nodes.getNode();
- }
-
- @Override
- public String getHelp() {
- StringBuilder help = new StringBuilder();
- help.append("---MD-SAL Stats test module---\n");
- return help.toString();
- }
}
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.osgi.framework.BundleContext;
-
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandProvider {
private DataBroker dataBroker;
- private ProviderContext pc;
private final BundleContext ctx;
- private TableFeatures testTable;
private Node testNode;
- private final String originalTableName = "Foo";
- private final String updatedTableName = "Bar";
public OpenflowpluginTableFeaturesTestCommandProvider(BundleContext ctx) {
this.ctx = ctx;
}
public void onSessionInitiated(ProviderContext session) {
- pc = session;
dataBroker = session.getSALService(DataBroker.class);
ctx.registerService(CommandProvider.class.getName(), this, null);
// createTestNode();
tableFeature.setConfig(new TableConfig(false));
- List<TableFeatureProperties> properties = new ArrayList<TableFeatureProperties>();
+ List<TableFeatureProperties> properties = new ArrayList<>();
switch (tableFeatureType) {
// To set the wildcards set field match
properties.add(createWildCardsTblFeatureProp().build());
break;
+ default:
+ break;
}
propertyBld.setTableFeatureProperties(properties);
tableFeature.setTableProperties(propertyBld.build());
}
- testTable = tableFeature.build();
return tableFeature;
}
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
//To set the ApplyActionsMiss
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new PopMplsActionCaseBuilder().build());
actionList.add(ab.build());
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder()
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.ApplyActionsMissBuilder()
.setApplyActionsMiss(new ApplyActionsMissBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
private TableFeaturePropertiesBuilder createApplyActionsTblFeatureProp() {
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<Action> actionListt5 = new ArrayList<Action>();
+ List<Action> actionListt5 = new ArrayList<>();
ActionBuilder abt5 = new ActionBuilder();
abt5.setAction(new PopMplsActionCaseBuilder().build());
actionListt5.add(abt5.build());
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder()
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.ApplyActionsBuilder()
.setApplyActions(new ApplyActionsBuilder().setAction(actionListt5).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
private TableFeaturePropertiesBuilder createInstructionsTblFeatureProp() {
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
- List<Instruction> instLst = new ArrayList<Instruction>();
InstructionBuilder ib = new InstructionBuilder();
ib.setOrder(1);
- ib.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder().build());
+ ib.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+ .instruction.ApplyActionsCaseBuilder().build());
ib.setKey(new InstructionKey(1));
+ List<Instruction> instLst = new ArrayList<>();
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder().setInstructions(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder().setInstruction(instLst).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.InstructionsBuilder().setInstructions(
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type
+ .table.feature.prop.type.instructions.InstructionsBuilder().setInstruction(instLst).build())
+ .build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
private TableFeaturePropertiesBuilder createInstructionsMissTblFeatureProp() {
// To set the instructions miss -- "t7"
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<Instruction> instLst = new ArrayList<Instruction>();
InstructionBuilder ib1 = new InstructionBuilder();
ib1.setOrder(1);
- ib1.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCaseBuilder().build());
+ ib1.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+ .instruction.WriteMetadataCaseBuilder().build());
ib1.setKey(new InstructionKey(1));
InstructionBuilder ib2 = new InstructionBuilder();
ib2.setOrder(2);
- ib2.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.MeterCaseBuilder().build());
+ ib2.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+ .instruction.MeterCaseBuilder().build());
ib2.setKey(new InstructionKey(2));
+ List<Instruction> instLst = new ArrayList<>();
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder().setInstructionsMiss(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder().setInstruction(instLst).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.InstructionsMissBuilder().setInstructionsMiss(
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type
+ .table.feature.prop.type.instructions.miss.InstructionsMissBuilder().setInstruction(instLst)
+ .build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
private TableFeaturePropertiesBuilder createWriteActionsTblFeatureProp() {
// t8
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder abt1 = new ActionBuilder();
abt1.setAction(new CopyTtlOutCaseBuilder().build());
abt2.setAction(new PopVlanActionCaseBuilder().build());
actionList.add(abt2.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder()
- .setWriteActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.WriteActionsBuilder().setAction(actionList).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.WriteActionsBuilder().setWriteActions(new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions
+ .WriteActionsBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
private TableFeaturePropertiesBuilder createWriteActionsMissTblFeatureProp() {
// t9
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder abt1 = new ActionBuilder();
abt1.setAction(new CopyTtlInCaseBuilder().build());
abt2.setAction(new PushPbbActionCaseBuilder().build());
actionList.add(abt2.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder()
- .setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.WriteActionsMissBuilder().setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions
+ .miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
private TableFeaturePropertiesBuilder createMatchFieldTblFeatureProp() {
//t10
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
SetFieldMatchBuilder setFieldMatchBld = new SetFieldMatchBuilder();
setFieldMatchBld.setHasMask(false);
setFieldMatchBld.setMatchType(MplsLabel.class);
matchSetfieldBld.setSetFieldMatch(setFieldMatch);
matchBld.setMatchSetfield(matchSetfieldBld.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(matchBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
private TableFeaturePropertiesBuilder createWriteSetFieldTblFeatureProp() {
//t11
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(MplsLabel.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(EthDst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
WriteSetfieldBuilder writeSetfieldBld = new WriteSetfieldBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder writeSetfieldBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.setfield.WriteSetfieldBuilder writeSetfieldBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.write.setfield.WriteSetfieldBuilder();
writeSetfieldBuilder.setSetFieldMatch(setFieldMatch);
writeSetfieldBld.setWriteSetfield(writeSetfieldBuilder.build());
-
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
private TableFeaturePropertiesBuilder createWriteSetFieldMissTblFeatureProp() {
// t12
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(EthSrc.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(Ipv4Dst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
WriteSetfieldMissBuilder writeSetfieldBld = new WriteSetfieldMissBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder writeSetfieldMissBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.setfield.miss.WriteSetfieldMissBuilder writeSetfieldMissBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder();
writeSetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
writeSetfieldBld.setWriteSetfieldMiss(writeSetfieldMissBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
private TableFeaturePropertiesBuilder createApplySetFieldTblFeatureProp() {
//t13
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(Ipv4Dst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
ApplySetfieldBuilder applySetfieldBld = new ApplySetfieldBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.apply.setfield.ApplySetfieldBuilder();
applySetfieldBuilder.setSetFieldMatch(setFieldMatch);
applySetfieldBld.setApplySetfield(applySetfieldBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(applySetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
private TableFeaturePropertiesBuilder createApplySetFieldMissTblFeatureProp() {
//t14
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(Ipv4Dst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
ApplySetfieldMissBuilder applySetfieldMissBld = new ApplySetfieldMissBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder applySetfieldMissBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.setfield.miss.ApplySetfieldMissBuilder applySetfieldMissBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder();
applySetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
applySetfieldMissBld.setApplySetfieldMiss(applySetfieldMissBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(applySetfieldMissBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
private TableFeaturePropertiesBuilder createWildCardsTblFeatureProp() {
//t15
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
setFieldMatchBld2.setHasMask(true);
setFieldMatchBld2.setMatchType(InPort.class);
-
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
wildcardsBuilder.setSetFieldMatch(setFieldMatch);
wildCardsBld.setWildcardSetfield(wildcardsBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(wildCardsBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
tableFeatureProperty.setKey(keyValue);
return tableFeatureProperty;
}
-
private void writeTableFeatures(final CommandInterpreter ci, TableFeatures tableFeatures) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
KeyedInstanceIdentifier<TableFeatures, TableFeaturesKey> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class).
- child(TableFeatures.class, new TableFeaturesKey(tableFeatures.getTableId()));
-
+ .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(TableFeatures.class, new TableFeaturesKey(tableFeatures.getTableId()));
modification.merge(LogicalDatastoreType.OPERATIONAL, nodeToInstanceId(testNode), testNode, true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path1, tableFeatures, true);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
return help.toString();
}
-
}
private NotificationProviderService notificationService;
/**
- * get table registration
+ * Get table registration.
*
* @return {@link #tableRegistration}
*/
}
/**
- * set {@link #tableRegistration}
- *
- * @param tableRegistration
+ * Set {@link #tableRegistration}.
*/
public void setTableRegistration(
final RoutedRpcRegistration<SalTableService> tableRegistration) {
}
/**
- * get notification service
+ * Get notification service.
*
* @return {@link #notificationService}
*/
}
/**
- * set {@link #notificationService}
- *
- * @param notificationService
+ * Set {@link #notificationService}.
*/
public void setNotificationService(
final NotificationProviderService notificationService) {
@Override
public Future<RpcResult<UpdateTableOutput>> updateTable(
UpdateTableInput input) {
- String plus = ("updateTable - " + input);
+ String plus = "updateTable - " + input;
OpenflowpluginTableFeaturesTestServiceProvider.LOG.info(plus);
return null;
}
- /**
- * @param ctx
- * @return {@link ObjectRegistration}
- */
public ObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(
final ProviderContext ctx) {
RoutedRpcRegistration<SalTableService> addRoutedRpcImplementation = ctx
- .<SalTableService> addRoutedRpcImplementation(
+ .<SalTableService>addRoutedRpcImplementation(
SalTableService.class, this);
setTableRegistration(addRoutedRpcImplementation);
InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
- .<Nodes> builder(Nodes.class);
+ .<Nodes>builder(Nodes.class);
NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
NodeKey nodeKey = new NodeKey(nodeId);
InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
- .<Node, NodeKey> child(Node.class, nodeKey);
+ .<Node, NodeKey>child(Node.class, nodeKey);
InstanceIdentifier<Node> instance = nodeIndentifier.build();
}
};
}
-
}
/**
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
private static final Logger LOG = LoggerFactory
.getLogger(OpenflowpluginTestActivator.class);
-
+
private static OpenflowpluginTestServiceProvider provider = new OpenflowpluginTestServiceProvider();
private static OpenflowpluginGroupTestServiceProvider groupProvider = new OpenflowpluginGroupTestServiceProvider();
private static OpenflowpluginMeterTestServiceProvider meterProvider = new OpenflowpluginMeterTestServiceProvider();
- private static OpenflowpluginTableFeaturesTestServiceProvider tableProvider = new OpenflowpluginTableFeaturesTestServiceProvider();
+ private static OpenflowpluginTableFeaturesTestServiceProvider tableProvider =
+ new OpenflowpluginTableFeaturesTestServiceProvider();
private OpenflowpluginTestCommandProvider cmdProvider;
/*
* (non-Javadoc)
- *
+ *
* @see org.opendaylight.controller.sal.binding.api.BindingAwareProvider#
* onSessionInitiated
* (org.opendaylight.controller.sal.binding.api.BindingAwareBroker
@Override
public void onSessionInitiated(ProviderContext session) {
DataBroker salService = session
- .<DataBroker> getSALService(DataBroker.class);
+ .<DataBroker>getSALService(DataBroker.class);
OpenflowpluginTestActivator.provider.setDataService(salService);
NotificationProviderService salService1 = session
- .<NotificationProviderService> getSALService(NotificationProviderService.class);
+ .<NotificationProviderService>getSALService(NotificationProviderService.class);
OpenflowpluginTestActivator.provider
.setNotificationService(salService1);
/*
* (non-Javadoc)
- *
+ *
* @see
* org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
* #startImpl(org.osgi.framework.BundleContext)
*/
+ @Override
public void startImpl(final BundleContext ctx) {
super.startImpl(ctx);
OpenflowpluginTestCommandProvider openflowpluginTestCommandProvider = new OpenflowpluginTestCommandProvider(
ctx);
this.cmdProvider = openflowpluginTestCommandProvider;
- OpenflowpluginGroupTestCommandProvider openflowpluginGroupTestCommandProvider = new OpenflowpluginGroupTestCommandProvider(
- ctx);
+ OpenflowpluginGroupTestCommandProvider openflowpluginGroupTestCommandProvider =
+ new OpenflowpluginGroupTestCommandProvider(ctx);
this.cmdGroupProvider = openflowpluginGroupTestCommandProvider;
- OpenflowpluginMeterTestCommandProvider openflowpluginMeterTestCommandProvider = new OpenflowpluginMeterTestCommandProvider(
- ctx);
+ OpenflowpluginMeterTestCommandProvider openflowpluginMeterTestCommandProvider =
+ new OpenflowpluginMeterTestCommandProvider(ctx);
this.cmdMeterProvider = openflowpluginMeterTestCommandProvider;
- OpenflowpluginTableFeaturesTestCommandProvider openflowpluginTableFeaturesTestCommandProvider = new OpenflowpluginTableFeaturesTestCommandProvider(
- ctx);
+ OpenflowpluginTableFeaturesTestCommandProvider openflowpluginTableFeaturesTestCommandProvider =
+ new OpenflowpluginTableFeaturesTestCommandProvider(ctx);
this.cmdTableProvider = openflowpluginTableFeaturesTestCommandProvider;
- OpenflowpluginStatsTestCommandProvider openflowpluginStatsTestCommandProvider = new OpenflowpluginStatsTestCommandProvider(
- ctx);
+ OpenflowpluginStatsTestCommandProvider openflowpluginStatsTestCommandProvider =
+ new OpenflowpluginStatsTestCommandProvider(ctx);
this.cmdStatsProvider = openflowpluginStatsTestCommandProvider;
- OpenflowpluginTestNodeConnectorNotification openflowpluginTestNodeConnectorNotification = new OpenflowpluginTestNodeConnectorNotification(
- ctx);
+ OpenflowpluginTestNodeConnectorNotification openflowpluginTestNodeConnectorNotification =
+ new OpenflowpluginTestNodeConnectorNotification(ctx);
this.cmdNodeConnectorNotification = openflowpluginTestNodeConnectorNotification;
- OpenflowpluginTestTopologyNotification openflowpluginTestTopologyNotification = new OpenflowpluginTestTopologyNotification(
- ctx);
+ OpenflowpluginTestTopologyNotification openflowpluginTestTopologyNotification =
+ new OpenflowpluginTestTopologyNotification(ctx);
this.cmdTopologyNotification = openflowpluginTestTopologyNotification;
- OpenflowPluginBulkTransactionProvider openflowPluginBulkTransactionProvider = new OpenflowPluginBulkTransactionProvider(
- ctx);
+ OpenflowPluginBulkTransactionProvider openflowPluginBulkTransactionProvider =
+ new OpenflowPluginBulkTransactionProvider(ctx);
this.bulkCmdProvider = openflowPluginBulkTransactionProvider;
- OpenflowPluginBulkGroupTransactionProvider openflowPluginBulkGroupTransactionProvider = new OpenflowPluginBulkGroupTransactionProvider(
- ctx);
+ OpenflowPluginBulkGroupTransactionProvider openflowPluginBulkGroupTransactionProvider =
+ new OpenflowPluginBulkGroupTransactionProvider(ctx);
this.groupCmdProvider = openflowPluginBulkGroupTransactionProvider;
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
* #stopImpl(org.osgi.framework.BundleContext)
*/
+ @Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
protected void stopImpl(final BundleContext context) {
try {
LOG.error("Stopping bundle OpenflowpluginTestActivator failed.", e);
}
}
-
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowpluginTestCommandProvider implements CommandProvider {
private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestCommandProvider.class);
short table = TABLE_ID;
try {
table = Short.parseShort(tableId);
- } catch (final Exception ex) {
+ } catch (NumberFormatException ex) {
LOG.info("Parsing String tableId {} failed. Continuing with default tableId {}.",
tableId, table);
}
return table;
}
- /**
- * @return
- */
private static InstructionsBuilder createDecNwTtlInstructions() {
final DecNwTtlBuilder ta = new DecNwTtlBuilder();
final DecNwTtl decNwTtl = ta.build();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
ab.setKey(new ActionKey(0));
// Add our drop action to a list
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
ib.setKey(new InstructionKey(0));
isb.setInstruction(instructions);
return isb;
}
- /**
- * @return
- */
private static InstructionsBuilder createMeterInstructions() {
final MeterBuilder aab = new MeterBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
ab.setKey(new ActionKey(0));
// Add our drop action to a list
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
ab.setKey(new ActionKey(0));
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ControllerActionBuilder controller = new ControllerActionBuilder();
controller.setMaxLength(5);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction1() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
// test case for Output Port works if the particular port exists
// this particular test-case is for Port : 1
// tested as (addMDFlow openflow:<dpid> f82)
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
- private static InstructionsBuilder createSentToControllerInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ private static InstructionsBuilder createOutputInstructions(final String outputType, final int outputValue) {
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
- output.setMaxLength(Integer.valueOf(0xffff));
- final Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
+ output.setMaxLength(outputValue);
+ final Uri value = new Uri(outputType);
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
- private static InstructionsBuilder createOutputInstructions(final String outputType, final int outputValue) {
- final List<Action> actionList = new ArrayList<Action>();
+ private static InstructionsBuilder createSentToControllerInstructions() {
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final OutputActionBuilder output = new OutputActionBuilder();
- output.setMaxLength(outputValue);
- final Uri value = new Uri(outputType);
+ output.setMaxLength(Integer.valueOf(0xffff));
+ final Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
}
+
private static InstructionsBuilder createStripVlanInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final StripVlanActionBuilder stripActionBuilder = new StripVlanActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction2() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PushMplsActionBuilder push = new PushMplsActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction3() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PushPbbActionBuilder pbb = new PushPbbActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction4() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PushVlanActionBuilder vlan = new PushVlanActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction5() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlDstActionBuilder setdl = new SetDlDstActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction6() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction7() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction8() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction88() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanPcpActionBuilder pcp = new SetVlanPcpActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction9() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction10() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction11() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
// Put our Instruction in a list of Instruction
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction12() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction13() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final DropActionBuilder drop = new DropActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction14() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final FloodActionBuilder fld = new FloodActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction15() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final FloodAllActionBuilder fldall = new FloodAllActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction16() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final GroupActionBuilder groupActionB = new GroupActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction17() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final HwPathActionBuilder hwPathB = new HwPathActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction18() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction19() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction20() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction21() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction22() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction23(final NodeId nodeId) {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction24() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction25() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNextHopActionBuilder setNextHopActionBuilder = new SetNextHopActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction26() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction27() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction28() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction29() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction30() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction31() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction32() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction33() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction34() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SwPathActionBuilder swPathAction = new SwPathActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction35() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
private static InstructionsBuilder createAppyActionInstruction36() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction37() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction38() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction39() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction40() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction41() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction42() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction43() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final ActionBuilder ab1 = new ActionBuilder();
final ActionBuilder ab2 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction44() {
- final List<Action> actionLists = new ArrayList<Action>();
+ final List<Action> actionLists = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction45() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction46() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
final ActionBuilder ab1 = new ActionBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction47() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// PBB
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder();
- protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask((new BigInteger(new byte[]{0, 1, 0, 0}).longValue())).build());
+ protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(
+ new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
setFieldBuilder.setProtocolMatchFields(protomatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
actionList.add(ab.build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createAppyActionInstruction48() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Tunnel
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createTunnelIpv4DstInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
// Build the tunnel endpoint destination IPv4 address
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Add the Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
private static InstructionsBuilder createTunnelIpv4SrcInstructions() {
- final List<Action> actionList = new ArrayList<Action>();
+ final List<Action> actionList = new ArrayList<>();
final ActionBuilder ab = new ActionBuilder();
// Build the tunnel endpoint source IPv4 address
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
- final List<Instruction> instructions = new ArrayList<Instruction>();
+ final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch1() {
final MatchBuilder match = new MatchBuilder();
final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
- final Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);;
+ final Ipv4Prefix prefix = new Ipv4Prefix(IPV4_PREFIX);
ipv4Match.setIpv4Destination(prefix);
final Ipv4Match i4m = ipv4Match.build();
match.setLayer3Match(i4m);
return match;
}
-
- /**
- * @return
- */
private static MatchBuilder createMatch2() {
final MatchBuilder match = new MatchBuilder();
final Ipv4MatchBuilder ipv4Match = new Ipv4MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMatch3() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethernetMatch = new EthernetMatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createICMPv6Match1() {
final MatchBuilder match = new MatchBuilder();
}
- /**
- * @return
- */
-
private static MatchBuilder createVlanMatch() {
final MatchBuilder match = new MatchBuilder();
// vlan match
return match;
}
- /**
- * @return
- */
private static MatchBuilder createArpMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
-
- /**
- * @return
- */
private static MatchBuilder createL3IPv4Match() {
final MatchBuilder match = new MatchBuilder();
}
- /**
- * @return
- */
private static MatchBuilder createL3IPv6Match() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
-
private static MatchBuilder createICMPv4Match() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder eth = new EthernetMatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createICMPv6Match() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createToSMatch() {
final MatchBuilder match = new MatchBuilder();
final EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
return match;
}
- /**
- * @return
- */
-
private static MatchBuilder createL4TCPMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createL4UDPMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createL4SCTPMatch() {
final MatchBuilder match = new MatchBuilder();
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMetadataMatch() {
final MatchBuilder match = new MatchBuilder();
final byte[] metamask = new byte[]{(byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1};
return match;
}
- /**
- * @return
- */
private static MatchBuilder createMplsMatch() {
final MatchBuilder match = new MatchBuilder();
}
- /**
- * @return
- */
private static MatchBuilder createPbbMatch() {
final MatchBuilder match = new MatchBuilder();
final ProtocolMatchFieldsBuilder protomatch = new ProtocolMatchFieldsBuilder(); // mpls
// match
- protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
+ protomatch.setPbb(new PbbBuilder().setPbbIsid(4L).setPbbMask(
+ new BigInteger(new byte[]{0, 1, 0, 0}).longValue()).build());
match.setProtocolMatchFields(protomatch.build());
return match;
}
- /**
- * @return
- */
private static MatchBuilder createTunnelIDMatch() {
final MatchBuilder match = new MatchBuilder();
final TunnelBuilder tunnel = new TunnelBuilder(); // tunnel id match
}
/**
- * Test match for TCP_Flags
+ * Test match for TCP_Flags.
*
* @return match containing Ethertype (0x0800), IP Protocol (TCP), TCP_Flag (SYN)
*/
final CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(final Void aVoid) {
+ public void onSuccess(final Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
}
/**
- * @param ci arguments: switchId flowType tableNum
- * <p>
- * <pre>
- * e.g.: addMDFlow openflow:1 f1 42
- * </pre>
+ * Adds a flow.
+ *
+ * @param ci arguments: switchId flowType tableNum, e.g.: addMDFlow openflow:1 f1 42
*/
public void _addMDFlow(final CommandInterpreter ci) {
final NodeBuilder tn = createTestNode(ci.nextArgument());
final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
- modification.merge(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
+ modification.merge(LogicalDatastoreType.CONFIGURATION,
+ nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
final CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(final Void aVoid) {
+ public void onSuccess(final Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
Collection<String> testResults = null;
if (testResults == null) {
- testResults = new ArrayList<String>();
+ testResults = new ArrayList<>();
}
int numberOfSwtiches = 0;
}
executor.shutdown();
executor.awaitTermination(1, TimeUnit.SECONDS);
- } catch (final Exception e) {
+ } catch (InterruptedException e) {
ci.println("Exception:" + e.getMessage());
}
}
Collection<String> testResults = null;
int tableID = 0;
- TestFlowThread(final int numberOfSwtiches, final int numberOfFlows, final CommandInterpreter ci, final int t, final int tableID) {
+ TestFlowThread(final int numberOfSwtiches, final int numberOfFlows, final CommandInterpreter ci,
+ final int threadNumber, final int tableID) {
this.numberOfSwitches = numberOfSwtiches;
this.numberOfFlows = numberOfFlows;
this.ci = ci;
- this.theadNumber = t;
+ this.theadNumber = threadNumber;
this.tableID = tableID;
}
final long endTime = System.currentTimeMillis();
final long timeInSeconds = Math.round((endTime - startTime) / 1000);
if (timeInSeconds > 0) {
- ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::" + Math.round(totalNumberOfFlows / timeInSeconds));
+ ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::"
+ + Math.round(totalNumberOfFlows / timeInSeconds));
} else {
ci.println("Total flows added in Thread:" + this.theadNumber + ": Flows/Sec::" + totalNumberOfFlows);
}
* usage testAllFlows <dp>
* ex: _perfFlowTest 1
*/
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void _testAllFlows(final CommandInterpreter ci) {
String dataPathID = ci.nextArgument();
final int numberOfFlows = 82;
if (dataPathID == null || dataPathID.trim().equals("")) {
dataPathID = "1";
}
- ci.println("* Test All Flows *");
+ ci.println("* Test All Flows *");
ci.println("* dataPathID:::" + dataPathID + "");
final String dataPath = "openflow:" + dataPathID;
final String tableId = "0";
try {
tf = createTestFlow(tn, flowID, tableId);
writeFlow(ci, tf, tn);
- } catch (final Exception e) {
+ } catch (RuntimeException e) {
ci.println("--Test Failed--Issue found while adding flow" + flow);
break;
}
private NotificationProviderService notificationProviderService;
/**
- * get data service
+ * Get data service.
*
* @return {@link #dataService}
*/
}
/**
- * set {@link #dataService}
- *
- * @param dataService
+ * Set {@link #dataService}.
*/
public void setDataService(final DataBroker dataService) {
this.dataService = dataService;
}
/**
- * get flow registration
+ * Get flow registration.
*
* @return {@link #flowRegistration}
*/
}
/**
- * set {@link #flowRegistration}
- *
- * @param flowRegistration
+ * Set {@link #flowRegistration}.
*/
public void setFlowRegistration(
final RoutedRpcRegistration<SalFlowService> flowRegistration) {
}
/**
- * get notification service
+ * Get notification service.
*
* @return {@link #notificationProviderService}
*/
}
/**
- * set {@link #notificationProviderService}
- *
- * @param notificationProviderService
+ * Set {@link #notificationProviderService}.
*/
- public void setNotificationService(
- final NotificationProviderService notificationProviderService) {
- this.notificationProviderService = notificationProviderService;
+ public void setNotificationService(final NotificationProviderService service) {
+ this.notificationProviderService = service;
}
public void start() {
*/
@Override
public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
- String plus = ("addFlow - " + input);
+ String plus = "addFlow - " + input;
OpenflowpluginTestServiceProvider.LOG.info(plus);
return null;
}
*/
@Override
public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
- String plus = ("removeFlow - " + input);
+ String plus = "removeFlow - " + input;
OpenflowpluginTestServiceProvider.LOG.info(plus);
return null;
}
*/
@Override
public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
- String plus = ("updateFlow - " + input);
+ String plus = "updateFlow - " + input;
OpenflowpluginTestServiceProvider.LOG.info(plus);
return null;
}
- /**
- * @param ctx
- * @return {@link ObjectRegistration}
- */
public ObjectRegistration<OpenflowpluginTestServiceProvider> register(
final ProviderContext ctx) {
RoutedRpcRegistration<SalFlowService> addRoutedRpcImplementation = ctx
- .<SalFlowService> addRoutedRpcImplementation(
+ .<SalFlowService>addRoutedRpcImplementation(
SalFlowService.class, this);
setFlowRegistration(addRoutedRpcImplementation);
InstanceIdentifierBuilder<Nodes> builderII = InstanceIdentifier
- .<Nodes> builder(Nodes.class);
+ .<Nodes>builder(Nodes.class);
NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
NodeKey nodeKey = new NodeKey(nodeId);
InstanceIdentifierBuilder<Node> nodeIdentifier = builderII
- .<Node, NodeKey> child(Node.class, nodeKey);
+ .<Node, NodeKey>child(Node.class, nodeKey);
InstanceIdentifier<Node> instance = nodeIdentifier.build();
throw new AssertionError("TestProviderTransactionUtil was not meant to be instantiated.");
}
- public static <T extends DataObject> T getDataObject(ReadTransaction readOnlyTransaction, InstanceIdentifier<T> identifier) {
+ public static <T extends DataObject> T getDataObject(ReadTransaction readOnlyTransaction,
+ InstanceIdentifier<T> identifier) {
Optional<T> optionalData = null;
try {
optionalData = readOnlyTransaction.read(LogicalDatastoreType.OPERATIONAL, identifier).get();
}
return null;
}
-
}