@Nonnull final TraceConfig dataAfter,
@Nonnull final WriteContext ctx) throws WriteFailedException {
try {
- deleteTraceConfig(dataBefore, id);
+ deleteTraceConfig(id);
addTraceConfig(dataAfter, id);
} catch (Exception exUpdate) {
LOG.error("Update Trace Configuration failed", exUpdate);
@Nonnull final TraceConfig dataBefore,
@Nonnull final WriteContext ctx) throws WriteFailedException {
try {
- deleteTraceConfig(dataBefore, id);
+ deleteTraceConfig(id);
} catch (Exception exDelete) {
LOG.error("Delete Trace Configuration failed", exDelete);
throw new WriteFailedException.DeleteFailedException(id, exDelete);
return reply;
}
- public TraceProfileDelReply deleteTraceConfig(TraceConfig dataBefore,
- final InstanceIdentifier<TraceConfig> id) throws WriteFailedException {
+ public TraceProfileDelReply deleteTraceConfig(final InstanceIdentifier<TraceConfig> id)
+ throws WriteFailedException {
TraceProfileDel del = new TraceProfileDel();
/* Write to VPP */
- TraceProfileDelReply reply = getReplyForWrite((getFutureJVppIoamtrace().
- traceProfileDel(del).toCompletableFuture()), id);
+ TraceProfileDelReply reply = getReplyForWrite(getFutureJVppIoamtrace().traceProfileDel(del)
+ .toCompletableFuture(), id);
return reply;
}
final String interfaceName = id.firstKeyOf(Interface.class).getName();
final int interfaceIndex = interfaceContext.getIndex(interfaceName, writeContext.getMappingContext());
// TODO - HC2VPP-92 - Add more descriptive exception handling after https://jira.fd.io/browse/VPP-649
- setAddress(true, id, interfaceName, interfaceIndex, dataAfter, writeContext);
+ setAddress(true, id, interfaceName, interfaceIndex, dataAfter);
}
@Override
final String interfaceName = id.firstKeyOf(Interface.class).getName();
final int interfaceIndex = interfaceContext.getIndex(interfaceName, writeContext.getMappingContext());
- setAddress(false, id, interfaceName, interfaceIndex, dataBefore, writeContext);
+ setAddress(false, id, interfaceName, interfaceIndex, dataBefore);
}
private void setAddress(boolean add, final InstanceIdentifier<Address> id, final String interfaceName,
- final int interfaceIndex, final Address address,
- final WriteContext writeContext) throws WriteFailedException {
+ final int interfaceIndex, final Address address) throws WriteFailedException {
Subnet subnet = address.getSubnet();
builder.setTtl(resolveTtl(details.ttl));
builder.setAuthoritative(
new RemoteMapping.Authoritative(byteToBoolean(details.authoritative)));
- resolveMappings(id, builder, details, ctx.getModificationCache(), ctx.getMappingContext());
+ resolveMappings(builder, details, ctx.getModificationCache(), ctx.getMappingContext());
}
@Override
((RemoteMappingsBuilder) builder).setRemoteMapping(readData);
}
- private void resolveMappings(final InstanceIdentifier id, final RemoteMappingBuilder builder,
+ private void resolveMappings(final RemoteMappingBuilder builder,
final OneEidTableDetails details,
final ModificationCache cache,
final MappingContext mappingContext) throws ReadFailedException {
throws WriteFailedException {
LOG.debug("Creating nsh entry: iid={} dataAfter={}", id, dataAfter);
final int newEntryIndex =
- nshAddDelEntry(true, id, dataAfter, ~0 /* value not present */, writeContext.getMappingContext());
+ nshAddDelEntry(true, id, dataAfter);
// Add nsh entry name <-> vpp index mapping to the naming context:
nshEntryContext.addName(newEntryIndex, dataAfter.getName(), writeContext.getMappingContext());
LOG.debug("Successfully created nsh entry(id={]): iid={} dataAfter={}", newEntryIndex, id, dataAfter);
"Removing nsh entry {}, but index could not be found in the nsh entry context", entryName);
final int entryIndex = nshEntryContext.getIndex(entryName, writeContext.getMappingContext());
- nshAddDelEntry(false, id, dataBefore, entryIndex, writeContext.getMappingContext());
+ nshAddDelEntry(false, id, dataBefore);
// Remove deleted interface from interface context:
nshEntryContext.removeName(dataBefore.getName(), writeContext.getMappingContext());
}
private int nshAddDelEntry(final boolean isAdd, @Nonnull final InstanceIdentifier<NshEntry> id,
- @Nonnull final NshEntry entry, final int entryId, final MappingContext ctx)
+ @Nonnull final NshEntry entry)
throws WriteFailedException {
final CompletionStage<NshAddDelEntryReply> createNshEntryReplyCompletionStage =
- getFutureJVppNsh().nshAddDelEntry(getNshAddDelEntryRequest(isAdd, entryId, entry, ctx));
+ getFutureJVppNsh().nshAddDelEntry(getNshAddDelEntryRequest(isAdd, entry));
final NshAddDelEntryReply reply =
getReplyForWrite(createNshEntryReplyCompletionStage.toCompletableFuture(), id);
request.tlvLength = cur_len;
}
- private NshAddDelEntry getNshAddDelEntryRequest(final boolean isAdd, final int entryIndex,
- @Nonnull final NshEntry entry,
- @Nonnull final MappingContext ctx) {
+ private NshAddDelEntry getNshAddDelEntryRequest(final boolean isAdd, @Nonnull final NshEntry entry) {
final NshAddDelEntry request = new NshAddDelEntry();
request.isAdd = booleanToByte(isAdd);
final Ipv4RouteNamesFactory namesFactory) {
if (parsedHops.size() == 1) {
final FibPath path = parsedHops.get(0);
- if (RouteMapper.INSTANCE.isTableLookup(path)) return tableLookup(path);
+ if (RouteMapper.INSTANCE.isTableLookup(path)) return tableLookup();
if (RouteMapper.INSTANCE.isSpecialHop(path)) return specialHop(path);
return simpleHop(path, interfaceContext, mappingContext);
}
return hopList(routeName, parsedHops, interfaceContext, routeHopContext, mappingContext, namesFactory);
}
- static NextHopOptions tableLookup(final FibPath fibPath) {
+ static NextHopOptions tableLookup() {
return new TableLookupBuilder()
.setTableLookupParams(
new TableLookupParamsBuilder()
final Ipv6RouteNamesFactory namesFactory) {
if (parsedHops.size() == 1) {
final FibPath path = parsedHops.get(0);
- if (RouteMapper.INSTANCE.isTableLookup(path)) return tableLookup(path);
+ if (RouteMapper.INSTANCE.isTableLookup(path)) return tableLookup();
if (RouteMapper.INSTANCE.isSpecialHop(path)) return specialHop(path);
return simpleHop(path, interfaceContext, mappingContext);
}
return hopList(routeName, parsedHops, interfaceContext, routeHopContext, mappingContext, namesFactory);
}
- static NextHopOptions tableLookup(final FibPath fibPath) {
+ static NextHopOptions tableLookup() {
return new TableLookupBuilder()
.setTableLookupParams(
new TableLookupParamsBuilder()
@Nonnull final Interface dataAfter,
@Nonnull final WriteContext writeContext)
throws WriteFailedException {
- updateInterface(id, dataBefore, dataAfter, writeContext);
+ updateInterface(id, dataAfter, writeContext);
}
@Override
}
private void updateInterface(final InstanceIdentifier<Interface> id,
- final Interface dataBefore,
final Interface dataAfter, final WriteContext writeContext)
throws WriteFailedException {
LOG.debug("Updating interface:{} to: {}", id, dataAfter);
if (classifySession.isPresent()) {
final ClassifySessionDetails detail = classifySession.get();
final Optional<VppNode> node =
- readVppNode(detail.tableId, detail.hitNextIndex, classifyTableContext, ctx.getMappingContext(), LOG);
+ readVppNode(detail.tableId, detail.hitNextIndex, classifyTableContext, ctx.getMappingContext());
final StandardBuilder nextNode = new StandardBuilder();
if (node.isPresent()) {
nextNode.setHitNext(node.get());
// TODO: HONEYCOMB-118 the approach might fail if the opaqueIndex contains small value that collides
// with some of the adjacent nodes
- final Optional<VppNode> node = readVppNode(tableIndex, opaqueIndex, classifyTableContext, ctx, LOG);
+ final Optional<VppNode> node = readVppNode(tableIndex, opaqueIndex, classifyTableContext, ctx);
if (node.isPresent()) {
return new OpaqueIndex(node.get());
} else {
}
final Optional<VppNode> node =
- readVppNode(reply.tableId, reply.missNextIndex, classifyTableContext, ctx.getMappingContext(), LOG);
+ readVppNode(reply.tableId, reply.missNextIndex, classifyTableContext, ctx.getMappingContext());
if (node.isPresent()) {
builder.setMissNext(node.get());
} else {
*/
default Optional<VppNode> readVppNode(final int tableIndex, final int nodeIndex,
@Nonnull final VppClassifierContextManager vppClassifierContextManager,
- @Nonnull final MappingContext ctx, @Nonnull final Logger log) {
+ @Nonnull final MappingContext ctx) {
final PacketHandlingAction action = PacketHandlingAction.forValue(nodeIndex);
if (action == null) {
return vppClassifierContextManager.getNodeName(tableIndex, nodeIndex, ctx)