diff options
Diffstat (limited to 'vpp-classifier/impl')
12 files changed, 26 insertions, 26 deletions
diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/InterfacePolicerCustomizer.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/InterfacePolicerCustomizer.java index 62a4f79fd..e170ebcfe 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/InterfacePolicerCustomizer.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/InterfacePolicerCustomizer.java @@ -104,7 +104,7 @@ final class InterfacePolicerCustomizer extends FutureJVppCustomizer private Optional<Integer> readTableIndex(@Nonnull final InstanceIdentifier<Policer> id, final int ifcIndex, final byte type, final ModificationCache cache) throws ReadFailedException { - final com.google.common.base.Optional<PolicerClassifyDetailsReplyDump> dump = + final java.util.Optional<PolicerClassifyDetailsReplyDump> dump = dumpManager.getDump(id, cache, type); if (!dump.isPresent() || dump.get().policerClassifyDetails.isEmpty()) { return Optional.empty(); diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/PolicerCustomizer.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/PolicerCustomizer.java index 6445828c0..6d0295e89 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/PolicerCustomizer.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/policer/read/PolicerCustomizer.java @@ -16,7 +16,7 @@ package io.fd.hc2vpp.policer.read; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.primitives.Longs; import com.google.common.primitives.UnsignedInts; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManager.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManager.java index 3dda5d3de..bd7bcb0ef 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManager.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManager.java @@ -16,7 +16,7 @@ package io.fd.hc2vpp.vpp.classifier.context; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.honeycomb.translate.MappingContext; import javax.annotation.Nonnull; import javax.annotation.Nullable; diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImpl.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImpl.java index c4b48acdc..06cdcb2e3 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImpl.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImpl.java @@ -20,7 +20,7 @@ import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.base.Preconditions; import com.google.inject.Inject; import io.fd.honeycomb.translate.MappingContext; @@ -33,8 +33,8 @@ import java.util.stream.Collector; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Named; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.classifier.context.rev170502.VppClassifierContext; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.classifier.context.rev170502.VppClassifierContextBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.classifier.context.rev170502.vpp.classifier.context.ClassifyTableContext; @@ -124,9 +124,9 @@ public final class VppClassifierContextManagerImpl implements VppClassifierConte public Optional<String> getTableBaseNode(@Nonnull final String name, @Nonnull final MappingContext ctx) { final Optional<ClassifyTableContext> read = ctx.read(getMappingIid(name)); if (read.isPresent()) { - return Optional.fromNullable(read.get().getClassifierNodeName()); + return Optional.ofNullable(read.get().getClassifierNodeName()); } - return Optional.absent(); + return Optional.empty(); } @Override @@ -146,15 +146,15 @@ public final class VppClassifierContextManagerImpl implements VppClassifierConte @Override public Optional<String> getNodeName(final int tableIndex, final int nodeIndex, @Nonnull final MappingContext ctx) { if (!containsName(tableIndex, ctx)) { - return Optional.absent(); + return Optional.empty(); } final String tableName = getTableName(tableIndex, ctx); final Optional<ClassifyTableContext> tableCtx = ctx.read(getMappingIid(tableName)); final List<NodeContext> nodeContext = tableCtx.get().getNodeContext(); if (nodeContext == null) { - return Optional.absent(); + return Optional.empty(); } - return Optional.fromNullable(nodeContext.stream() + return Optional.ofNullable(nodeContext.stream() .filter(n -> n.getIndex().equals(nodeIndex)) .findFirst() .map(nodes -> nodes.getName()) diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifySessionReader.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifySessionReader.java index ffe6b263c..9c69433f0 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifySessionReader.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifySessionReader.java @@ -18,7 +18,7 @@ package io.fd.hc2vpp.vpp.classifier.read; import static com.google.common.base.Preconditions.checkNotNull; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInts; import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; @@ -185,7 +185,7 @@ public class ClassifySessionReader extends FutureJVppCustomizer final List<ClassifySessionDetails> filteredSessions = details.stream() .filter(singleDetail -> Arrays.equals(singleDetail.match, match)).collect(Collectors.toList()); if (filteredSessions.isEmpty()) { - return Optional.absent(); + return Optional.empty(); } else if (filteredSessions.size() == 1) { return Optional.of(filteredSessions.get(0)); } else { @@ -194,7 +194,7 @@ public class ClassifySessionReader extends FutureJVppCustomizer filteredSessions.size())); } } - return Optional.absent(); + return Optional.empty(); } @Nonnull diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReader.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReader.java index 4139a7187..61859b16a 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReader.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReader.java @@ -18,7 +18,7 @@ package io.fd.hc2vpp.vpp.classifier.read; import static com.google.common.base.Preconditions.checkNotNull; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.base.Preconditions; import com.google.common.primitives.UnsignedInts; import io.fd.hc2vpp.common.translate.util.FutureJVppCustomizer; diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/VppNodeReader.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/VppNodeReader.java index e8a33a484..965860c82 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/VppNodeReader.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/read/VppNodeReader.java @@ -16,7 +16,7 @@ package io.fd.hc2vpp.vpp.classifier.read; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.vpp.classifier.context.VppClassifierContextManager; import io.fd.honeycomb.translate.MappingContext; import javax.annotation.Nonnull; @@ -38,7 +38,7 @@ interface VppNodeReader { final PacketHandlingAction action = PacketHandlingAction.forValue(nodeIndex); if (action == null) { return vppClassifierContextManager.getNodeName(tableIndex, nodeIndex, ctx) - .transform(nodeName -> new VppNode(new VppNodeName(nodeName))); + .map(nodeName -> new VppNode(new VppNodeName(nodeName))); } return Optional.of(new VppNode(action)); } diff --git a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java index d50dbda89..72829fcb0 100644 --- a/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java +++ b/vpp-classifier/impl/src/main/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriter.java @@ -16,7 +16,7 @@ package io.fd.hc2vpp.vpp.classifier.write; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.common.translate.util.ByteDataTranslator; import io.fd.hc2vpp.common.translate.util.JvppReplyConsumer; import io.fd.hc2vpp.common.translate.util.NamingContext; diff --git a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/VppClassifierModuleTest.java b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/VppClassifierModuleTest.java index d6e990ec4..e560e1672 100644 --- a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/VppClassifierModuleTest.java +++ b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/VppClassifierModuleTest.java @@ -38,7 +38,7 @@ import java.util.Set; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.DataBroker; public class VppClassifierModuleTest { diff --git a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImplTest.java b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImplTest.java index ed70e7e15..9a59e5774 100644 --- a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImplTest.java +++ b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/context/VppClassifierContextManagerImplTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.honeycomb.translate.MappingContext; import java.util.Arrays; import org.junit.Before; @@ -70,7 +70,7 @@ public class VppClassifierContextManagerImplTest { @Test public void testContainsTable() throws Exception { - when(ctx.read(TABLE_IID_0)).thenReturn(Optional.absent()); + when(ctx.read(TABLE_IID_0)).thenReturn(Optional.empty()); assertFalse(vppClassfierContext.containsTable(TABLE_NAME_0, ctx)); } @@ -124,7 +124,7 @@ public class VppClassifierContextManagerImplTest { final ClassifyTableContext tableCtx = table(TABLE_ID_0, TABLE_NAME_0, "aa"); when(ctx.read(VPP_CLASSIFIER_CONTEXT_IID)).thenReturn(Optional.of(context(tableCtx))); when(ctx.read(TABLE_IID_0)).thenReturn(Optional.of(tableCtx)); - assertEquals(Optional.absent(), vppClassfierContext.getNodeName(TABLE_ID_0, 123, ctx)); + assertEquals(Optional.empty(), vppClassfierContext.getNodeName(TABLE_ID_0, 123, ctx)); } @Test diff --git a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReaderTest.java b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReaderTest.java index b2accdcba..aa450804f 100644 --- a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReaderTest.java +++ b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/read/ClassifyTableReaderTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.common.test.read.ListReaderCustomizerTest; import io.fd.hc2vpp.vpp.classifier.context.VppClassifierContextManager; import io.fd.honeycomb.translate.read.ReadFailedException; @@ -100,7 +100,7 @@ public class ClassifyTableReaderTest extends when(classifierContext.containsTable(TABLE_NAME_1, mappingContext)).thenReturn(true); when(classifierContext.getTableIndex(TABLE_NAME_1, mappingContext)).thenReturn(TABLE_INDEX_1); - when(classifierContext.getTableBaseNode(TABLE_NAME_1, mappingContext)).thenReturn(Optional.absent()); + when(classifierContext.getTableBaseNode(TABLE_NAME_1, mappingContext)).thenReturn(Optional.empty()); final ClassifyTableBuilder builder = mock(ClassifyTableBuilder.class); getCustomizer().readCurrentAttributes(getClassifyTableId(TABLE_NAME_1), builder, ctx); diff --git a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriterTest.java b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriterTest.java index 84bc4d6a4..efaf58c3b 100644 --- a/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriterTest.java +++ b/vpp-classifier/impl/src/test/java/io/fd/hc2vpp/vpp/classifier/write/ClassifySessionWriterTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.hc2vpp.common.test.write.WriterCustomizerTest; import io.fd.hc2vpp.common.translate.util.NamingContext; import io.fd.hc2vpp.vpp.classifier.context.VppClassifierContextManager; @@ -191,7 +191,7 @@ public class ClassifySessionWriterTest extends WriterCustomizerTest { @Test(expected = IllegalStateException.class) public void testDeleteMisssingTable() throws WriteFailedException { - when(writeContext.readAfter(ArgumentMatchers.any())).thenReturn(Optional.absent()); + when(writeContext.readAfter(ArgumentMatchers.any())).thenReturn(Optional.empty()); final String match = "00:00:00:00:00:00:01:02:03:04:05:06:00:00:00:00"; final ClassifySession classifySession = generateClassifySession(SESSION_INDEX, match); final InstanceIdentifier<ClassifySession> id = getClassifySessionId(TABLE_NAME, match); |