<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
public class FlowWriterSequential implements FlowCounterMBean {
private static final Logger LOG = LoggerFactory.getLogger(FlowWriterSequential.class);
+
private final DataBroker dataBroker;
private final ExecutorService flowPusher;
- protected int dpnCount;
private long startTime;
private final AtomicInteger writeOpStatus = new AtomicInteger(FlowCounter.OperationStatus.INIT.status());
private final AtomicInteger countDpnWriteCompletion = new AtomicInteger();
private final AtomicLong taskCompletionTime = new AtomicLong();
- public FlowWriterSequential(final DataBroker dataBroker, ExecutorService flowPusher) {
+ public FlowWriterSequential(final DataBroker dataBroker, final ExecutorService flowPusher) {
this.dataBroker = dataBroker;
this.flowPusher = flowPusher;
LOG.info("Using Sequential implementation of Flow Writer.");
}
- public void addFlows(Integer count, Integer flowsPerDPN, int batchSize, int sleepMillis, short startTableId,
- short endTableId, boolean isCreateParents) {
+ public void addFlows(final Integer count, final Integer flowsPerDPN, final int batchSize, final int sleepMillis,
+ final short startTableId, final short endTableId, final boolean isCreateParents) {
LOG.info("Using Sequential implementation of Flow Writer.");
- this.dpnCount = count;
countDpnWriteCompletion.set(count);
startTime = System.nanoTime();
for (int i = 1; i <= count; i++) {
}
}
- public void deleteFlows(Integer count, Integer flowsPerDPN, int batchSize, short startTableId,
- short endTableId) {
+ public void deleteFlows(final Integer count, final Integer flowsPerDPN, final int batchSize,
+ final short startTableId, final short endTableId) {
LOG.info("Using Sequential implementation of Flow Writer.");
countDpnWriteCompletion.set(count);
for (int i = 1; i <= count; i++) {
return taskCompletionTime.get();
}
- private class FlowHandlerTask implements Runnable {
+ private final class FlowHandlerTask implements Runnable {
private final String dpId;
private final int flowsPerDpn;
private final boolean add;
final int flowsPerDpn,
final boolean add,
final int batchSize,
- int sleepMillis,
+ final int sleepMillis,
final short startTableId,
final short endTableId,
final boolean isCreateParents) {
MoreExecutors.directExecutor());
}
- private void addFlowToTx(WriteTransaction writeTransaction, String flowId, InstanceIdentifier<Flow> flowIid,
- Flow flow) {
+ private void addFlowToTx(final WriteTransaction writeTransaction, final String flowId,
+ final InstanceIdentifier<Flow> flowIid, final Flow flow) {
if (add) {
LOG.trace("Adding flow for flowId: {}, flowIid: {}", flowId, flowIid);
if (isCreateParents) {
private int sourceIp;
- DsCallBack(String dpId, int sourceIp, short tableId) {
+ DsCallBack(final String dpId, final int sourceIp, final short tableId) {
this.dpId = dpId;
this.sourceIp = sourceIp;
short numberA = 1;
}
@Override
- public void onSuccess(Object notUsed) {
+ public void onSuccess(final Object notUsed) {
if (sourceIp > flowsPerDpn) {
long dur = System.nanoTime() - startTime;
LOG.info("Completed all flows installation for: dpid: {}, tableId: {}, sourceIp: {} in {}ns", dpId,
}
@Override
- public void onFailure(Throwable error) {
+ public void onFailure(final Throwable error) {
LOG.error("Error: {} in Datastore write operation: dpid: {}, tableId: {}, sourceIp: {}", error, dpId,
tableId, sourceIp);
writeOpStatus.set(FlowCounter.OperationStatus.FAILURE.status());
import com.google.common.util.concurrent.MoreExecutors;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
-import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataObjectModification;
import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
*/
public abstract class AbstractListeningCommiter<T extends DataObject>
implements ForwardingRulesCommiter<T>, RecoverableListener {
-
private static final Logger LOG = LoggerFactory.getLogger(AbstractListeningCommiter.class);
+
final ForwardingRulesManager provider;
NodeConfigurator nodeConfigurator;
protected final DataBroker dataBroker;
- protected final ListenerRegistrationHelper registrationHelper;
- protected ListenerRegistration<AbstractListeningCommiter> listenerRegistration;
+ private final ListenerRegistrationHelper registrationHelper;
+ private ListenerRegistration<AbstractListeningCommiter> listenerRegistration;
@SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR", justification = "See FIXME below")
protected AbstractListeningCommiter(final ForwardingRulesManager provider, final DataBroker dataBroker,
final ListenerRegistrationHelper registrationHelper) {
this.provider = requireNonNull(provider, "ForwardingRulesManager can not be null!");
- this.nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!");
+ nodeConfigurator = requireNonNull(provider.getNodeConfigurator(), "NodeConfigurator can not be null!");
this.dataBroker = requireNonNull(dataBroker, "DataBroker can not be null!");
this.registrationHelper = requireNonNull(registrationHelper, "registrationHelper can not be null!");
IllegalArgumentException("Unhandled modification type "
+ mod.getModificationType());
}
- } else {
- if (provider.isStaleMarkingEnabled()) {
- LOG.info("Stale-Marking ENABLED and switch {} is NOT connected, storing stale entities",
- nodeIdent.toString());
- // Switch is NOT connected
- switch (mod.getModificationType()) {
- case DELETE:
- createStaleMarkEntity(key, mod.getDataBefore(), nodeIdent);
- break;
- case SUBTREE_MODIFIED:
- break;
- case WRITE:
- break;
- default:
- throw new
- IllegalArgumentException("Unhandled modification type "
- + mod.getModificationType());
- }
+ } else if (provider.isStaleMarkingEnabled()) {
+ LOG.info("Stale-Marking ENABLED and switch {} is NOT connected, storing stale entities",
+ nodeIdent.toString());
+ // Switch is NOT connected
+ switch (mod.getModificationType()) {
+ case DELETE:
+ createStaleMarkEntity(key, mod.getDataBefore(), nodeIdent);
+ break;
+ case SUBTREE_MODIFIED:
+ break;
+ case WRITE:
+ break;
+ default:
+ throw new
+ IllegalArgumentException("Unhandled modification type "
+ + mod.getModificationType());
}
}
} catch (RuntimeException e) {
@Override
public final void registerListener() {
- final DataTreeIdentifier<T> treeId =
- DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath());
- Futures.addCallback(registrationHelper.checkedRegisterListener(treeId, this),
- new FutureCallback<ListenerRegistration<AbstractListeningCommiter>>() {
- @Override
- public void onSuccess(
- @Nullable final ListenerRegistration<AbstractListeningCommiter> flowListenerRegistration) {
- LOG.info("{} registered successfully", flowListenerRegistration.getInstance());
- listenerRegistration = flowListenerRegistration;
- }
+ Futures.addCallback(registrationHelper.checkedRegisterListener(
+ DataTreeIdentifier.create(LogicalDatastoreType.CONFIGURATION, getWildCardPath()), this),
+ new FutureCallback<ListenerRegistration<AbstractListeningCommiter>>() {
+ @Override
+ public void onSuccess(final ListenerRegistration<AbstractListeningCommiter> flowListenerRegistration) {
+ LOG.info("{} registered successfully", flowListenerRegistration.getInstance());
+ listenerRegistration = flowListenerRegistration;
+ }
- @Override
- public void onFailure(final Throwable throwable) {
- LOG.error("Registration failed ", throwable);
- }
- }, MoreExecutors.directExecutor());
+ @Override
+ public void onFailure(final Throwable throwable) {
+ LOG.error("Registration failed ", throwable);
+ }
+ }, MoreExecutors.directExecutor());
+ }
+
+ @Override
+ public void deregisterListener() {
+ close();
+ }
+
+ @Override
+ public void close() {
+ if (listenerRegistration != null) {
+ listenerRegistration.close();
+ listenerRegistration = null;
+ }
}
/**
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
* {@link org.opendaylight.mdsal.binding.api.DataTreeModification}.
*/
public class FlowForwarder extends AbstractListeningCommiter<Flow> {
-
private static final Logger LOG = LoggerFactory.getLogger(FlowForwarder.class);
-
private static final String GROUP_EXISTS_IN_DEVICE_ERROR = "GROUPEXISTS";
- private ListenerRegistration<FlowForwarder> listenerRegistration;
-
- private final BundleFlowForwarder bundleFlowForwarder;
-
public FlowForwarder(final ForwardingRulesManager manager, final DataBroker db,
final ListenerRegistrationHelper registrationHelper) {
super(manager, db, registrationHelper);
- bundleFlowForwarder = new BundleFlowForwarder(manager);
- }
-
- @Override
- public void deregisterListener() {
- close();
- }
-
- @Override
- public void close() {
- if (listenerRegistration != null) {
- listenerRegistration.close();
- listenerRegistration = null;
- }
}
@Override
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.Uint32;
* {@link org.opendaylight.mdsal.binding.api.DataTreeModification}.
*/
public class GroupForwarder extends AbstractListeningCommiter<Group> {
-
private static final Logger LOG = LoggerFactory.getLogger(GroupForwarder.class);
- private ListenerRegistration<GroupForwarder> listenerRegistration;
-
- private final BundleGroupForwarder bundleGroupForwarder;
public GroupForwarder(final ForwardingRulesManager manager, final DataBroker db,
final ListenerRegistrationHelper registrationHelper) {
super(manager, db, registrationHelper);
- this.bundleGroupForwarder = new BundleGroupForwarder(manager);
- }
-
- @Override
- public void deregisterListener() {
- close();
- }
-
- @Override
- public void close() {
- if (listenerRegistration != null) {
- listenerRegistration.close();
- listenerRegistration = null;
- }
}
@Override
.build();
final ListenableFuture<RpcResult<RemoveGroupOutput>> resultFuture =
- this.provider.getSalGroupService()
+ provider.getSalGroupService()
.removeGroup(removeGroup);
Futures.addCallback(resultFuture,
new RemoveGroupCallBack(removeDataObj.getGroupId().getValue(), nodeId),
builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
builder.setGroupRef(new GroupRef(identifier));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
- return this.provider.getSalGroupService().removeGroup(builder.build());
+ return provider.getSalGroupService().removeGroup(builder.build());
}
@Override
builder.setUpdatedGroup(new UpdatedGroupBuilder(updatedGroup).build());
builder.setOriginalGroup(new OriginalGroupBuilder(originalGroup).build());
UpdateGroupInput updateGroupInput = builder.build();
- final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture = this.provider.getSalGroupService()
+ final ListenableFuture<RpcResult<UpdateGroupOutput>> resultFuture = provider.getSalGroupService()
.updateGroup(updateGroupInput);
LoggingFutures.addErrorLogging(resultFuture, LOG, "updateGroup");
Futures.addCallback(resultFuture,
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
AddGroupInput addGroupInput = builder.build();
final ListenableFuture<RpcResult<AddGroupOutput>> resultFuture;
- resultFuture = this.provider.getSalGroupService().addGroup(addGroupInput);
+ resultFuture = provider.getSalGroupService().addGroup(addGroupInput);
Futures.addCallback(resultFuture,
new AddGroupCallBack(addGroupInput.getGroupId().getValue(), nodeId),
MoreExecutors.directExecutor());
}
@Override
- public void createStaleMarkEntity(InstanceIdentifier<Group> identifier, Group del,
- InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ public void createStaleMarkEntity(final InstanceIdentifier<Group> identifier, final Group del,
+ final InstanceIdentifier<FlowCapableNode> nodeIdent) {
LOG.debug("Creating Stale-Mark entry for the switch {} for Group {} ", nodeIdent, del);
StaleGroup staleGroup = makeStaleGroup(identifier, del, nodeIdent);
persistStaleGroup(staleGroup, nodeIdent);
}
- private static StaleGroup makeStaleGroup(InstanceIdentifier<Group> identifier, Group del,
- InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ private static StaleGroup makeStaleGroup(final InstanceIdentifier<Group> identifier, final Group del,
+ final InstanceIdentifier<FlowCapableNode> nodeIdent) {
StaleGroupBuilder staleGroupBuilder = new StaleGroupBuilder(del);
return staleGroupBuilder.setGroupId(del.getGroupId()).build();
}
- private void persistStaleGroup(StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ private void persistStaleGroup(final StaleGroup staleGroup, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleGroupInstanceIdentifier(staleGroup, nodeIdent),
staleGroup);
handleStaleGroupResultFuture(submitFuture);
}
- private static void handleStaleGroupResultFuture(FluentFuture<?> submitFuture) {
+ private static void handleStaleGroupResultFuture(final FluentFuture<?> submitFuture) {
submitFuture.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(Object result) {
+ public void onSuccess(final Object result) {
LOG.debug("Stale Group creation success");
}
@Override
- public void onFailure(Throwable throwable) {
+ public void onFailure(final Throwable throwable) {
LOG.error("Stale Group creation failed", throwable);
}
}, MoreExecutors.directExecutor());
private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.group
.types.rev131018.groups.StaleGroup> getStaleGroupInstanceIdentifier(
- StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ final StaleGroup staleGroup, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(StaleGroup.class, new StaleGroupKey(new GroupId(staleGroup.getGroupId())));
}
}
@Override
- public void onSuccess(RpcResult<AddGroupOutput> result) {
+ public void onSuccess(final RpcResult<AddGroupOutput> result) {
if (result.isSuccessful()) {
provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
LOG.debug("Group add with id {} finished without error for node {}", groupId, nodeId);
}
@Override
- public void onFailure(Throwable throwable) {
+ public void onFailure(final Throwable throwable) {
LOG.error("Service call for adding group {} failed for node with error {}", groupId, nodeId, throwable);
}
}
}
@Override
- public void onSuccess(RpcResult<UpdateGroupOutput> result) {
+ public void onSuccess(final RpcResult<UpdateGroupOutput> result) {
if (result.isSuccessful()) {
provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
LOG.debug("Group update with id {} finished without error for node {}", groupId, nodeId);
}
@Override
- public void onFailure(Throwable throwable) {
+ public void onFailure(final Throwable throwable) {
LOG.error("Service call for updating group {} failed for node {} with", groupId, nodeId,
throwable);
}
}
@Override
- public void onSuccess(RpcResult<RemoveGroupOutput> result) {
+ public void onSuccess(final RpcResult<RemoveGroupOutput> result) {
if (result.isSuccessful()) {
LOG.debug("Group remove with id {} finished without error for node {}", groupId, nodeId);
provider.getDevicesGroupRegistry().removeGroup(nodeId, groupId);
}
@Override
- public void onFailure(Throwable throwable) {
+ public void onFailure(final Throwable throwable) {
LOG.error("Service call for removing group {} failed for node with error {}", groupId, nodeId, throwable);
}
}
private static final Logger LOG = LoggerFactory.getLogger(ListenerRegistrationHelper.class);
private static final long INVENTORY_CHECK_TIMER = 1;
- private final String operational = "OPERATIONAL";
private final ListeningExecutorService listeningExecutorService;
private final DataBroker dataBroker;
public <T extends DataObject, L extends ClusteredDataTreeChangeListener<T>>
ListenableFuture<ListenerRegistration<L>> checkedRegisterListener(
- DataTreeIdentifier<T> treeId, L listener) {
+ final DataTreeIdentifier<T> treeId, final L listener) {
return listeningExecutorService.submit(() -> {
- while (!getInventoryConfigDataStoreStatus().equals(operational)) {
+ while (!getInventoryConfigDataStoreStatus().equals("OPERATIONAL")) {
try {
LOG.debug("Retrying for datastore to become operational for listener {}", listener);
Thread.sleep(INVENTORY_CHECK_TIMER * 1000);
*
*/
public class MeterForwarder extends AbstractListeningCommiter<Meter> {
-
private static final Logger LOG = LoggerFactory.getLogger(MeterForwarder.class);
public MeterForwarder(final ForwardingRulesManager manager, final DataBroker db,
super(manager, db, listenerRegistrationHelper);
}
- @Override
- public void deregisterListener() {
- close();
- }
-
- @Override
- public void close() {
- if (listenerRegistration != null) {
- listenerRegistration.close();
- listenerRegistration = null;
- }
- }
-
@Override
protected InstanceIdentifier<Meter> getWildCardPath() {
return InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)
builder.setMeterRef(new MeterRef(identifier));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
- LoggingFutures.addErrorLogging(this.provider.getSalMeterService().removeMeter(builder.build()), LOG,
+ LoggingFutures.addErrorLogging(provider.getSalMeterService().removeMeter(builder.build()), LOG,
"removeMeter");
}
builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
builder.setMeterRef(new MeterRef(identifier));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
- return this.provider.getSalMeterService().removeMeter(builder.build());
+ return provider.getSalMeterService().removeMeter(builder.build());
}
@Override
builder.setUpdatedMeter(new UpdatedMeterBuilder(update).build());
builder.setOriginalMeter(new OriginalMeterBuilder(original).build());
- LoggingFutures.addErrorLogging(this.provider.getSalMeterService().updateMeter(builder.build()), LOG,
+ LoggingFutures.addErrorLogging(provider.getSalMeterService().updateMeter(builder.build()), LOG,
"updateMeter");
}
builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
builder.setMeterRef(new MeterRef(identifier));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
- return this.provider.getSalMeterService().addMeter(builder.build());
+ return provider.getSalMeterService().addMeter(builder.build());
}
@Override
- public void createStaleMarkEntity(InstanceIdentifier<Meter> identifier, Meter del,
- InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ public void createStaleMarkEntity(final InstanceIdentifier<Meter> identifier, final Meter del,
+ final InstanceIdentifier<FlowCapableNode> nodeIdent) {
LOG.debug("Creating Stale-Mark entry for the switch {} for meter {} ", nodeIdent, del);
StaleMeter staleMeter = makeStaleMeter(del);
persistStaleMeter(staleMeter, nodeIdent);
}
- private static StaleMeter makeStaleMeter(Meter del) {
+ private static StaleMeter makeStaleMeter(final Meter del) {
StaleMeterBuilder staleMeterBuilder = new StaleMeterBuilder(del);
return staleMeterBuilder.setMeterId(del.getMeterId()).build();
}
- private void persistStaleMeter(StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ private void persistStaleMeter(final StaleMeter staleMeter, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleMeterInstanceIdentifier(staleMeter, nodeIdent),
staleMeter);
handleStaleMeterResultFuture(submitFuture);
}
- private static void handleStaleMeterResultFuture(FluentFuture<?> submitFuture) {
+ private static void handleStaleMeterResultFuture(final FluentFuture<?> submitFuture) {
submitFuture.addCallback(new FutureCallback<Object>() {
@Override
- public void onSuccess(Object result) {
+ public void onSuccess(final Object result) {
LOG.debug("Stale Meter creation success");
}
@Override
- public void onFailure(Throwable throwable) {
+ public void onFailure(final Throwable throwable) {
LOG.error("Stale Meter creation failed", throwable);
}
}, MoreExecutors.directExecutor());
private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819
.meters.StaleMeter> getStaleMeterInstanceIdentifier(
- StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ final StaleMeter staleMeter, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
return nodeIdent.child(StaleMeter.class, new StaleMeterKey(new MeterId(staleMeter.getMeterId())));
}
}
import org.slf4j.LoggerFactory;
public class TableForwarder extends AbstractListeningCommiter<TableFeatures> {
-
private static final Logger LOG = LoggerFactory.getLogger(TableForwarder.class);
public TableForwarder(final ForwardingRulesManager manager, final DataBroker db,
super(manager, db, registrationHelper);
}
- @Override
- public void deregisterListener() {
- close();
- }
-
- @Override
- public void close() {
- if (listenerRegistration != null) {
- listenerRegistration.close();
- listenerRegistration = null;
- }
- }
-
@Override
protected InstanceIdentifier<TableFeatures> getWildCardPath() {
return InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)
.build());
LOG.debug("Invoking SalTableService ");
- if (this.provider.getSalTableService() != null) {
- LOG.debug(" Handle to SalTableServices {}", this.provider.getSalTableService());
+ if (provider.getSalTableService() != null) {
+ LOG.debug(" Handle to SalTableServices {}", provider.getSalTableService());
}
- LoggingFutures.addErrorLogging(this.provider.getSalTableService().updateTable(builder.build()), LOG,
+ LoggingFutures.addErrorLogging(provider.getSalTableService().updateTable(builder.build()), LOG,
"updateTable");
}
}
@Override
- public void createStaleMarkEntity(InstanceIdentifier<TableFeatures> identifier, TableFeatures del,
- InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ public void createStaleMarkEntity(final InstanceIdentifier<TableFeatures> identifier, final TableFeatures del,
+ final InstanceIdentifier<FlowCapableNode> nodeIdent) {
LOG.debug("NO-OP");
}
@Override
- public Future<? extends RpcResult<?>> removeWithResult(InstanceIdentifier<TableFeatures> identifier,
- TableFeatures del, InstanceIdentifier<FlowCapableNode> nodeIdent) {
+ public Future<? extends RpcResult<?>> removeWithResult(final InstanceIdentifier<TableFeatures> identifier,
+ final TableFeatures del, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
return null;
}
}
* Execute CRUD API for flow + group + meter involving flat-batch strategy.
*/
public class SyncPlanPushStrategyFlatBatchImpl implements SyncPlanPushStrategy {
-
private static final Logger LOG = LoggerFactory.getLogger(SyncPlanPushStrategyFlatBatchImpl.class);
- private SalFlatBatchService flatBatchService;
- private TableForwarder tableForwarder;
+ private SalFlatBatchService flatBatchService = null;
@Override
public ListenableFuture<RpcResult<Void>> executeSyncStrategy(ListenableFuture<RpcResult<Void>> resultVehicle,
return this;
}
+ @Deprecated(since = "0.17.2", forRemoval = true)
public SyncPlanPushStrategyFlatBatchImpl setTableForwarder(final TableForwarder tableForwarder) {
- this.tableForwarder = tableForwarder;
return this;
}
}
* Execute CRUD API for flow + group + meter involving one-by-one (incremental) strategy.
*/
public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy {
-
private static final Logger LOG = LoggerFactory.getLogger(SyncPlanPushStrategyIncrementalImpl.class);
private FlowForwarder flowForwarder;
private MeterForwarder meterForwarder;
private GroupForwarder groupForwarder;
- private TableForwarder tableForwarder;
private FlowCapableTransactionService transactionService;
@Override
// TODO enable table-update when ready
//resultVehicle = updateTableFeatures(nodeIdent, configTree);
- resultVehicle = Futures.transformAsync(resultVehicle, input -> {
- // if (!input.isSuccessful()) {
- //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
- //final ListenableFuture<RpcResult<Void>> singleVoidUpdateResult = Futures.transform(
- // Futures.asList Arrays.asList(input, output),
- // ReconcileUtil.<UpdateFlowOutput>createRpcResultCondenser("TODO"));
- // }
- return addMissingGroups(nodeId, nodeIdent, diffInput.getGroupsToAddOrUpdate(), counters);
- }, MoreExecutors.directExecutor());
+ resultVehicle = Futures.transformAsync(resultVehicle,
+ input -> addMissingGroups(nodeId, nodeIdent, diffInput.getGroupsToAddOrUpdate(), counters),
+ MoreExecutors.directExecutor());
Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingGroups"),
- MoreExecutors.directExecutor());
- resultVehicle = Futures.transformAsync(resultVehicle, input -> {
- // if (!input.isSuccessful()) {
- //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
- // }
- return addMissingMeters(nodeId, nodeIdent, diffInput.getMetersToAddOrUpdate(), counters);
- }, MoreExecutors.directExecutor());
+ MoreExecutors.directExecutor());
+ resultVehicle = Futures.transformAsync(resultVehicle,
+ input -> addMissingMeters(nodeId, nodeIdent, diffInput.getMetersToAddOrUpdate(), counters),
+ MoreExecutors.directExecutor());
Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingMeters"),
- MoreExecutors.directExecutor());
- resultVehicle = Futures.transformAsync(resultVehicle, input -> {
- // if (!input.isSuccessful()) {
- //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
- // }
- return addMissingFlows(nodeId, nodeIdent, diffInput.getFlowsToAddOrUpdate(), counters);
- }, MoreExecutors.directExecutor());
+ MoreExecutors.directExecutor());
+ resultVehicle = Futures.transformAsync(resultVehicle,
+ input -> addMissingFlows(nodeId, nodeIdent, diffInput.getFlowsToAddOrUpdate(), counters),
+ MoreExecutors.directExecutor());
Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "addMissingFlows"),
- MoreExecutors.directExecutor());
-
+ MoreExecutors.directExecutor());
- resultVehicle = Futures.transformAsync(resultVehicle, input -> {
- // if (!input.isSuccessful()) {
- //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
- // }
- return removeRedundantFlows(nodeId, nodeIdent, diffInput.getFlowsToRemove(), counters);
- }, MoreExecutors.directExecutor());
+ resultVehicle = Futures.transformAsync(resultVehicle,
+ input -> removeRedundantFlows(nodeId, nodeIdent, diffInput.getFlowsToRemove(), counters),
+ MoreExecutors.directExecutor());
Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantFlows"),
- MoreExecutors.directExecutor());
- resultVehicle = Futures.transformAsync(resultVehicle, input -> {
- // if (!input.isSuccessful()) {
- //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
- // }
- return removeRedundantMeters(nodeId, nodeIdent, diffInput.getMetersToRemove(), counters);
- }, MoreExecutors.directExecutor());
+ MoreExecutors.directExecutor());
+ resultVehicle = Futures.transformAsync(resultVehicle,
+ input -> removeRedundantMeters(nodeId, nodeIdent, diffInput.getMetersToRemove(), counters),
+ MoreExecutors.directExecutor());
Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantMeters"),
- MoreExecutors.directExecutor());
- resultVehicle = Futures.transformAsync(resultVehicle, input -> {
- // if (!input.isSuccessful()) {
- //TODO chain errors but not skip processing on first error return Futures.immediateFuture(input);
- // }
- return removeRedundantGroups(nodeId, nodeIdent, diffInput.getGroupsToRemove(), counters);
- }, MoreExecutors.directExecutor());
+ MoreExecutors.directExecutor());
+ resultVehicle = Futures.transformAsync(resultVehicle,
+ input -> removeRedundantGroups(nodeId, nodeIdent, diffInput.getGroupsToRemove(), counters),
+ MoreExecutors.directExecutor());
Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "removeRedundantGroups"),
- MoreExecutors.directExecutor());
+ MoreExecutors.directExecutor());
return resultVehicle;
}
return this;
}
+ @Deprecated(since = "0.17.2", forRemoval = true)
public SyncPlanPushStrategyIncrementalImpl setTableForwarder(final TableForwarder tableForwarder) {
- this.tableForwarder = tableForwarder;
return this;
}
this.transactionService = transactionService;
return this;
}
-
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Command(scope = "reconciliation", name = "getRegisteredServices", description = "displaying services registered to "
- + "Reconciliation Framework")
/*
- * CLI to display the service priority, service name and service status TODO
- * service status
+ * CLI to display the service priority, service name and service status
+ * FIXME: service status
*/
+@Command(scope = "reconciliation", name = "getRegisteredServices",
+ description = "displaying services registered to Reconciliation Framework")
public class GetRegisteredServices extends OsgiCommandSupport {
private static final Logger LOG = LoggerFactory.getLogger(GetRegisteredServices.class);
private static final String CLI_FORMAT = "%d %-20s ";
- private ReconciliationManager reconciliationManager;
+ private ReconciliationManager reconciliationManager = null;
public void setReconciliationManager(final ReconciliationManager reconciliationManager) {
this.reconciliationManager = requireNonNull(reconciliationManager, "ReconciliationManager can not be null!");
private final FrmReconciliationService frmReconciliationService;
private final AlarmAgent alarmAgent;
private final NodeListener nodeListener;
- private final int threadPoolSize = 10;
private final Map<String, ReconciliationState> reconciliationStates;
- private ExecutorService executor = Executors.newWorkStealingPool(threadPoolSize);
+ private ExecutorService executor = Executors.newWorkStealingPool(10);
public ReconciliationServiceImpl(final DataBroker broker, final FrmReconciliationService frmReconciliationService,
final AlarmAgent alarmAgent, final NodeListener nodeListener,
@Command(scope = "openflow", name = "reconcile", description = "Launch reconciliation for openflow nodes")
public class Reconciliation extends OsgiCommandSupport {
-
private static final Logger LOG = LoggerFactory.getLogger(Reconciliation.class);
- private ReconciliationService reconciliationService;
+
+ private ReconciliationService reconciliationService = null;
public void setReconciliationService(final ReconciliationService reconciliationService) {
this.reconciliationService = reconciliationService;
private final NotificationService notificationService;
private final OperationProcessor processor;
private final ClusterSingletonServiceProvider clusterSingletonServiceProvider;
+
private InstanceIdentifier<Topology> topologyPathIID;
- private TransactionChainManager transactionChainManager;
+ private TransactionChainManager transactionChainManager = null;
private Registration listenerRegistration;
private ClusterSingletonServiceRegistration singletonServiceRegistration;
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
</parent>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>openflowplugin-karaf</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>6.0.5</version>
+ <version>6.0.6-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>8.0.3</version>
+ <version>8.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>8.0.3</version>
+ <version>8.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>6.0.4</version>
+ <version>6.0.5</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
* deserialize.
*/
public abstract class Packet {
-
private static final Logger LOG = LoggerFactory.getLogger(Packet.class);
// Access level granted to this packet
- protected boolean writeAccess;
+ protected final boolean writeAccess;
// When deserialized from wire, packet could result corrupted
protected boolean corrupted;
for (Entry<String, Pair<Integer, Integer>> pairs : hdrFieldCoordMap
.entrySet()) {
String hdrField = pairs.getKey();
- startOffset = bitOffset + this.getfieldOffset(hdrField);
- numBits = this.getfieldnumBits(hdrField);
+ startOffset = bitOffset + getfieldOffset(hdrField);
+ numBits = getfieldnumBits(hdrField);
byte[] hdrFieldBytes;
try {
* Store the raw read value, checks the payload type and set the
* payloadClass accordingly
*/
- this.setHeaderField(hdrField, hdrFieldBytes);
+ setHeaderField(hdrField, hdrFieldBytes);
if (LOG.isTraceEnabled()) {
LOG.trace("{}: {}: {} (offset {} bitsize {})", this.getClass().getSimpleName(), hdrField,
int payloadSize = payloadBytes == null ? 0 : payloadBytes.length;
// Allocate the buffer to contain the full (header + payload) packet
- int headerSize = this.getHeaderSize() / NetUtils.NUM_BITS_IN_A_BYTE;
+ int headerSize = getHeaderSize() / NetUtils.NUM_BITS_IN_A_BYTE;
byte[] packetBytes = new byte[headerSize + payloadSize];
if (payloadBytes != null) {
System.arraycopy(payloadBytes, 0, packetBytes, headerSize, payloadSize);
* @param bytes The raw payload as byte array
*/
public void setRawPayload(final byte[] bytes) {
- this.rawPayload = Arrays.copyOf(bytes, bytes.length);
+ rawPayload = Arrays.copyOf(bytes, bytes.length);
}
/**
final int prime = 31;
int result = super.hashCode();
result = prime * result
- + (this.hdrFieldsMap == null ? 0 : hdrFieldsMap.hashCode());
+ + (hdrFieldsMap == null ? 0 : hdrFieldsMap.hashCode());
return result;
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>6.0.4</version>
+ <version>6.0.5</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>11.0.4</version>
+ <version>11.0.5</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
* @author michal.polkorab
*/
public class OFDatagramPacketDecoder extends SimpleChannelInboundHandler<VersionMessageUdpWrapper> {
-
private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketDecoder.class);
- private DeserializationFactory deserializationFactory;
+
+ private DeserializationFactory deserializationFactory = null;
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
* @author michal.polkorab
*/
public class OFDatagramPacketEncoder extends MessageToMessageEncoder<UdpMessageListenerWrapper> {
-
private static final Logger LOG = LoggerFactory.getLogger(OFDatagramPacketEncoder.class);
- private SerializationFactory serializationFactory;
+
+ private SerializationFactory serializationFactory = null;
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
-
package org.opendaylight.openflowjava.protocol.impl.core;
import org.opendaylight.openflowjava.protocol.api.connection.ThreadConfiguration;
* @author mirehak
*/
public interface ServerFacade extends ShutdownProvider, OnlineProvider, Runnable {
-
/**
* Sets thread configuration.
*
* @param threadConfig desired thread configuration
*/
+ @Deprecated(since = "0.17.2", forRemoval = true)
void setThreadConfig(ThreadConfiguration threadConfig);
}
*
* @param workerGroup - shared worker group
*/
- public TcpConnectionInitializer(EventLoopGroup workerGroup, boolean isEpollEnabled) {
+ public TcpConnectionInitializer(final EventLoopGroup workerGroup, final boolean isEpollEnabled) {
this.workerGroup = requireNonNull(workerGroup, "WorkerGroup can't be null");
this.isEpollEnabled = isEpollEnabled;
}
}
@Override
- public void setThreadConfig(ThreadConfiguration threadConfig) {
+ @Deprecated(since = "0.17.2", forRemoval = true)
+ public void setThreadConfig(final ThreadConfiguration threadConfig) {
// IGNORE
}
@Override
- public void initiateConnection(String host, int port) {
+ public void initiateConnection(final String host, final int port) {
try {
bootstrap.connect(host, port).sync();
} catch (InterruptedException e) {
}
}
- public void setChannelInitializer(TcpChannelInitializer channelInitializer) {
+ public void setChannelInitializer(final TcpChannelInitializer channelInitializer) {
this.channelInitializer = channelInitializer;
}
}
private EventLoopGroup workerGroup;
private EventLoopGroup bossGroup;
private final SettableFuture<Boolean> isOnlineFuture = SettableFuture.create();
- private ThreadConfiguration threadConfig;
private TcpChannelInitializer channelInitializer;
*
* @param port listening port of TCPHandler server
*/
- public TcpHandler(final int port, Runnable readyRunnable) {
+ public TcpHandler(final int port, final Runnable readyRunnable) {
this(null, port, readyRunnable);
}
* @param address listening address of TCPHandler server
* @param port listening port of TCPHandler server
*/
- public TcpHandler(final InetAddress address, final int port, Runnable readyRunnable) {
+ public TcpHandler(final InetAddress address, final int port, final Runnable readyRunnable) {
this.port = port;
- this.startupAddress = address;
+ startupAddress = address;
this.readyRunnable = readyRunnable;
}
address = isa.getHostString();
// Update port, as it may have been specified as 0
- this.port = isa.getPort();
+ port = isa.getPort();
LOG.debug("address from tcphandler: {}", address);
LOG.info("Switch listener started and ready to accept incoming tcp/tls connections on port: {}", port);
return address;
}
- public void setChannelInitializer(TcpChannelInitializer channelInitializer) {
+ public void setChannelInitializer(final TcpChannelInitializer channelInitializer) {
this.channelInitializer = channelInitializer;
}
@Override
- public void setThreadConfig(ThreadConfiguration threadConfig) {
- this.threadConfig = threadConfig;
+ @Deprecated(since = "0.17.2", forRemoval = true)
+ public void setThreadConfig(final ThreadConfiguration threadConfig) {
+ // No-op
}
/**
*
* @param threadConfiguration number of threads to be created, if not specified in threadConfig
*/
- public void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) {
+ public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) {
if (isEpollEnabled) {
initiateEpollEventLoopGroups(threadConfiguration);
} else {
*
* @param threadConfiguration number of threads to be created, if not specified in threadConfig
*/
- public void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) {
+ public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) {
socketChannelClass = NioServerSocketChannel.class;
if (threadConfiguration != null) {
bossGroup = new NioEventLoopGroup(threadConfiguration.getBossThreadCount());
* @param threadConfiguration the ThreadConfiguration
*/
@SuppressWarnings("checkstyle:IllegalCatch")
- protected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) {
+ protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) {
try {
socketChannelClass = EpollServerSocketChannel.class;
if (threadConfiguration != null) {
private final InetAddress startupAddress;
private final Runnable readyRunnable;
private final SettableFuture<Boolean> isOnlineFuture = SettableFuture.create();
+
private UdpChannelInitializer channelInitializer;
- private ThreadConfiguration threadConfig;
private Class<? extends DatagramChannel> datagramChannelClass;
/**
*
* @param port listening port of UdpHandler server
*/
- public UdpHandler(final int port, Runnable readyRunnable) {
+ public UdpHandler(final int port, final Runnable readyRunnable) {
this(null, port, readyRunnable);
}
* @param address listening address of UdpHandler server
* @param port listening port of UdpHandler server
*/
- public UdpHandler(final InetAddress address, final int port, Runnable readyRunnable) {
+ public UdpHandler(final InetAddress address, final int port, final Runnable readyRunnable) {
this.port = port;
- this.startupAddress = address;
+ startupAddress = address;
this.readyRunnable = readyRunnable;
}
String address = isa.getHostString();
// Update port, as it may have been specified as 0
- this.port = isa.getPort();
+ port = isa.getPort();
LOG.debug("Address from udpHandler: {}", address);
LOG.info("Switch listener started and ready to accept incoming udp connections on port: {}", port);
return port;
}
- public void setChannelInitializer(UdpChannelInitializer channelInitializer) {
+ public void setChannelInitializer(final UdpChannelInitializer channelInitializer) {
this.channelInitializer = channelInitializer;
}
@Override
- public void setThreadConfig(ThreadConfiguration threadConfig) {
- this.threadConfig = threadConfig;
+ @Deprecated(since = "0.17.2", forRemoval = true)
+ public void setThreadConfig(final ThreadConfiguration threadConfig) {
+ // No-op
}
/**
*
* @param threadConfiguration number of threads to be created, if not specified in threadConfig
*/
- public void initiateEventLoopGroups(ThreadConfiguration threadConfiguration, boolean isEpollEnabled) {
+ public void initiateEventLoopGroups(final ThreadConfiguration threadConfiguration, final boolean isEpollEnabled) {
if (isEpollEnabled) {
initiateEpollEventLoopGroups(threadConfiguration);
} else {
*
* @param threadConfiguration number of threads to be created, if not specified in threadConfig
*/
- public void initiateNioEventLoopGroups(ThreadConfiguration threadConfiguration) {
+ public void initiateNioEventLoopGroups(final ThreadConfiguration threadConfiguration) {
datagramChannelClass = NioDatagramChannel.class;
if (threadConfiguration != null) {
group = new NioEventLoopGroup(threadConfiguration.getWorkerThreadCount());
* @param threadConfiguration the ThreadConfiguration
*/
@SuppressWarnings("checkstyle:IllegalCatch")
- protected void initiateEpollEventLoopGroups(ThreadConfiguration threadConfiguration) {
+ protected void initiateEpollEventLoopGroups(final ThreadConfiguration threadConfiguration) {
try {
datagramChannelClass = EpollDatagramChannel.class;
if (threadConfiguration != null) {
* @author timotej.kubas
* @author michal.polkorab
*/
-public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>,
- SerializerRegistryInjector {
+public class MeterModInputMessageFactory implements OFSerializer<MeterModInput>, SerializerRegistryInjector {
+ private static final Logger LOG = LoggerFactory .getLogger(MeterModInputMessageFactory.class);
- private static final Logger LOG = LoggerFactory
- .getLogger(MeterModInputMessageFactory.class);
private static final byte MESSAGE_TYPE = 29;
private static final short LENGTH_OF_METER_BANDS = 16;
private static final short PADDING_IN_METER_BAND_DROP = 4;
private static final short PADDING_IN_METER_BAND_DSCP_REMARK = 3;
- private SerializerRegistry registry;
+
+ private SerializerRegistry registry = null;
@Override
public void serialize(final MeterModInput message, final ByteBuf outBuffer) {
if (bands != null) {
for (Bands currentBand : bands) {
MeterBand meterBand = currentBand.getMeterBand();
- if (meterBand instanceof MeterBandDropCase) {
- MeterBandDropCase dropBandCase = (MeterBandDropCase) meterBand;
+ if (meterBand instanceof MeterBandDropCase dropBandCase) {
MeterBandDrop dropBand = dropBandCase.getMeterBandDrop();
writeBandCommonFields(dropBand, outBuffer);
outBuffer.writeZero(PADDING_IN_METER_BAND_DROP);
- } else if (meterBand instanceof MeterBandDscpRemarkCase) {
- MeterBandDscpRemarkCase dscpRemarkBandCase = (MeterBandDscpRemarkCase) meterBand;
+ } else if (meterBand instanceof MeterBandDscpRemarkCase dscpRemarkBandCase) {
MeterBandDscpRemark dscpRemarkBand = dscpRemarkBandCase.getMeterBandDscpRemark();
writeBandCommonFields(dscpRemarkBand, outBuffer);
outBuffer.writeByte(dscpRemarkBand.getPrecLevel().toJava());
outBuffer.writeZero(PADDING_IN_METER_BAND_DSCP_REMARK);
- } else if (meterBand instanceof MeterBandExperimenterCase) {
- MeterBandExperimenterCase experimenterBandCase = (MeterBandExperimenterCase) meterBand;
+ } else if (meterBand instanceof MeterBandExperimenterCase experimenterBandCase) {
MeterBandExperimenter experimenterBand = experimenterBandCase.getMeterBandExperimenter();
ExperimenterIdMeterBand expIdMeterBand =
experimenterBand.augmentation(ExperimenterIdMeterBand.class);
private static final Logger LOG = LoggerFactory.getLogger(OF13MatchSerializer.class);
private static final byte STANDARD_MATCH_TYPE_CODE = 0;
private static final byte OXM_MATCH_TYPE_CODE = 1;
- private SerializerRegistry registry;
+
+ private SerializerRegistry registry = null;
@Override
public void serialize(final Match match, final ByteBuf outBuffer) {
public class ConnectionContextImpl implements ConnectionContext {
private static final Logger LOG = LoggerFactory.getLogger(ConnectionContextImpl.class);
+ private final List<PortStatusMessage> portStatusMessages = new ArrayList<>();
private final ConnectionAdapter connectionAdapter;
+
private volatile CONNECTION_STATE connectionState;
- private FeaturesReply featuresReply;
+ private FeaturesReply featuresReply = null;
private NodeId nodeId;
private DeviceDisconnectedHandler deviceDisconnectedHandler;
private OutboundQueueProvider outboundQueueProvider;
private OutboundQueueHandlerRegistration<OutboundQueueProvider> outboundQueueHandlerRegistration;
- private HandshakeContext handshakeContext;
- private DeviceInfo deviceInfo;
- private final List<PortStatusMessage> portStatusMessages = new ArrayList<>();
- private final DeviceConnectionStatusProvider deviceConnectionStatusProvider;
+ private HandshakeContext handshakeContext = null;
+ private DeviceInfo deviceInfo = null;
/**
* Constructor.
public ConnectionContextImpl(final ConnectionAdapter connectionAdapter,
final DeviceConnectionStatusProvider deviceConnectionStatusProvider) {
this.connectionAdapter = connectionAdapter;
- this.deviceConnectionStatusProvider = deviceConnectionStatusProvider;
}
@Override
import org.slf4j.LoggerFactory;
public class HandshakeListenerImpl implements HandshakeListener {
-
private static final Logger LOG = LoggerFactory.getLogger(HandshakeListenerImpl.class);
private static final Logger OF_EVENT_LOG = LoggerFactory.getLogger("OfEventLog");
private final ConnectionContext connectionContext;
private final DeviceConnectedHandler deviceConnectedHandler;
- private HandshakeContext handshakeContext;
+
+ private HandshakeContext handshakeContext = null;
/**
* Constructor.
LOG.debug("handshake succeeded: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
}
OF_EVENT_LOG.debug("Connect, Node: {}", featureOutput.getDatapathId());
- this.handshakeContext.close();
+ handshakeContext.close();
connectionContext.changeStateToWorking();
connectionContext.setFeatures(featureOutput);
connectionContext.setNodeId(InventoryDataServiceUtil.nodeIdFromDatapathId(featureOutput.getDatapathId()));
.setXid(xid)
.setVersion(version)
.build();
- return this.connectionContext.getConnectionAdapter().barrier(barrierInput);
+ return connectionContext.getConnectionAdapter().barrier(barrierInput);
}
@Override
public void onHandshakeFailure() {
if (LOG.isDebugEnabled()) {
- LOG.debug("handshake failed: {}", this.connectionContext.getConnectionAdapter().getRemoteAddress());
+ LOG.debug("handshake failed: {}", connectionContext.getConnectionAdapter().getRemoteAddress());
}
- this.handshakeContext.close();
- this.connectionContext.closeConnection(false);
+ handshakeContext.close();
+ connectionContext.closeConnection(false);
}
@Override
public class MatchDeserializer implements OFDeserializer<Match>, HeaderDeserializer<Match>,
MatchEntryDeserializerRegistry, MatchEntryDeserializer, DeserializerRegistryInjector {
-
private static final Logger LOG = LoggerFactory.getLogger(MatchDeserializer.class);
+
private final Map<MatchEntryDeserializerKey, MatchEntryDeserializer> entryRegistry = new HashMap<>();
private final MatchPath matchPath;
- private DeserializerRegistry registry;
+
+ private DeserializerRegistry registry = null;
public MatchDeserializer(final MatchPath matchPath) {
this.matchPath = matchPath;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.experimenter.core.message.ExperimenterMessageOfChoice;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.multipart.reply.multipart.reply.body.MultipartReplyExperimenterBuilder;
import org.opendaylight.yangtools.yang.common.Uint32;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class MultipartReplyExperimenterDeserializer implements OFDeserializer<MultipartReplyBody>,
DeserializerRegistryInjector {
- private static final Logger LOG = LoggerFactory.getLogger(MultipartReplyExperimenterDeserializer.class);
- private DeserializerRegistry registry;
+ private DeserializerRegistry registry = null;
@Override
@SuppressWarnings("unchecked")
private static final TableFeaturesMatchFieldDeserializer MATCH_FIELD_DESERIALIZER =
new TableFeaturesMatchFieldDeserializer();
- private DeserializerRegistry registry;
+ private DeserializerRegistry registry = null;
@Override
public MultipartReplyBody deserialize(final ByteBuf message) {
public class MatchSerializer implements OFSerializer<Match>, HeaderSerializer<Match>,
MatchEntrySerializerRegistry, SerializerRegistryInjector {
-
private static final Logger LOG = LoggerFactory.getLogger(MatchSerializer.class);
private static final byte OXM_MATCH_TYPE_CODE = 1;
private final Map<org.opendaylight.openflowplugin.api.openflow.protocol.serialization.MatchEntrySerializerKey,
MatchEntrySerializer> entryRegistry = new LinkedHashMap<>();
- private SerializerRegistry registry;
+ private SerializerRegistry registry = null;
@Override
public void serialize(final Match match, final ByteBuf outBuffer) {
private static final short PADDING_IN_METER_BAND_DSCP_REMARK = 3;
private static final int DEFAULT_METER_FLAGS = createMeterFlagsBitMask(new MeterFlags(false, false, true, false));
- private SerializerRegistry registry;
+ private SerializerRegistry registry = null;
@Override
public void serialize(final MeterMessage message, final ByteBuf outBuffer) {
// Timeout after what we will give up on propagating role
private static final long SET_ROLE_TIMEOUT = 10000;
- private final DeviceInfo deviceInfo;
- private final HashedWheelTimer timer;
private final AtomicReference<ListenableFuture<RpcResult<SetRoleOutput>>> lastRoleFuture = new AtomicReference<>();
private final Collection<RequestContext<?>> requestContexts = new HashSet<>();
+ private final DeviceInfo deviceInfo;
+ private final HashedWheelTimer timer;
private final Timeout slaveTask;
private final OpenflowProviderConfig config;
private final ExecutorService executorService;
private ContextChainMastershipWatcher contextChainMastershipWatcher;
- private SalRoleService roleService;
+ private SalRoleService roleService = null;
RoleContextImpl(@NonNull final DeviceInfo deviceInfo,
@NonNull final HashedWheelTimer timer,
this.executorService = executorService;
slaveTask = timer.newTimeout(timerTask -> makeDeviceSlave(), checkRoleMasterTimeout, TimeUnit.MILLISECONDS);
- LOG.info("Started timer for setting SLAVE role on device {} if no role will be set in {}s.",
- deviceInfo,
+ LOG.info("Started timer for setting SLAVE role on device {} if no role will be set in {}s.", deviceInfo,
checkRoleMasterTimeout / 1000L);
}
@Override
public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) {
- this.contextChainMastershipWatcher = newWatcher;
+ contextChainMastershipWatcher = newWatcher;
}
@Override
private final ExtensionConverterProvider extensionConverterProvider;
private final ConvertorExecutor convertorExecutor;
private final NotificationPublishService notificationPublishService;
- private ContextChainMastershipWatcher contextChainMastershipWatcher;
+
+ private ContextChainMastershipWatcher contextChainMastershipWatcher = null;
RpcContextImpl(@NonNull final RpcProviderService rpcProviderRegistry,
final int maxRequests,
@NonNull final NotificationPublishService notificationPublishService,
final boolean statisticsRpcEnabled) {
this.deviceContext = deviceContext;
- this.deviceInfo = deviceContext.getDeviceInfo();
- this.nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier();
- this.messageSpy = deviceContext.getMessageSpy();
+ deviceInfo = deviceContext.getDeviceInfo();
+ nodeInstanceIdentifier = deviceContext.getDeviceInfo().getNodeInstanceIdentifier();
+ messageSpy = deviceContext.getMessageSpy();
this.rpcProviderRegistry = rpcProviderRegistry;
this.extensionConverterProvider = extensionConverterProvider;
this.notificationPublishService = notificationPublishService;
this.convertorExecutor = convertorExecutor;
- this.isStatisticsRpcEnabled = statisticsRpcEnabled;
- this.tracker = new Semaphore(maxRequests, true);
+ isStatisticsRpcEnabled = statisticsRpcEnabled;
+ tracker = new Semaphore(maxRequests, true);
}
@Override
@VisibleForTesting
boolean isEmptyRpcRegistrations() {
- return this.rpcRegistrations.isEmpty();
+ return rpcRegistrations.isEmpty();
}
@Override
public DeviceInfo getDeviceInfo() {
- return this.deviceInfo;
+ return deviceInfo;
}
@Override
public void registerMastershipWatcher(@NonNull final ContextChainMastershipWatcher newWatcher) {
- this.contextChainMastershipWatcher = newWatcher;
+ contextChainMastershipWatcher = newWatcher;
}
@Override
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>12.0.3</version>
+ <version>12.0.4</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>8.0.3</version>
+ <version>8.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>6.0.4</version>
+ <version>6.0.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
*/
public class LearningSwitchManagerSimpleImpl
implements DataTreeChangeListenerRegistrationHolder, LearningSwitchManager {
-
private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerSimpleImpl.class);
- private NotificationService notificationService;
+
+ private NotificationService notificationService = null;
private PacketProcessingService packetProcessingService;
- private DataBroker data;
- private Registration packetInRegistration;
- private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration;
+ private DataBroker data = null;
+ private Registration packetInRegistration = null;
+ private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration = null;
/**
* Sets the NotificationService.
* @param notificationService the notificationService to set
*/
@Override
- public void setNotificationService(NotificationService notificationService) {
+ public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
*/
@Override
public void setPacketProcessingService(
- PacketProcessingService packetProcessingService) {
+ final PacketProcessingService packetProcessingService) {
this.packetProcessingService = packetProcessingService;
}
* Sets the DataBroker.
*/
@Override
- public void setDataBroker(DataBroker broker) {
+ public void setDataBroker(final DataBroker broker) {
data = broker;
}
package org.opendaylight.openflowplugin.learningswitch;
import java.util.Collection;
-import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.mdsal.binding.api.DataObjectModification.ModificationType;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.DataTreeModification;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint8;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class WakeupOnNode implements DataTreeChangeListener<Table> {
-
private static final Logger LOG = LoggerFactory.getLogger(WakeupOnNode.class);
- private LearningSwitchHandler learningSwitchHandler;
+
+ private LearningSwitchHandler learningSwitchHandler = null;
@Override
- public void onDataTreeChanged(@NonNull Collection<DataTreeModification<Table>> modifications) {
+ public void onDataTreeChanged(final Collection<DataTreeModification<Table>> modifications) {
Uint8 requiredTableId = Uint8.ZERO;
// TODO add flow
- for (DataTreeModification<Table> modification : modifications) {
+ for (var modification : modifications) {
if (modification.getRootNode().getModificationType() == ModificationType.SUBTREE_MODIFIED) {
- DataObject table = modification.getRootNode().getDataAfter();
- if (table instanceof Table) {
- Table tableSure = (Table) table;
+ var table = modification.getRootNode().getDataAfter();
+ if (table != null) {
LOG.trace("table: {}", table);
-
- if (requiredTableId.equals(tableSure.getId())) {
- InstanceIdentifier<Table> tablePath =
- modification.getRootPath().getRootIdentifier();
- learningSwitchHandler.onSwitchAppeared(tablePath);
+ if (requiredTableId.equals(table.getId())) {
+ learningSwitchHandler.onSwitchAppeared(modification.getRootPath().getRootIdentifier());
}
}
}
*
* @param learningSwitchHandler the learningSwitchHandler to set
*/
- public void setLearningSwitchHandler(
- LearningSwitchHandler learningSwitchHandler) {
+ public void setLearningSwitchHandler(final LearningSwitchHandler learningSwitchHandler) {
this.learningSwitchHandler = learningSwitchHandler;
}
}
* </ul>
*/
public class LearningSwitchManagerMultiImpl implements DataTreeChangeListenerRegistrationHolder, LearningSwitchManager {
-
private static final Logger LOG = LoggerFactory.getLogger(LearningSwitchManagerMultiImpl.class);
- private NotificationService notificationService;
+
+ private NotificationService notificationService = null;
private PacketProcessingService packetProcessingService;
- private DataBroker data;
- private Registration packetInRegistration;
- private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration;
+ private DataBroker data = null;
+ private Registration packetInRegistration = null;
+ private ListenerRegistration<DataTreeChangeListener> dataTreeChangeListenerRegistration = null;
/**
* Sets the NotificationService.
* @param notificationService the notificationService to set
*/
@Override
- public void setNotificationService(NotificationService notificationService) {
+ public void setNotificationService(final NotificationService notificationService) {
this.notificationService = notificationService;
}
*/
@Override
public void setPacketProcessingService(
- PacketProcessingService packetProcessingService) {
+ final PacketProcessingService packetProcessingService) {
this.packetProcessingService = packetProcessingService;
}
* @param broker the data to set
*/
@Override
- public void setDataBroker(DataBroker broker) {
+ public void setDataBroker(final DataBroker broker) {
data = broker;
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>13.0.7</version>
+ <version>13.0.10</version>
<relativePath/>
</parent>
import io.netty.channel.socket.nio.NioSocketChannel;
import java.net.InetAddress;
import java.util.concurrent.Callable;
+import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Jozef Bacigal
*/
public class CallableClient implements Callable<Boolean>, OFClient {
-
- private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(CallableClient.class);
+ private static final Logger LOG = LoggerFactory.getLogger(CallableClient.class);
private int port = 6653;
private boolean securedClient = false;
private String name = "Empty name";
private final EventLoopGroup workerGroup;
- private SettableFuture<Boolean> isOnlineFuture;
- private SettableFuture<Boolean> scenarioDone;
+ private final SettableFuture<Boolean> isOnlineFuture = null;
+ private final SettableFuture<Boolean> scenarioDone = null;
private ScenarioHandler scenarioHandler = null;
private Bootstrap bootstrap = null;
this.port = port;
this.securedClient = securedClient;
this.ipAddress = requireNonNull(ipAddress, "IP address cannot be null");
- this.workerGroup = eventExecutors;
+ workerGroup = eventExecutors;
this.bootstrap = bootstrap;
this.name = name;
this.scenarioHandler = requireNonNull(scenarioHandler, "Scenario handler cannot be null");
@Override
public void setScenarioHandler(final ScenarioHandler scenario) {
- this.scenarioHandler = scenario;
+ scenarioHandler = scenario;
}
@Override
public Boolean call() throws Exception {
requireNonNull(bootstrap);
requireNonNull(workerGroup);
- LOG.info("Switch {} trying connect to controller", this.name);
+ LOG.info("Switch {} trying connect to controller", name);
SimpleClientInitializer clientInitializer = new SimpleClientInitializer(isOnlineFuture, securedClient);
clientInitializer.setScenario(scenarioHandler);
try {
return false;
}
if (scenarioHandler.isFinishedOK()) {
- LOG.info("Device {} finished scenario OK", this.name);
+ LOG.info("Device {} finished scenario OK", name);
} else {
- LOG.error("Device {} finished scenario with error", this.name);
+ LOG.error("Device {} finished scenario with error", name);
}
return scenarioHandler.isFinishedOK();
* @author michal.polkorab
*/
public class SendEvent implements ClientEvent {
-
private static final Logger LOG = LoggerFactory.getLogger(SendEvent.class);
+
protected byte[] msgToSend;
- protected ChannelHandlerContext ctx;
+ protected ChannelHandlerContext ctx = null;
/**
* Constructor.
*
* @param msgToSend message to be sent
*/
- public SendEvent(byte[] msgToSend) {
+ public SendEvent(final byte[] msgToSend) {
this.msgToSend = new byte[msgToSend.length];
System.arraycopy(msgToSend, 0, this.msgToSend, 0, msgToSend.length);
}
*
* @param ctx context which will be used for sending messages (SendEvents)
*/
- public void setCtx(ChannelHandlerContext ctx) {
+ public void setCtx(final ChannelHandlerContext ctx) {
this.ctx = ctx;
}
-
}
public class DropTestCommiter extends AbstractDropTest {
private static final Logger LOG = LoggerFactory.getLogger(DropTestCommiter.class);
private static final TableKey ZERO_TABLE = new TableKey(Uint8.ZERO);
- private DataBroker dataService;
-
private static final AtomicLong ID_COUNTER = new AtomicLong();
-
private static final ThreadLocal<FlowBuilder> BUILDER = ThreadLocal.withInitial(() -> {
final var cookie = new FlowCookie(Uint64.TEN);
return new FlowBuilder()
.setFlags(new FlowModFlags(false, false, false, false, false));
});
- private NotificationService notificationService;
-
- private Registration notificationRegistration;
+ private NotificationService notificationService = null;
+ private Registration notificationRegistration = null;
+ private DataBroker dataService = null;
/**
* start listening on packetIn.
*/
public class DropTestRpcSender extends AbstractDropTest {
private static final Logger LOG = LoggerFactory.getLogger(DropTestRpcSender.class);
-
- private SalFlowService flowService;
-
- public void setFlowService(final SalFlowService flowService) {
- this.flowService = flowService;
- }
-
private static final ThreadLocal<AddFlowInputBuilder> BUILDER = ThreadLocal.withInitial(() -> {
final var cookie = new FlowCookie(Uint64.TEN);
return new AddFlowInputBuilder()
.setFlags(new FlowModFlags(false, false, false, false, false));
});
- private NotificationService notificationService;
+ private NotificationService notificationService = null;
+ private Registration notificationRegistration = null;
+ private SalFlowService flowService = null;
- private Registration notificationRegistration;
+ public void setFlowService(final SalFlowService flowService) {
+ this.flowService = flowService;
+ }
/**
* Start listening on packetIn.
public class OpenflowPluginBulkGroupTransactionProvider implements CommandProvider {
private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkGroupTransactionProvider.class);
+ private static final String ORIGINAL_FLOW_NAME = "Foo";
+ private static final String ORIGINAL_GROUP_NAME = "Foo";
+
private final DataBroker dataBroker;
private final BundleContext ctx;
- private final String originalFlowName = "Foo";
private Node testNode12;
- private final String originalGroupName = "Foo";
public OpenflowPluginBulkGroupTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) {
this.dataBroker = dataBroker;
.build()));
}
- private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
+ private static FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg,
+ final String tableId) {
FlowBuilder flow = new FlowBuilder();
long id = 123;
flow.withKey(key);
flow.setPriority(Uint16.TWO);
- flow.setFlowName(originalFlowName + "X" + flowType);
+ flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
return flow;
}
}, MoreExecutors.directExecutor());
}
- private GroupBuilder createTestGroup(String actionType, String groupType, final String groupmod,
+ private static GroupBuilder createTestGroup(String actionType, String groupType, final String groupmod,
final String strId) {
// Sample data , committing to DataStore
return group.withKey(new GroupKey(new GroupId(Uint32.valueOf(strId))))
// .group.setInstall(false)
- .setGroupName(originalGroupName)
+ .setGroupName(ORIGINAL_GROUP_NAME)
.setBarrier(false)
.setBuckets(new BucketsBuilder().setBucket(BindingMap.of(bucket.build())).build());
}
public class OpenflowPluginBulkTransactionProvider implements CommandProvider {
private static final Logger LOG = LoggerFactory.getLogger(OpenflowPluginBulkTransactionProvider.class);
+ private static final String ORIGINAL_FLOW_NAME = "Foo";
private final DataBroker dataBroker;
private final BundleContext ctx;
- private final String originalFlowName = "Foo";
public OpenflowPluginBulkTransactionProvider(final DataBroker dataBroker, final BundleContext ctx) {
this.dataBroker = dataBroker;
return "No help";
}
- private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
+ private static FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg,
+ final String tableId) {
FlowBuilder flow = new FlowBuilder();
long id = 123;
FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
flow.withKey(key);
flow.setPriority(Uint16.TWO);
- flow.setFlowName(originalFlowName + "X" + flowType);
+ flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
return flow;
}
FlowBuilder tf;
FlowBuilder tf1;
FlowBuilder tf2;
- FlowBuilder tf3;
- switch (flowcnt) {
- case 1:
+ FlowBuilder tf3 = switch (flowcnt) {
+ case 1 -> {
tf = createTestFlow(tn, "f1", "10");
tf1 = createTestFlow(tn, "f2", "11");
tf2 = createTestFlow(tn, "f3", "12");
- tf3 = createTestFlow(tn, "f4", "13");
- break;
- case 2:
+ yield createTestFlow(tn, "f4", "13");
+ }
+ case 2 -> {
tf = createTestFlow(tn, "f3", "3");
tf1 = createTestFlow(tn, "f4", "4");
tf2 = createTestFlow(tn, "f5", "5");
- tf3 = createTestFlow(tn, "f6", "6");
- break;
- case 3:
+ yield createTestFlow(tn, "f6", "6");
+ }
+ case 3 -> {
tf = createTestFlow(tn, "f7", "7");
tf1 = createTestFlow(tn, "f8", "8");
tf2 = createTestFlow(tn, "f9", "9");
- tf3 = createTestFlow(tn, "f10", "10");
- break;
- case 4:
+ yield createTestFlow(tn, "f10", "10");
+ }
+ case 4 -> {
// -ve scenario
tf = createTestFlow(tn, "f23", "3");
tf1 = createTestFlow(tn, "f34", "4");
tf2 = createTestFlow(tn, "f35", "5");
- tf3 = createTestFlow(tn, "f36", "6");
- break;
- case 5:
+ yield createTestFlow(tn, "f36", "6");
+ }
+ case 5 -> {
// +ve scenario
// modify case 6 -ve
tf = createTestFlow(tn, "f230", "3");
tf1 = createTestFlow(tn, "f34", "4");
tf2 = createTestFlow(tn, "f35", "5");
- tf3 = createTestFlow(tn, "f36", "6");
- break;
-
- default:
+ yield createTestFlow(tn, "f36", "6");
+ }
+ default -> {
tf = createTestFlow(tn, "f42", "42");
tf1 = createTestFlow(tn, "f43", "43");
tf2 = createTestFlow(tn, "f44", "44");
- tf3 = createTestFlow(tn, "f45", "45");
-
- }
+ yield createTestFlow(tn, "f45", "45");
+ }
+ };
writeFlow(ci, tf, tf1, tf2, tf3, tn);
}
FlowBuilder tf;
FlowBuilder tf1;
FlowBuilder tf2;
- FlowBuilder tf3;
- switch (flowcnt) {
- case 1:
+ FlowBuilder tf3 = switch (flowcnt) {
+ case 1 -> {
tf = createTestFlow(tn, "f82", "10");
tf1 = createTestFlow(tn, "f83", "11");
tf2 = createTestFlow(tn, "f84", "12");
- tf3 = createTestFlow(tn, "f85", "13");
- break;
- case 2:
+ yield createTestFlow(tn, "f85", "13");
+ }
+ case 2 -> {
tf = createTestFlow(tn, "f700", "3");
tf1 = createTestFlow(tn, "f4", "4");
tf2 = createTestFlow(tn, "f900", "5");
- tf3 = createTestFlow(tn, "f86", "6");
- break;
- case 3:
+ yield createTestFlow(tn, "f86", "6");
+ }
+ case 3 -> {
// +
tf = createTestFlow(tn, "f91", "7");
tf1 = createTestFlow(tn, "f92", "8");
tf2 = createTestFlow(tn, "f93", "9");
- tf3 = createTestFlow(tn, "f94", "10");
- break;
- case 4:
+ yield createTestFlow(tn, "f94", "10");
+ }
+ case 4 -> {
// +ve scenario
tf = createTestFlow(tn, "f230", "3");
tf1 = createTestFlow(tn, "f99", "4");
tf2 = createTestFlow(tn, "f100", "5");
- tf3 = createTestFlow(tn, "f101", "6");
- break;
- case 5:
+ yield createTestFlow(tn, "f101", "6");
+ }
+ case 5 -> {
// -
tf = createTestFlow(tn, "f23", "3");
tf1 = createTestFlow(tn, "f99", "4");
tf2 = createTestFlow(tn, "f100", "5");
- tf3 = createTestFlow(tn, "f101", "6");
- break;
-
- default:
+ yield createTestFlow(tn, "f101", "6");
+ }
+ default -> {
tf = createTestFlow(tn, "f87", "12");
tf1 = createTestFlow(tn, "f88", "13");
tf2 = createTestFlow(tn, "f89", "14");
- tf3 = createTestFlow(tn, "f90", "15");
-
- }
-
+ yield createTestFlow(tn, "f90", "15");
+ }
+ };
writeFlow(ci, tf, tf1, tf2, tf3, tn);
}
FlowBuilder tf1 = null;
FlowBuilder tf2 = null;
FlowBuilder tf3 = null;
- switch (flowcnt) {
- case 1:
+ tf3 = switch (flowcnt) {
+ case 1 -> {
// add case 1
tf = createTestFlow(tn, "f1", "10");
tf1 = createTestFlow(tn, "f2", "11");
tf2 = createTestFlow(tn, "f3", "12");
- tf3 = createTestFlow(tn, "f4", "13");
- break;
- case 2:
+ yield createTestFlow(tn, "f4", "13");
+ }
+ case 2 -> {
// modify case 1
tf = createTestFlow(tn, "f82", "10");
tf1 = createTestFlow(tn, "f83", "11");
tf2 = createTestFlow(tn, "f84", "12");
- tf3 = createTestFlow(tn, "f85", "13");
- break;
- case 3:
+ yield createTestFlow(tn, "f85", "13");
+ }
+ case 3 -> {
// add case 2
tf = createTestFlow(tn, "f3", "3");
tf1 = createTestFlow(tn, "f4", "4");
tf2 = createTestFlow(tn, "f5", "5");
- tf3 = createTestFlow(tn, "f6", "6");
- break;
- case 4:
+ yield createTestFlow(tn, "f6", "6");
+ }
+ case 4 -> {
// modify case 2
tf = createTestFlow(tn, "f700", "3");
tf1 = createTestFlow(tn, "f4", "4");
tf2 = createTestFlow(tn, "f900", "5");
- tf3 = createTestFlow(tn, "f86", "6");
- break;
- case 5:
+ yield createTestFlow(tn, "f86", "6");
+ }
+ case 5 -> {
// add case 3
tf = createTestFlow(tn, "f7", "7");
tf1 = createTestFlow(tn, "f8", "8");
tf2 = createTestFlow(tn, "f9", "9");
- tf3 = createTestFlow(tn, "f10", "10");
- break;
- case 6:
+ yield createTestFlow(tn, "f10", "10");
+ }
+ case 6 -> {
// modify case 3
tf = createTestFlow(tn, "f91", "7");
tf1 = createTestFlow(tn, "f92", "8");
tf2 = createTestFlow(tn, "f93", "9");
- tf3 = createTestFlow(tn, "f94", "10");
- break;
- case 7:
+ yield createTestFlow(tn, "f94", "10");
+ }
+ case 7 -> {
// -ve scenario
tf = createTestFlow(tn, "f23", "3");
tf1 = createTestFlow(tn, "f34", "4");
tf2 = createTestFlow(tn, "f35", "5");
- tf3 = createTestFlow(tn, "f36", "6");
- break;
- case 8:
+ yield createTestFlow(tn, "f36", "6");
+ }
+ case 8 -> {
// +ve scenario
// modify case 6 -ve
tf = createTestFlow(tn, "f23", "3");
tf1 = createTestFlow(tn, "f99", "4");
tf2 = createTestFlow(tn, "f100", "5");
- tf3 = createTestFlow(tn, "f101", "6");
- break;
- case 9:
+ yield createTestFlow(tn, "f101", "6");
+ }
+ case 9 -> {
// modify case 6
tf = createTestFlow(tn, "f700", "7");
tf1 = createTestFlow(tn, "f230", "23");
tf2 = createTestFlow(tn, "f900", "9");
- tf3 = createTestFlow(tn, "f1000", "10");
- break;
- default:
- throw new IllegalArgumentException("Invalid flowtype: " + flowtype);
- }
+ yield createTestFlow(tn, "f1000", "10");
+ }
+ default -> throw new IllegalArgumentException("Invalid flowtype: " + flowtype);
+ };
InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
.augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId()))
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
- SalGroupService {
+public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, SalGroupService {
+ private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginGroupTestServiceProvider.class);
- private static final Logger LOG = LoggerFactory
- .getLogger(OpenflowpluginGroupTestServiceProvider.class);
- private ObjectRegistration<SalGroupService> groupRegistration;
- private NotificationPublishService notificationService;
+ private ObjectRegistration<SalGroupService> groupRegistration = null;
+ private NotificationPublishService notificationService = null;
/**
* Get group registration.
}
public void start() {
- OpenflowpluginGroupTestServiceProvider.LOG
- .info("SalGroupServiceProvider Started.");
+ LOG.info("SalGroupServiceProvider Started.");
}
/*
*/
@Override
public void close() {
- OpenflowpluginGroupTestServiceProvider.LOG
- .info("SalGroupServiceProvide stopped.");
+ LOG.info("SalGroupServiceProvide stopped.");
groupRegistration.close();
}
*/
@Override
public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(final AddGroupInput input) {
- OpenflowpluginGroupTestServiceProvider.LOG.info("addGroup - {}", input);
+ LOG.info("addGroup - {}", input);
return null;
}
* .group.service.rev130918.RemoveGroupInput)
*/
@Override
- public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(
- final RemoveGroupInput input) {
- OpenflowpluginGroupTestServiceProvider.LOG.info("removeGroup - {}", input);
+ public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(final RemoveGroupInput input) {
+ LOG.info("removeGroup - {}", input);
return null;
}
* .group.service.rev130918.UpdateGroupInput)
*/
@Override
- public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(
- final UpdateGroupInput input) {
- OpenflowpluginGroupTestServiceProvider.LOG.info("updateGroup - {}", input);
+ public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(final UpdateGroupInput input) {
+ LOG.info("updateGroup - {}", input);
return null;
}
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint8;
import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class OpenflowpluginMeterTestCommandProvider implements CommandProvider {
- private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestCommandProvider.class);
+ private static final String ORIGINAL_METER_NAME = "Foo";
+ private static final String UPDATED_METER_NAME = "Bar";
private final DataBroker dataBroker;
private final BundleContext ctx;
private Meter testMeter1;
private Meter testMeter2;
private Node testNode;
- private final String originalMeterName = "Foo";
- private final String updatedMeterName = "Bar";
public OpenflowpluginMeterTestCommandProvider(final DataBroker dataBroker, final BundleContext ctx) {
this.dataBroker = dataBroker;
.setContainerName("abcd")
.withKey(new MeterKey(new MeterId(Uint32.valueOf(12))))
.setMeterId(new MeterId(Uint32.valueOf(9)))
- .setMeterName(originalMeterName)
+ .setMeterName(ORIGINAL_METER_NAME)
.setFlags(new MeterFlags(true, false, false, false))
.setMeterBandHeaders(new MeterBandHeadersBuilder()
.setMeterBandHeader(BindingMap.of(new MeterBandHeaderBuilder()
.setBandId(new BandId(Uint32.ZERO));
if (s2.equalsIgnoreCase("modify")) {
- meter.setMeterName(updatedMeterName);
+ meter.setMeterName(UPDATED_METER_NAME);
bandHeader.setBandRate(Uint32.valueOf(234));
} else {
- meter.setMeterName(originalMeterName);
+ meter.setMeterName(ORIGINAL_METER_NAME);
bandHeader.setBandRate(Uint32.valueOf(123));
}
createUserNode(nref);
}
MeterBuilder meter = createTestMeter();
- meter.setMeterName(updatedMeterName);
+ meter.setMeterName(UPDATED_METER_NAME);
writeMeter(ci, meter.build());
- meter.setMeterName(originalMeterName);
+ meter.setMeterName(ORIGINAL_METER_NAME);
writeMeter(ci, meter.build());
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
- SalMeterService {
- private static final Logger LOG = LoggerFactory
- .getLogger(OpenflowpluginMeterTestServiceProvider.class);
- private DataBroker dataService;
- private ObjectRegistration<SalMeterService> meterRegistration;
- private NotificationPublishService notificationService;
+public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, SalMeterService {
+ private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestServiceProvider.class);
+
+ private DataBroker dataService = null;
+ private ObjectRegistration<SalMeterService> meterRegistration = null;
+ private NotificationPublishService notificationService = null;
/**
* Gets the data service.
* @return {@link #dataService}
*/
public DataBroker getDataService() {
- return this.dataService;
+ return dataService;
}
/**
* @return {@link #meterRegistration}
*/
public ObjectRegistration<SalMeterService> getMeterRegistration() {
- return this.meterRegistration;
+ return meterRegistration;
}
/**
* @return {@link #notificationService}
*/
public NotificationPublishService getNotificationService() {
- return this.notificationService;
+ return notificationService;
}
/**
}
public void start() {
- OpenflowpluginMeterTestServiceProvider.LOG
- .info("SalMeterServiceProvider Started.");
+ LOG.info("SalMeterServiceProvider Started.");
}
/*
*/
@Override
public void close() {
- OpenflowpluginMeterTestServiceProvider.LOG
- .info("SalMeterServiceProvide stopped.");
+ LOG.info("SalMeterServiceProvide stopped.");
meterRegistration.close();
}
*/
@Override
public ListenableFuture<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
- OpenflowpluginMeterTestServiceProvider.LOG.info("addMeter - {}", input);
+ LOG.info("addMeter - {}", input);
return null;
}
* .meter.service.rev130918.RemoveMeterInput)
*/
@Override
- public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(
- final RemoveMeterInput input) {
- OpenflowpluginMeterTestServiceProvider.LOG.info("removeMeter - {}", input);
+ public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(final RemoveMeterInput input) {
+ LOG.info("removeMeter - {}", input);
return null;
}
* .meter.service.rev130918.UpdateMeterInput)
*/
@Override
- public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(
- final UpdateMeterInput input) {
- OpenflowpluginMeterTestServiceProvider.LOG.info("updateMeter - {}", input);
+ public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(final UpdateMeterInput input) {
+ LOG.info("updateMeter - {}", input);
return null;
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutputBuilder;
import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class OpenflowpluginTableFeaturesTestServiceProvider implements
- AutoCloseable, SalTableService {
+public class OpenflowpluginTableFeaturesTestServiceProvider implements AutoCloseable, UpdateTable {
+ private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class);
- private static final Logger LOG = LoggerFactory
- .getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class);
- private ObjectRegistration<SalTableService> tableRegistration;
+ private Registration tableRegistration = null;
private NotificationPublishService notificationService;
/**
*
* @return {@link #tableRegistration}
*/
- public ObjectRegistration<SalTableService> getTableRegistration() {
- return this.tableRegistration;
+ public Registration getTableRegistration() {
+ return tableRegistration;
}
/**
* Set {@link #tableRegistration}.
*/
- public void setTableRegistration(final ObjectRegistration<SalTableService> tableRegistration) {
+ public void setTableRegistration(final Registration tableRegistration) {
this.tableRegistration = tableRegistration;
}
* @return {@link #notificationService}
*/
public NotificationPublishService getNotificationService() {
- return this.notificationService;
+ return notificationService;
}
/**
}
public void start() {
- OpenflowpluginTableFeaturesTestServiceProvider.LOG
- .info("SalTableServiceProvider Started.");
+ LOG.info("SalTableServiceProvider Started.");
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.AutoCloseable#close()
- */
@Override
public void close() {
- OpenflowpluginTableFeaturesTestServiceProvider.LOG
- .info("SalTableServiceProvider stopped.");
+ LOG.info("SalTableServiceProvider stopped.");
tableRegistration.close();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026
- * .SalTableService
- * #updateTable(org.opendaylight.yang.gen.v1.urn.opendaylight
- * .table.service.rev131026.UpdateTableInput)
- */
@Override
- public ListenableFuture<RpcResult<UpdateTableOutput>> updateTable(
- final UpdateTableInput input) {
- OpenflowpluginTableFeaturesTestServiceProvider.LOG.info("updateTable - {}", input);
- return null;
+ public ListenableFuture<RpcResult<UpdateTableOutput>> invoke(final UpdateTableInput input) {
+ LOG.info("updateTable - {}", input);
+ return RpcResultBuilder.success(new UpdateTableOutputBuilder().build()).buildFuture();
}
public ObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(
final RpcProviderService rpcRegistry) {
- setTableRegistration(rpcRegistry.registerRpcImplementation(SalTableService.class, this, ImmutableSet.of(
+ setTableRegistration(rpcRegistry.registerRpcImplementation(this, ImmutableSet.of(
InstanceIdentifier.create(Nodes.class)
.child(Node.class, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID))))));
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class OpenflowpluginTestServiceProvider implements AutoCloseable,
- SalFlowService {
-
- private static final Logger LOG = LoggerFactory
- .getLogger(OpenflowpluginTestServiceProvider.class);
+public class OpenflowpluginTestServiceProvider implements AutoCloseable, SalFlowService {
+ private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestServiceProvider.class);
private final DataBroker dataService;
- private ObjectRegistration<SalFlowService> flowRegistration;
private final NotificationPublishService notificationProviderService;
+ private ObjectRegistration<SalFlowService> flowRegistration = null;
+
public OpenflowpluginTestServiceProvider(final DataBroker dataService,
final NotificationPublishService notificationProviderService) {
this.dataService = dataService;