Adopt the following versions:
- odlparent-10.0.0
- infrautils-3.0.0
- yangtools-8.0.2
- mdsal-9.0.1
- controller-5.0.1
- aaa-0.15.1
- netconf-3.0.0
Change-Id: Ia4cd90ea1a8aa4f56a3e1853cb3363d40752e2b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
45 files changed:
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
for plugin configuration etc. -->
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
for plugin configuration etc. -->
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>8.0.11</version>
+ <version>9.0.1</version>
</dependency>
<dependency>
<groupId>junit-addons</groupId>
</dependency>
<dependency>
<groupId>junit-addons</groupId>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>4.0.10</version>
+ <version>5.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: lispflowmapping :: ${project.artifactId}</name>
build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: lispflowmapping :: ${project.artifactId}</name>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>controller-artifacts</artifactId>
+ <version>5.0.1</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>odl-controller-blueprint</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>odl-mdsal-broker</artifactId>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>odl-mdsal-broker</artifactId>
- <version>4.0.10</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<type>xml</type>
<classifier>features</classifier>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-lispflowmapping-inmemorydb">
<feature name="odl-lispflowmapping-inmemorydb">
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-lispflowmapping-inmemorydb">
<feature name="odl-lispflowmapping-inmemorydb">
- <feature version="[4,5)">odl-mdsal-broker</feature>
+ <feature version="[5,6)">odl-mdsal-broker</feature>
+ <feature version="[5,6)">odl-controller-blueprint</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>odl-restconf</artifactId>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>odl-restconf</artifactId>
- <version>2.0.14</version>
+ <version>3.0.0</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>8.0.11</version>
+ <version>9.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-lispflowmapping-models">
<feature name="odl-lispflowmapping-models">
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-lispflowmapping-models">
<feature name="odl-lispflowmapping-models">
- <feature version="[9,10)">odl-apache-commons-lang3</feature>
- <feature version="[8,9)">odl-mdsal-model-rfc6991</feature>
+ <feature version="[10,11)">odl-apache-commons-lang3</feature>
+ <feature version="[9,10)">odl-mdsal-model-rfc6991</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>odl-restconf</artifactId>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>odl-restconf</artifactId>
- <version>2.0.14</version>
+ <version>3.0.0</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>odl-mdsal-broker</artifactId>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>odl-mdsal-broker</artifactId>
- <version>4.0.10</version>
+ <version>5.0.1</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<type>xml</type>
<classifier>features</classifier>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-lispflowmapping-southbound">
<feature name="odl-lispflowmapping-southbound">
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-lispflowmapping-southbound">
<feature name="odl-lispflowmapping-southbound">
- <feature version="[9,10)">odl-netty-4</feature>
- <feature version="[4,5)">odl-mdsal-broker</feature>
+ <feature version="[10,11)">odl-netty-4</feature>
+ <feature version="[5,6)">odl-mdsal-broker</feature>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-it-parent</artifactId>
<parent>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-it-parent</artifactId>
- <version>4.0.10</version>
+ <version>5.0.1</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.io.File;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
final MapReply mapReply1 = lms.handleMapRequest(
new MapRequestBuilder(requests1.get(0))
.setSourceEid(new SourceEidBuilder().setEid(subscriberEid).build())
final MapReply mapReply1 = lms.handleMapRequest(
new MapRequestBuilder(requests1.get(0))
.setSourceEid(new SourceEidBuilder().setEid(subscriberEid).build())
- .setItrRloc(Lists.newArrayList(new ItrRlocBuilder()
+ .setItrRloc(List.of(new ItrRlocBuilder()
.setRloc(LispAddressUtil.asIpv4Rloc(subscriberSrcRloc1)).build()))
.setRloc(LispAddressUtil.asIpv4Rloc(subscriberSrcRloc1)).build()))
- .setEidItem(Lists.newArrayList(new EidItemBuilder().setEid(eid1).build()))
+ .setEidItem(List.of(new EidItemBuilder().setEid(eid1).build()))
.setSmrInvoked(true)
.setSmr(false).build());
.setSmrInvoked(true)
.setSmr(false).build());
final MapReply mapReply2 = lms.handleMapRequest(
new MapRequestBuilder(requests2.get(0))
.setSourceEid(new SourceEidBuilder().setEid(subscriberEid).build())
final MapReply mapReply2 = lms.handleMapRequest(
new MapRequestBuilder(requests2.get(0))
.setSourceEid(new SourceEidBuilder().setEid(subscriberEid).build())
- .setItrRloc(Lists.newArrayList(new ItrRlocBuilder()
+ .setItrRloc(List.of(new ItrRlocBuilder()
.setRloc(LispAddressUtil.asIpv4Rloc(subscriberSrcRloc2)).build()))
.setRloc(LispAddressUtil.asIpv4Rloc(subscriberSrcRloc2)).build()))
- .setEidItem(Lists.newArrayList(new EidItemBuilder().setEid(eid1).build()))
+ .setEidItem(List.of(new EidItemBuilder().setEid(eid1).build()))
.setSmrInvoked(true)
.setSmr(false).build());
.setSmrInvoked(true)
.setSmr(false).build());
LOG.error("Unknown address {}.", address, e);
}
LOG.error("Unknown address {}.", address, e);
}
- final List<MapRequest> requests = Lists.newArrayList();
+ final List<MapRequest> requests = new ArrayList<>();
byte[][] buffers = reader.getBuffers(expectedSmrs);
for (byte[] buf : buffers) {
ByteBuffer packet = ByteBuffer.wrap(buf);
byte[][] buffers = reader.getBuffers(expectedSmrs);
for (byte[] buf : buffers) {
ByteBuffer packet = ByteBuffer.wrap(buf);
cleanUP();
String macString = "01:02:03:04:05:06";
String ipString = "10.20.255.30";
cleanUP();
String macString = "01:02:03:04:05:06";
String ipString = "10.20.255.30";
- List<SimpleAddress> addresses = new ArrayList<SimpleAddress>();
- addresses.add(new SimpleAddress(new IpAddress(new Ipv4Address(ipString))));
- addresses.add(new SimpleAddress(new MacAddress(macString)));
AfiListBuilder listbuilder = new AfiListBuilder();
AfiListBuilder listbuilder = new AfiListBuilder();
- listbuilder.setAddressList(addresses);
+ listbuilder.setAddressList(ImmutableSet.of(
+ new SimpleAddress(new IpAddress(new Ipv4Address(ipString))),
+ new SimpleAddress(new MacAddress(macString))));
EidBuilder eb = new EidBuilder();
eb.setAddressType(AfiListLcaf.class);
EidBuilder eb = new EidBuilder();
eb.setAddressType(AfiListLcaf.class);
assertEquals(AfiListLcaf.class, receivedAddress.getAddressType());
AfiList listAddrFromNetwork = (AfiList) receivedAddress.getAddress();
assertEquals(AfiListLcaf.class, receivedAddress.getAddressType());
AfiList listAddrFromNetwork = (AfiList) receivedAddress.getAddress();
- SimpleAddress receivedAddr1 = (SimpleAddress) listAddrFromNetwork.getAfiList().getAddressList().get(0);
- SimpleAddress receivedAddr2 = (SimpleAddress) listAddrFromNetwork.getAfiList().getAddressList().get(1);
+ Iterator<SimpleAddress> addrList = listAddrFromNetwork.getAfiList().getAddressList().iterator();
+ SimpleAddress receivedAddr1 = addrList.next();
+ SimpleAddress receivedAddr2 = addrList.next();
assertNotNull(receivedAddr1.getIpAddress().getIpv4Address());
assertNotNull(receivedAddr2.getMacAddress());
assertNotNull(receivedAddr1.getIpAddress().getIpv4Address());
assertNotNull(receivedAddr2.getMacAddress());
ExplicitLocatorPath receivedAddress = (ExplicitLocatorPath) reply.getMappingRecordItem().get(0)
.getMappingRecord().getEid().getAddress();
ExplicitLocatorPath receivedAddress = (ExplicitLocatorPath) reply.getMappingRecordItem().get(0)
.getMappingRecord().getEid().getAddress();
- Hop receivedHop1 = (Hop) receivedAddress.getExplicitLocatorPath().getHop().get(0);
- Hop receivedHop2 = (Hop) receivedAddress.getExplicitLocatorPath().getHop().get(1);
+ Hop receivedHop1 = receivedAddress.getExplicitLocatorPath().getHop().get(0);
+ Hop receivedHop2 = receivedAddress.getExplicitLocatorPath().getHop().get(1);
assertEquals(true, receivedHop1.getLrsBits().getLookup());
assertEquals(false, receivedHop1.getLrsBits().getRlocProbe());
assertEquals(true, receivedHop1.getLrsBits().getLookup());
assertEquals(false, receivedHop1.getLrsBits().getRlocProbe());
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>8.0.11</version>
+ <version>9.0.1</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
+ <artifactId>org.osgi.framework</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.lispflowmapping</groupId>
</dependency>
<dependency>
<groupId>org.opendaylight.lispflowmapping</groupId>
<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
</dependency>
<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>3.12.4</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
+ <version>2.0.9</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
+ <version>2.0.9</version>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
</dependency>
</dependencies>
</project>
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
private final DataBroker broker;
private TransactionChain txChain;
private final DataBroker broker;
private TransactionChain txChain;
+ @SuppressFBWarnings(value = "MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR", justification = "Non-final for mocking")
public DataStoreBackEnd(DataBroker broker) {
this.broker = broker;
createTransactionChain();
public DataStoreBackEnd(DataBroker broker) {
this.broker = broker;
createTransactionChain();
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
+ <artifactId>org.osgi.framework</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
</dependency>
<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>3.12.4</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
+ <version>2.0.9</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
+ <version>2.0.9</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.lispflowmapping</groupId>
</dependency>
<dependency>
<groupId>org.opendaylight.lispflowmapping</groupId>
import static java.util.Objects.requireNonNull;
import static java.util.Objects.requireNonNull;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.List;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingsInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingsOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingsInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingsOutput;
-import org.opendaylight.yangtools.yang.common.RpcError;
+import org.opendaylight.yangtools.yang.common.ErrorTag;
+import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
*/
public class MappingService implements OdlMappingserviceService, IMappingService, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(MappingService.class);
*/
public class MappingService implements OdlMappingserviceService, IMappingService, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(MappingService.class);
- private static final String NOT_FOUND_TAG = "data-missing";
- private static final String DATA_EXISTS_TAG = "data-exists";
private MappingSystem mappingSystem;
private DataStoreBackEnd dsbe;
private MappingSystem mappingSystem;
private DataStoreBackEnd dsbe;
@Override
public ListenableFuture<RpcResult<AddKeyOutput>> addKey(AddKeyInput input) {
requireNonNull(input, "add-key RPC input must be not null!");
@Override
public ListenableFuture<RpcResult<AddKeyOutput>> addKey(AddKeyInput input) {
requireNonNull(input, "add-key RPC input must be not null!");
- LOG.trace("RPC received to add the following key: " + input.toString());
+ LOG.trace("RPC received to add the following key: {}", input);
RpcResultBuilder<AddKeyOutput> rpcResultBuilder;
RpcResultBuilder<AddKeyOutput> rpcResultBuilder;
if (key != null) {
String message = "Key already exists! Please use update-key if you want to change it.";
rpcResultBuilder = RpcResultBuilder.<AddKeyOutput>failed()
if (key != null) {
String message = "Key already exists! Please use update-key if you want to change it.";
rpcResultBuilder = RpcResultBuilder.<AddKeyOutput>failed()
- .withError(RpcError.ErrorType.PROTOCOL, DATA_EXISTS_TAG, message);
- return Futures.immediateFuture(rpcResultBuilder.build());
+ .withError(ErrorType.PROTOCOL, ErrorTag.DATA_EXISTS, message);
+ return rpcResultBuilder.buildFuture();
}
dsbe.addAuthenticationKey(RPCInputConvertorUtil.toAuthenticationKey(input));
rpcResultBuilder = RpcResultBuilder.success(new AddKeyOutputBuilder().build());
}
dsbe.addAuthenticationKey(RPCInputConvertorUtil.toAuthenticationKey(input));
rpcResultBuilder = RpcResultBuilder.success(new AddKeyOutputBuilder().build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
}
@Override
public ListenableFuture<RpcResult<AddMappingOutput>> addMapping(AddMappingInput input) {
requireNonNull(input, "add-mapping RPC input must be not null!");
}
@Override
public ListenableFuture<RpcResult<AddMappingOutput>> addMapping(AddMappingInput input) {
requireNonNull(input, "add-mapping RPC input must be not null!");
- LOG.trace("RPC received to add the following mapping: " + input.toString());
+ LOG.trace("RPC received to add the following mapping: {}", input);
dsbe.addMapping(RPCInputConvertorUtil.toMapping(input));
dsbe.addMapping(RPCInputConvertorUtil.toMapping(input));
rpcResultBuilder = RpcResultBuilder.success(new AddMappingOutputBuilder().build());
rpcResultBuilder = RpcResultBuilder.success(new AddMappingOutputBuilder().build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
@Override
public ListenableFuture<RpcResult<GetKeyOutput>> getKey(GetKeyInput input) {
requireNonNull(input, "get-key RPC input must be not null!");
@Override
public ListenableFuture<RpcResult<GetKeyOutput>> getKey(GetKeyInput input) {
requireNonNull(input, "get-key RPC input must be not null!");
- LOG.trace("RPC received to get the following key: " + input.toString());
+ LOG.trace("RPC received to get the following key: {}", input);
RpcResultBuilder<GetKeyOutput> rpcResultBuilder;
RpcResultBuilder<GetKeyOutput> rpcResultBuilder;
if (key == null) {
String message = "Key was not found in the mapping database";
rpcResultBuilder = RpcResultBuilder.<GetKeyOutput>failed()
if (key == null) {
String message = "Key was not found in the mapping database";
rpcResultBuilder = RpcResultBuilder.<GetKeyOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, NOT_FOUND_TAG, message);
+ .withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, message);
- rpcResultBuilder = RpcResultBuilder.success(new GetKeyOutputBuilder().setMappingAuthkey(key));
+ rpcResultBuilder = RpcResultBuilder.success(new GetKeyOutputBuilder().setMappingAuthkey(key).build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
}
@Override
public ListenableFuture<RpcResult<GetMappingOutput>> getMapping(GetMappingInput input) {
requireNonNull(input, "get-mapping RPC input must be not null!");
}
@Override
public ListenableFuture<RpcResult<GetMappingOutput>> getMapping(GetMappingInput input) {
requireNonNull(input, "get-mapping RPC input must be not null!");
- LOG.trace("RPC received to get the following mapping: " + input.toString());
+ LOG.trace("RPC received to get the following mapping: {}", input);
RpcResultBuilder<GetMappingOutput> rpcResultBuilder;
RpcResultBuilder<GetMappingOutput> rpcResultBuilder;
if (reply == null) {
String message = "No mapping was found in the mapping database";
rpcResultBuilder = RpcResultBuilder.<GetMappingOutput>failed()
if (reply == null) {
String message = "No mapping was found in the mapping database";
rpcResultBuilder = RpcResultBuilder.<GetMappingOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, NOT_FOUND_TAG, message);
+ .withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, message);
} else {
final MappingRecord convertedReply = convertFromBinaryIfNecessary(reply.getRecord());
} else {
final MappingRecord convertedReply = convertFromBinaryIfNecessary(reply.getRecord());
- rpcResultBuilder = RpcResultBuilder.success(new GetMappingOutputBuilder().setMappingRecord(convertedReply));
+ rpcResultBuilder = RpcResultBuilder.success(
+ new GetMappingOutputBuilder().setMappingRecord(convertedReply).build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
@Override
public ListenableFuture<RpcResult<GetMappingWithXtrIdOutput>> getMappingWithXtrId(GetMappingWithXtrIdInput input) {
requireNonNull(input, "get-mapping RPC input must be not null!");
@Override
public ListenableFuture<RpcResult<GetMappingWithXtrIdOutput>> getMappingWithXtrId(GetMappingWithXtrIdInput input) {
requireNonNull(input, "get-mapping RPC input must be not null!");
- LOG.trace("RPC received to get the following mapping: " + input.toString());
+ LOG.trace("RPC received to get the following mapping: {}", input);
RpcResultBuilder<GetMappingWithXtrIdOutput> rpcResultBuilder;
RpcResultBuilder<GetMappingWithXtrIdOutput> rpcResultBuilder;
if (reply == null) {
String message = "No mapping was found in the mapping database";
rpcResultBuilder = RpcResultBuilder.<GetMappingWithXtrIdOutput>failed()
if (reply == null) {
String message = "No mapping was found in the mapping database";
rpcResultBuilder = RpcResultBuilder.<GetMappingWithXtrIdOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, NOT_FOUND_TAG, message);
+ .withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, message);
} else {
final MappingRecord convertedReply = convertFromBinaryIfNecessary(reply.getRecord());
rpcResultBuilder = RpcResultBuilder.success(new GetMappingWithXtrIdOutputBuilder()
} else {
final MappingRecord convertedReply = convertFromBinaryIfNecessary(reply.getRecord());
rpcResultBuilder = RpcResultBuilder.success(new GetMappingWithXtrIdOutputBuilder()
- .setMappingRecord(convertedReply));
+ .setMappingRecord(convertedReply).build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
}
@Override
public ListenableFuture<RpcResult<RemoveKeyOutput>> removeKey(RemoveKeyInput input) {
requireNonNull(input, "remove-key RPC input must be not null!");
}
@Override
public ListenableFuture<RpcResult<RemoveKeyOutput>> removeKey(RemoveKeyInput input) {
requireNonNull(input, "remove-key RPC input must be not null!");
- LOG.trace("RPC received to remove the following key: " + input.toString());
+ LOG.trace("RPC received to remove the following key: {}", input);
RpcResultBuilder<RemoveKeyOutput> rpcResultBuilder;
RpcResultBuilder<RemoveKeyOutput> rpcResultBuilder;
rpcResultBuilder = RpcResultBuilder.success(new RemoveKeyOutputBuilder().build());
rpcResultBuilder = RpcResultBuilder.success(new RemoveKeyOutputBuilder().build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
}
@Override
public ListenableFuture<RpcResult<RemoveMappingOutput>> removeMapping(RemoveMappingInput input) {
requireNonNull(input, "remove-mapping RPC input must be not null!");
}
@Override
public ListenableFuture<RpcResult<RemoveMappingOutput>> removeMapping(RemoveMappingInput input) {
requireNonNull(input, "remove-mapping RPC input must be not null!");
- LOG.trace("RPC received to remove the following mapping: " + input.toString());
+ LOG.trace("RPC received to remove the following mapping: {}", input);
RpcResultBuilder<RemoveMappingOutput> rpcResultBuilder;
RpcResultBuilder<RemoveMappingOutput> rpcResultBuilder;
rpcResultBuilder = RpcResultBuilder.success(new RemoveMappingOutputBuilder().build());
rpcResultBuilder = RpcResultBuilder.success(new RemoveMappingOutputBuilder().build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
@Override
public ListenableFuture<RpcResult<UpdateKeyOutput>> updateKey(UpdateKeyInput input) {
requireNonNull(input, "update-key RPC input must be not null!");
@Override
public ListenableFuture<RpcResult<UpdateKeyOutput>> updateKey(UpdateKeyInput input) {
requireNonNull(input, "update-key RPC input must be not null!");
- LOG.trace("RPC received to update the following key: " + input.toString());
+ LOG.trace("RPC received to update the following key: {}", input);
RpcResultBuilder<UpdateKeyOutput> rpcResultBuilder;
RpcResultBuilder<UpdateKeyOutput> rpcResultBuilder;
if (key == null) {
String message = "Key doesn't exist! Please use add-key if you want to create a new authentication key.";
rpcResultBuilder = RpcResultBuilder.<UpdateKeyOutput>failed()
if (key == null) {
String message = "Key doesn't exist! Please use add-key if you want to create a new authentication key.";
rpcResultBuilder = RpcResultBuilder.<UpdateKeyOutput>failed()
- .withError(RpcError.ErrorType.PROTOCOL, NOT_FOUND_TAG, message);
- return Futures.immediateFuture(rpcResultBuilder.build());
+ .withError(ErrorType.PROTOCOL, ErrorTag.DATA_MISSING, message);
+ return rpcResultBuilder.buildFuture();
}
dsbe.updateAuthenticationKey(RPCInputConvertorUtil.toAuthenticationKey(input));
rpcResultBuilder = RpcResultBuilder.success(new UpdateKeyOutputBuilder().build());
}
dsbe.updateAuthenticationKey(RPCInputConvertorUtil.toAuthenticationKey(input));
rpcResultBuilder = RpcResultBuilder.success(new UpdateKeyOutputBuilder().build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
}
@Override
public ListenableFuture<RpcResult<UpdateMappingOutput>> updateMapping(UpdateMappingInput input) {
}
@Override
public ListenableFuture<RpcResult<UpdateMappingOutput>> updateMapping(UpdateMappingInput input) {
- LOG.trace("RPC received to update the following mapping: " + input.toString());
+ LOG.trace("RPC received to update the following mapping: {}", input);
requireNonNull(input, "update-mapping RPC input must be not null!");
RpcResultBuilder<UpdateMappingOutput> rpcResultBuilder;
requireNonNull(input, "update-mapping RPC input must be not null!");
RpcResultBuilder<UpdateMappingOutput> rpcResultBuilder;
rpcResultBuilder = RpcResultBuilder.success(new UpdateMappingOutputBuilder().build());
rpcResultBuilder = RpcResultBuilder.success(new UpdateMappingOutputBuilder().build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
rpcResultBuilder = RpcResultBuilder.success(new RemoveAllOperationalContentOutputBuilder().build());
rpcResultBuilder = RpcResultBuilder.success(new RemoveAllOperationalContentOutputBuilder().build());
- return Futures.immediateFuture(rpcResultBuilder.build());
+ return rpcResultBuilder.buildFuture();
return;
}
final MapRequestBuilder mrb = MapRequestUtil.prepareSMR(eid, LispAddressUtil.toRloc(getLocalAddress()));
return;
}
final MapRequestBuilder mrb = MapRequestUtil.prepareSMR(eid, LispAddressUtil.toRloc(getLocalAddress()));
- LOG.trace("Built SMR packet template (EID field will be set later): " + mrb.build().toString());
+ LOG.trace("Built SMR packet template (EID field will be set later): {}", mrb.build());
scheduler.scheduleSmrs(mrb, subscribers.iterator());
}
scheduler.scheduleSmrs(mrb, subscribers.iterator());
}
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface current = interfaces.nextElement();
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface current = interfaces.nextElement();
- LOG.trace("Interface " + current.toString());
+ LOG.trace("Interface {}", current);
if (!current.isUp() || current.isLoopback() || current.isVirtual()) {
continue;
}
if (!current.isUp() || current.isLoopback() || current.isVirtual()) {
continue;
}
while (subscribers.hasNext()) {
Subscriber subscriber = subscribers.next();
if (subscriber.timedOut()) {
while (subscribers.hasNext()) {
Subscriber subscriber = subscribers.next();
if (subscriber.timedOut()) {
- LOG.debug("Lazy removing expired subscriber entry " + subscriber.getString());
+ LOG.debug("Lazy removing expired subscriber entry {}", subscriber.getString());
subscribers.remove();
} else {
final ScheduledFuture<?> future = executor.scheduleAtFixedRate(new CancellableRunnable(
subscribers.remove();
} else {
final ScheduledFuture<?> future = executor.scheduleAtFixedRate(new CancellableRunnable(
import static java.util.Objects.requireNonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import static java.util.Objects.requireNonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
-import java.util.Arrays;
-import java.util.List;
import org.opendaylight.lispflowmapping.lisp.type.MappingData;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
import org.opendaylight.lispflowmapping.lisp.type.MappingData;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.SiteId;
public static Mapping toMapping(MappingOrigin origin, Eid key, SiteId siteId, MappingData mappingData) {
MappingRecord record = mappingData != null ? mappingData.getRecord() : null;
public static Mapping toMapping(MappingOrigin origin, Eid key, SiteId siteId, MappingData mappingData) {
MappingRecord record = mappingData != null ? mappingData.getRecord() : null;
- List<SiteId> siteIds = siteId != null ? Arrays.asList(siteId) : null;
+ Set<SiteId> siteIds = siteId != null ? Set.of(siteId) : null;
return new MappingBuilder()
.setEidUri(new EidUri(LispAddressStringifier.getURIString(key)))
.setOrigin(origin)
return new MappingBuilder()
.setEidUri(new EidUri(LispAddressStringifier.getURIString(key)))
.setOrigin(origin)
MappingRecord record = mappingData != null ? mappingData.getRecord() :
new MappingRecordBuilder().setEid(key).build();
SiteId siteId = record != null ? record.getSiteId() : null;
MappingRecord record = mappingData != null ? mappingData.getRecord() :
new MappingRecordBuilder().setEid(key).build();
SiteId siteId = record != null ? record.getSiteId() : null;
- List<SiteId> siteIds = siteId != null ? Arrays.asList(siteId) : null;
+ Set<SiteId> siteIds = siteId != null ? Set.of(siteId) : null;
return new MappingBuilder()
.setEidUri(new EidUri(LispAddressStringifier.getURIString(key)))
.setOrigin(origin)
return new MappingBuilder()
.setEidUri(new EidUri(LispAddressStringifier.getURIString(key)))
.setOrigin(origin)
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressStringifier;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
- public static List<SiteId> getSiteId(MapRegister mapRegister) {
+ public static Set<SiteId> getSiteId(MapRegister mapRegister) {
if (mapRegister.getXtrSiteIdPresent()) {
if (mapRegister.getXtrSiteIdPresent()) {
- List<SiteId> siteIds = new ArrayList<>();
- SiteId siteId = new SiteId(mapRegister.getSiteId());
- siteIds.add(siteId);
- return siteIds;
+ return Set.of(new SiteId(mapRegister.getSiteId()));
import java.util.Date;
import java.util.EnumMap;
import java.util.List;
import java.util.Date;
import java.util.EnumMap;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* This method changes the lookup policy.
*/
/**
* This method changes the lookup policy.
*/
- private static void setLookupPolicy(IMappingService.LookupPolicy policy) throws NoSuchFieldException,
+ private static void setLookupPolicy(final IMappingService.LookupPolicy policy) throws NoSuchFieldException,
IllegalAccessException {
final Field lookupPolicy = ConfigIni.class.getDeclaredField("lookupPolicy");
lookupPolicy.setAccessible(true);
IllegalAccessException {
final Field lookupPolicy = ConfigIni.class.getDeclaredField("lookupPolicy");
lookupPolicy.setAccessible(true);
final Mapping mapping = new MappingBuilder()
.setEidUri(new EidUri("ipv4:" + IPV4_DST))
.setOrigin(MappingOrigin.Southbound)
final Mapping mapping = new MappingBuilder()
.setEidUri(new EidUri("ipv4:" + IPV4_DST))
.setOrigin(MappingOrigin.Southbound)
- .setSiteId(Lists.newArrayList(SITE_ID))
+ .setSiteId(Set.of(SITE_ID))
.setMappingRecord(mappingData.getRecord()).build();
assertNull(mappingSystem.getMapping(EID_IPV4_SRC, EID_IPV4_DST));
.setMappingRecord(mappingData.getRecord()).build();
assertNull(mappingSystem.getMapping(EID_IPV4_SRC, EID_IPV4_DST));
final Mapping mapping = new MappingBuilder()
.setEidUri(new EidUri("ipv4:" + IPV4_DST))
.setOrigin(MappingOrigin.Southbound)
final Mapping mapping = new MappingBuilder()
.setEidUri(new EidUri("ipv4:" + IPV4_DST))
.setOrigin(MappingOrigin.Southbound)
- .setSiteId(Lists.newArrayList(SITE_ID))
+ .setSiteId(Set.of(SITE_ID))
.setMappingRecord(mappingRecord).build();
assertEquals(nbMappingData, mappingSystem.getMapping(EID_IPV4_SRC, EID_IPV4_DST));
.setMappingRecord(mappingRecord).build();
assertEquals(nbMappingData, mappingSystem.getMapping(EID_IPV4_SRC, EID_IPV4_DST));
- private static ServicePath getDefaultServicePath(short index) {
+ private static ServicePath getDefaultServicePath(final short index) {
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address
.service.path.ServicePathBuilder servicePathBuilder = new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder();
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address
.service.path.ServicePathBuilder servicePathBuilder = new org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.service.path.ServicePathBuilder();
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingsInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.UpdateMappingsInput;
+import org.opendaylight.yangtools.yang.common.ErrorTag;
+import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
Mockito.when(mappingSystem.getAuthenticationKey(IPV4_EID)).thenReturn(MAPPING_AUTHKEY);
// input
Mockito.when(mappingSystem.getAuthenticationKey(IPV4_EID)).thenReturn(MAPPING_AUTHKEY);
// input
- final RpcResult<Object> rpc = RpcResultBuilder.failed().withError(RpcError.ErrorType.PROTOCOL, "data-exists",
+ final RpcResult<Object> rpc = RpcResultBuilder.failed().withError(ErrorType.PROTOCOL, ErrorTag.DATA_EXISTS,
"Key already exists! Please use update-key if you want to change it.").build();
// equals() not implemented int RpcError
final RpcError error = rpc.getErrors().iterator().next();
"Key already exists! Please use update-key if you want to change it.").build();
// equals() not implemented int RpcError
final RpcError error = rpc.getErrors().iterator().next();
Mockito.when(mappingSystem.getAuthenticationKey(getKeyInput.getEid())).thenReturn(null);
final RpcResult<Object> rpc = RpcResultBuilder.failed()
Mockito.when(mappingSystem.getAuthenticationKey(getKeyInput.getEid())).thenReturn(null);
final RpcResult<Object> rpc = RpcResultBuilder.failed()
- .withError(RpcError.ErrorType.APPLICATION, "data-missing", "Key was not found in the mapping database")
+ .withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, "Key was not found in the mapping database")
.build();
final RpcError error = rpc.getErrors().iterator().next();
.build();
final RpcError error = rpc.getErrors().iterator().next();
Mockito.when(mappingSystem.getMapping(getMappingInput.getEid())).thenReturn(mappingData);
final RpcResult<GetMappingOutput> rpc = RpcResultBuilder
Mockito.when(mappingSystem.getMapping(getMappingInput.getEid())).thenReturn(mappingData);
final RpcResult<GetMappingOutput> rpc = RpcResultBuilder
- .success(new GetMappingOutputBuilder().setMappingRecord(nonBinaryMappingRecord)).build();
+ .success(new GetMappingOutputBuilder().setMappingRecord(nonBinaryMappingRecord).build()).build();
//result
final Future<RpcResult<GetMappingOutput>> result = mappingService.getMapping(getMappingInput);
//result
final Future<RpcResult<GetMappingOutput>> result = mappingService.getMapping(getMappingInput);
final GetMappingInput getMappingInput = new GetMappingInputBuilder().setEid(IPV4_EID).build();
Mockito.when(mappingSystem.getMapping(getMappingInput.getEid())).thenReturn(null);
final GetMappingInput getMappingInput = new GetMappingInputBuilder().setEid(IPV4_EID).build();
Mockito.when(mappingSystem.getMapping(getMappingInput.getEid())).thenReturn(null);
- final RpcResult<Object> rpc = RpcResultBuilder.failed().withError(RpcError.ErrorType.APPLICATION,
- "data-missing", "No mapping was found in the mapping database").build();
+ final RpcResult<Object> rpc = RpcResultBuilder.failed().withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING,
+ "No mapping was found in the mapping database").build();
final RpcError error = rpc.getErrors().iterator().next();
//result
final RpcError error = rpc.getErrors().iterator().next();
//result
Mockito.when(mappingSystem.getAuthenticationKey(IPV4_EID)).thenReturn(null);
// input
Mockito.when(mappingSystem.getAuthenticationKey(IPV4_EID)).thenReturn(null);
// input
- final RpcResult<Object> rpc = RpcResultBuilder.failed().withError(RpcError.ErrorType.PROTOCOL, "data-missing",
+ final RpcResult<Object> rpc = RpcResultBuilder.failed().withError(ErrorType.PROTOCOL, ErrorTag.DATA_MISSING,
"Key doesn't exist! Please use add-key if you want to create a new authentication key.").build();
final RpcError error = rpc.getErrors().iterator().next();
"Key doesn't exist! Please use add-key if you want to create a new authentication key.").build();
final RpcError error = rpc.getErrors().iterator().next();
import com.google.common.net.InetAddresses;
import java.net.InetAddress;
import java.net.UnknownHostException;
import com.google.common.net.InetAddresses;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
import org.junit.Test;
import org.opendaylight.lispflowmapping.lisp.type.LispMessage;
import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
.setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV4).build())
.setEidUri(new EidUri("ipv4:" + IPV4_STRING))
.setOrigin(MappingOrigin.Southbound)
.setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV4).build())
.setEidUri(new EidUri("ipv4:" + IPV4_STRING))
.setOrigin(MappingOrigin.Southbound)
- .setSiteId(Lists.newArrayList(SITE_ID));
+ .setSiteId(Set.of(SITE_ID));
final MappingBuilder mappingBuilder_2 = new MappingBuilder()
.setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV6).build())
.setEidUri(new EidUri("ipv6:" + IPV6_STRING))
.setOrigin(MappingOrigin.Southbound)
final MappingBuilder mappingBuilder_2 = new MappingBuilder()
.setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV6).build())
.setEidUri(new EidUri("ipv6:" + IPV6_STRING))
.setOrigin(MappingOrigin.Southbound)
- .setSiteId(Lists.newArrayList(SITE_ID));
+ .setSiteId(Set.of(SITE_ID));
assertEquals(Lists.newArrayList(mappingBuilder_1.build(), mappingBuilder_2.build()),
LispNotificationHelper.getMapping(getDefaultAddMapping(true)));
assertEquals(Lists.newArrayList(mappingBuilder_1.build(), mappingBuilder_2.build()),
LispNotificationHelper.getMapping(getDefaultAddMapping(true)));
- private static AddMapping getDefaultAddMapping(boolean isXtrSiteIdPresent) {
+ private static AddMapping getDefaultAddMapping(final boolean isXtrSiteIdPresent) {
final MappingRecordItem mappingRecordItem_1 = new MappingRecordItemBuilder()
.withKey(new MappingRecordItemKey(IPV4_STRING))
.setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV4).build()).build();
final MappingRecordItem mappingRecordItem_1 = new MappingRecordItemBuilder()
.withKey(new MappingRecordItemKey(IPV4_STRING))
.setMappingRecord(new MappingRecordBuilder().setEid(EID_IPV4).build()).build();
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>8.0.11</version>
+ <version>9.0.1</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
*/
package org.opendaylight.lispflowmapping.lisp.serializer.address;
*/
package org.opendaylight.lispflowmapping.lisp.serializer.address;
+import com.google.common.collect.ImmutableSet;
import java.nio.ByteBuffer;
import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
import org.opendaylight.lispflowmapping.lisp.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana.afn.safi.rev130704.AddressFamily;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.AfiListLcaf;
import org.opendaylight.lispflowmapping.lisp.type.LispCanonicalAddressFormatEnum;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana.afn.safi.rev130704.AddressFamily;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.AfiListLcaf;
@Override
protected short getLcafLength(LispAddress lispAddress) {
short totalSize = 0;
@Override
protected short getLcafLength(LispAddress lispAddress) {
short totalSize = 0;
- AfiList afiList = (((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
- .lisp.address.address.AfiList) lispAddress.getAddress()).getAfiList());
+ AfiList afiList = ((org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
+ .lisp.address.address.AfiList) lispAddress.getAddress()).getAfiList();
for (SimpleAddress address : afiList.getAddressList()) {
totalSize += SimpleAddressSerializer.getInstance().getAddressSize(address);
}
for (SimpleAddress address : afiList.getAddressList()) {
totalSize += SimpleAddressSerializer.getInstance().getAddressSize(address);
}
- private Address deserializeData(ByteBuffer buffer, short lcafLength, LispAddressSerializerContext ctx) {
- List<SimpleAddress> addresses = new ArrayList<SimpleAddress>();
- short length = lcafLength;
- while (length > 0) {
- SimpleAddress address = SimpleAddressSerializer.getInstance().deserialize(buffer, ctx);
- length -= SimpleAddressSerializer.getInstance().getAddressSize(address);
- addresses.add(address);
+ private static Address deserializeData(ByteBuffer buffer, short lcafLength, LispAddressSerializerContext ctx) {
+ final Set<SimpleAddress> addresses;
+ if (lcafLength > 0) {
+ ImmutableSet.Builder<SimpleAddress> builder = ImmutableSet.builderWithExpectedSize(lcafLength);
+ short length = lcafLength;
+ while (length > 0) {
+ SimpleAddress address = SimpleAddressSerializer.getInstance().deserialize(buffer, ctx);
+ length -= SimpleAddressSerializer.getInstance().getAddressSize(address);
+ builder.add(address);
+ }
+ addresses = builder.build();
+ } else {
+ addresses = Set.of();
return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp
.address.address.AfiListBuilder().setAfiList(new AfiListBuilder().setAddressList(addresses).build())
.build();
return new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp
.address.address.AfiListBuilder().setAfiList(new AfiListBuilder().setAddressList(addresses).build())
.build();
EidBuilder eb = new EidBuilder();
eb.setAddressType(NoAddressAfi.class);
eb.setVirtualNetworkId(getVni(ctx));
EidBuilder eb = new EidBuilder();
eb.setAddressType(NoAddressAfi.class);
eb.setVirtualNetworkId(getVni(ctx));
- eb.setAddress(new NoAddressBuilder().setNoAddress(Empty.getInstance()).build());
+ eb.setAddress(new NoAddressBuilder().setNoAddress(Empty.value()).build());
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(NoAddressAfi.class);
rb.setVirtualNetworkId(null);
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(NoAddressAfi.class);
rb.setVirtualNetworkId(null);
- rb.setAddress(new NoAddressBuilder().setNoAddress(Empty.getInstance()).build());
+ rb.setAddress(new NoAddressBuilder().setNoAddress(Empty.value()).build());
// AFI 16387, LCAF Type 1; Address List
// Example rendering:
// {192.0.2.1,192.0.2.2,2001:db8::1}
// AFI 16387, LCAF Type 1; Address List
// Example rendering:
// {192.0.2.1,192.0.2.2,2001:db8::1}
- List<SimpleAddress> addresses = addr.getAfiList().getAddressList();
StringBuilder sb = new StringBuilder("{");
boolean needComma = false;
StringBuilder sb = new StringBuilder("{");
boolean needComma = false;
- for (SimpleAddress a : addresses) {
+ for (SimpleAddress a : addr.getAfiList().getAddressList()) {
if (needComma) {
sb.append(",");
}
if (needComma) {
sb.append(",");
}
EidBuilder builder = new EidBuilder();
builder.setAddressType(NoAddressAfi.class);
builder.setVirtualNetworkId(null);
EidBuilder builder = new EidBuilder();
builder.setAddressType(NoAddressAfi.class);
builder.setVirtualNetworkId(null);
- builder.setAddress(new NoAddressBuilder().setNoAddress(Empty.getInstance()).build());
+ builder.setAddress(new NoAddressBuilder().setNoAddress(Empty.value()).build());
return builder.build();
}
return builder.build();
}
import com.google.common.io.BaseEncoding;
import java.util.ArrayList;
import com.google.common.io.BaseEncoding;
import java.util.ArrayList;
+import java.util.LinkedHashSet;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
private static final LispAddress LISP_AS_NUMBER = new EidBuilder().setAddress(AS_NUMBER_LISP_TYPE).build();
// NoAddress
private static final LispAddress LISP_AS_NUMBER = new EidBuilder().setAddress(AS_NUMBER_LISP_TYPE).build();
// NoAddress
- private static final NoAddress NO_ADDRESS = new NoAddressBuilder().setNoAddress(Empty.getInstance()).build();
+ private static final NoAddress NO_ADDRESS = new NoAddressBuilder().setNoAddress(Empty.value()).build();
private static final LispAddress LISP_NO_ADDRESS = new EidBuilder().setAddress(NO_ADDRESS).build();
// AfiList
private static final SimpleAddress SIMPLE_ADDRESS_1 = new SimpleAddress(new IpAddress(IPV4_ADDRESS));
private static final SimpleAddress SIMPLE_ADDRESS_2 = new SimpleAddress(new IpAddress(IPV6_ADDRESS));
private static final LispAddress LISP_NO_ADDRESS = new EidBuilder().setAddress(NO_ADDRESS).build();
// AfiList
private static final SimpleAddress SIMPLE_ADDRESS_1 = new SimpleAddress(new IpAddress(IPV4_ADDRESS));
private static final SimpleAddress SIMPLE_ADDRESS_2 = new SimpleAddress(new IpAddress(IPV6_ADDRESS));
- private static final List<SimpleAddress> ADDRESS_LIST = new ArrayList<>();
+ // FIXME: this is ugly as hell, this Set should be immutable
+ private static final Set<SimpleAddress> ADDRESS_LIST = new LinkedHashSet<>();
private static final AfiList AFI_LIST = new AfiListBuilder().setAfiList(new org.opendaylight.yang.gen.v1.urn.ietf
.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.afi.list.AfiListBuilder()
.setAddressList(ADDRESS_LIST).build()).build();
private static final AfiList AFI_LIST = new AfiListBuilder().setAfiList(new org.opendaylight.yang.gen.v1.urn.ietf
.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.afi.list.AfiListBuilder()
.setAddressList(ADDRESS_LIST).build()).build();
final Eid noAddressEid = LispAddressUtil.getNoAddressEid();
assertEquals(NoAddressAfi.class, noAddressEid.getAddressType());
assertNull(noAddressEid.getVirtualNetworkId());
final Eid noAddressEid = LispAddressUtil.getNoAddressEid();
assertEquals(NoAddressAfi.class, noAddressEid.getAddressType());
assertNull(noAddressEid.getVirtualNetworkId());
- assertEquals(((NoAddress) noAddressEid.getAddress()).getNoAddress(), Empty.getInstance());
+ assertEquals(((NoAddress) noAddressEid.getAddress()).getNoAddress(), Empty.value());
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
+import com.google.common.collect.ImmutableSet;
import java.nio.ByteBuffer;
import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Iterator;
+import java.util.Set;
import junitx.framework.ArrayAssert;
import junitx.framework.Assert;
import org.junit.Test;
import junitx.framework.ArrayAssert;
import junitx.framework.Assert;
import org.junit.Test;
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
- List<SimpleAddress> addressList = afiList.getAfiList().getAddressList();
+ Set<SimpleAddress> addressList = afiList.getAfiList().getAddressList();
assertEquals(2, addressList.size());
assertEquals(2, addressList.size());
- assertEquals("170.187.204.221", addressList.get(0).stringValue());
- assertEquals("1122:3344:1122:3344:1122:3344:1122:3344", addressList.get(1).stringValue());
+ Iterator<SimpleAddress> it = addressList.iterator();
+ assertEquals("170.187.204.221", it.next().stringValue());
+ assertEquals("1122:3344:1122:3344:1122:3344:1122:3344", it.next().stringValue());
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
- List<SimpleAddress> addressList = afiList.getAfiList().getAddressList();
- assertEquals(0, addressList.size());
+ assertEquals(Set.of(), afiList.getAfiList().getAddressList());
}
@Test(expected = LispSerializationException.class)
}
@Test(expected = LispSerializationException.class)
@Test
public void serialize__Simple() throws Exception {
AfiListBuilder listBuilder = new AfiListBuilder();
@Test
public void serialize__Simple() throws Exception {
AfiListBuilder listBuilder = new AfiListBuilder();
- List<SimpleAddress> addressList = new ArrayList<>();
- addressList.add(SimpleAddressBuilder.getDefaultInstance("170.187.204.221"));
- addressList.add(SimpleAddressBuilder.getDefaultInstance("1122:3344:1122:3344:1122:3344:1122:3344"));
- listBuilder.setAddressList(addressList);
+ listBuilder.setAddressList(ImmutableSet.of(
+ SimpleAddressBuilder.getDefaultInstance("170.187.204.221"),
+ SimpleAddressBuilder.getDefaultInstance("1122:3344:1122:3344:1122:3344:1122:3344")));
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(AfiListLcaf.class);
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(AfiListLcaf.class);
@Test
public void serialize__NoAddresses() throws Exception {
AfiListBuilder listBuilder = new AfiListBuilder();
@Test
public void serialize__NoAddresses() throws Exception {
AfiListBuilder listBuilder = new AfiListBuilder();
- List<SimpleAddress> addressList = new ArrayList<>();
- listBuilder.setAddressList(addressList);
+ listBuilder.setAddressList(Set.of());
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(AfiListLcaf.class);
RlocBuilder rb = new RlocBuilder();
rb.setAddressType(AfiListLcaf.class);
final SimpleAddress ip1 = SimpleAddressBuilder.getDefaultInstance("0:0:0:0:0:0:0:1");
final SimpleAddress ip2 = SimpleAddressBuilder.getDefaultInstance("0:0:0:0:0:0:0:2");
final SimpleAddress ip1 = SimpleAddressBuilder.getDefaultInstance("0:0:0:0:0:0:0:1");
final SimpleAddress ip2 = SimpleAddressBuilder.getDefaultInstance("0:0:0:0:0:0:0:2");
- AfiListBuilder listBuilder = new AfiListBuilder().setAddressList(new ArrayList<SimpleAddress>());
+ AfiListBuilder listBuilder = new AfiListBuilder().setAddressList(Set.of(ip1));
- listBuilder.getAddressList().add(ip1);
final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
.lisp.address.address.afi.list.AfiList address1 = listBuilder.build();
final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
.lisp.address.address.afi.list.AfiList address1 = listBuilder.build();
- listBuilder.setAddressList(new ArrayList<SimpleAddress>());
- listBuilder.getAddressList().add(ip1);
+ listBuilder.setAddressList(Set.of(ip1));
final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
.lisp.address.address.afi.list.AfiList address2 = listBuilder.build();
final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
.lisp.address.address.afi.list.AfiList address2 = listBuilder.build();
- listBuilder.setAddressList(new ArrayList<SimpleAddress>());
- listBuilder.getAddressList().add(ip2);
+ listBuilder.setAddressList(Set.of(ip2));
final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
.lisp.address.address.afi.list.AfiList address3 = listBuilder.build();
final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105
.lisp.address.address.afi.list.AfiList address3 = listBuilder.build();
+ "00 11 64 61 76 69 64 00"), null);
assertEquals(AfiListLcaf.class, address.getAddressType());
+ "00 11 64 61 76 69 64 00"), null);
assertEquals(AfiListLcaf.class, address.getAddressType());
- assertEquals("david", ((AfiList) address.getAddress()).getAfiList().getAddressList().get(0)
+ assertEquals("david", ((AfiList) address.getAddress()).getAfiList().getAddressList().iterator().next()
.getDistinguishedNameType().getValue());
}
.getDistinguishedNameType().getValue());
}
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.when;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mockito;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.dao.MappingEntry;
import org.opendaylight.lispflowmapping.interfaces.dao.SubKeys;
import org.opendaylight.lispflowmapping.interfaces.dao.ILispDAO;
import org.opendaylight.lispflowmapping.interfaces.dao.MappingEntry;
import org.opendaylight.lispflowmapping.interfaces.dao.SubKeys;
when(daoMock.getSpecific(VNI, SubKeys.VNI)).thenReturn(null);
multiTableMapCache.removeMapping(EID_SOURCE_DEST_KEY_TYPE);
when(daoMock.getSpecific(VNI, SubKeys.VNI)).thenReturn(null);
multiTableMapCache.removeMapping(EID_SOURCE_DEST_KEY_TYPE);
- verifyZeroInteractions(tableDaoMock);
- verifyZeroInteractions(dbMock);
+ verifyNoInteractions(tableDaoMock);
+ verifyNoInteractions(dbMock);
when(daoMock.getSpecific(VNI, SubKeys.VNI)).thenReturn(null);
multiTableMapCache.removeData(EID_TEST, SubKeys.RECORD);
when(daoMock.getSpecific(VNI, SubKeys.VNI)).thenReturn(null);
multiTableMapCache.removeData(EID_TEST, SubKeys.RECORD);
- Mockito.verifyZeroInteractions(tableDaoMock);
+ verifyNoInteractions(tableDaoMock);
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>9.0.13</version>
+ <version>10.0.0</version>
<relativePath/>
</parent>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>8.0.11</version>
+ <version>9.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
+ <artifactId>org.osgi.framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
+ <artifactId>org.osgi.framework</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.ctrl.msg.stats.ControlMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.get.stats.output.ControlMessageStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.get.stats.output.MapRegisterCacheStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.ctrl.msg.stats.ControlMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.get.stats.output.ControlMessageStatsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.get.stats.output.MapRegisterCacheStatsBuilder;
-import org.opendaylight.yangtools.yang.common.RpcError;
+import org.opendaylight.yangtools.yang.common.ErrorTag;
+import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
if (stats == null) {
rpcResultBuilder = RpcResultBuilder.<GetStatsOutput>failed()
if (stats == null) {
rpcResultBuilder = RpcResultBuilder.<GetStatsOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, "data-missing", "No stats found");
+ .withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, "No stats found");
} else {
rpcResultBuilder = RpcResultBuilder.success(createGetStatsOutput(stats));
}
} else {
rpcResultBuilder = RpcResultBuilder.success(createGetStatsOutput(stats));
}
if (stats == null) {
return Futures.immediateFuture(RpcResultBuilder.<ResetStatsOutput>failed()
if (stats == null) {
return Futures.immediateFuture(RpcResultBuilder.<ResetStatsOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, "data-missing", "No stats found")
+ .withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, "No stats found")
.build());
} else {
stats.resetStats();
.build());
} else {
stats.resetStats();
injectField("bootstrap", BOOTSTRAP_MOCK);
lispSouthboundPlugin.setLispAddress(ADDRESS_1);
injectField("bootstrap", BOOTSTRAP_MOCK);
lispSouthboundPlugin.setLispAddress(ADDRESS_1);
- Mockito.verifyZeroInteractions(BOOTSTRAP_MOCK);
- Mockito.verifyZeroInteractions(channel);
+ Mockito.verifyNoInteractions(BOOTSTRAP_MOCK);
+ Mockito.verifyNoInteractions(channel);
public void shouldListenOnXtrPortTest_false() throws NoSuchFieldException, IllegalAccessException {
lispSouthboundPlugin.shouldListenOnXtrPort(false);
public void shouldListenOnXtrPortTest_false() throws NoSuchFieldException, IllegalAccessException {
lispSouthboundPlugin.shouldListenOnXtrPort(false);
- Mockito.verifyZeroInteractions(xtrChannel);
+ Mockito.verifyNoInteractions(xtrChannel);
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.get.stats.output.ControlMessageStats;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapReplyInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.SendMapRequestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.get.stats.output.ControlMessageStats;
+import org.opendaylight.yangtools.yang.common.ErrorTag;
+import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
private static final RpcResult<Void> RPC_RESULT_FAILURE = RpcResultBuilder.<Void>failed().build();
private static final RpcResult<Void> RPC_RESULT_SUCCESS = RpcResultBuilder.<Void>success().build();
private static final RpcResult<GetStatsOutput> RPC_RESULT_ERROR = RpcResultBuilder.<GetStatsOutput>failed()
private static final RpcResult<Void> RPC_RESULT_FAILURE = RpcResultBuilder.<Void>failed().build();
private static final RpcResult<Void> RPC_RESULT_SUCCESS = RpcResultBuilder.<Void>success().build();
private static final RpcResult<GetStatsOutput> RPC_RESULT_ERROR = RpcResultBuilder.<GetStatsOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, "data-missing", "No stats found").build();
+ .withError(ErrorType.APPLICATION, ErrorTag.DATA_MISSING, "No stats found").build();
/**
* Tests {@link LispSouthboundRPC#sendMapNotify} method.
/**
* Tests {@link LispSouthboundRPC#sendMapNotify} method.
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapNotify(null).get().isSuccessful());
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapNotify(null).get().isSuccessful());
- Mockito.verifyZeroInteractions(lispSouthboundPlugin);
+ Mockito.verifyNoInteractions(lispSouthboundPlugin);
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapReply(null).get().isSuccessful());
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapReply(null).get().isSuccessful());
- Mockito.verifyZeroInteractions(lispSouthboundPlugin);
+ Mockito.verifyNoInteractions(lispSouthboundPlugin);
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapRequest(null).get().isSuccessful());
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapRequest(null).get().isSuccessful());
- Mockito.verifyZeroInteractions(lispSouthboundPlugin);
+ Mockito.verifyNoInteractions(lispSouthboundPlugin);
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapRegister(null).get().isSuccessful());
assertEquals(RPC_RESULT_FAILURE.isSuccessful(),
lispSouthboundRPC.sendMapRegister(null).get().isSuccessful());
- Mockito.verifyZeroInteractions(lispSouthboundPlugin);
+ Mockito.verifyNoInteractions(lispSouthboundPlugin);
Mockito.when(mod_nullModType.getModificationType()).thenReturn(null);
authenticationKeyDataListener.onDataTreeChanged(Lists.newArrayList(change_nullModType));
Mockito.when(mod_nullModType.getModificationType()).thenReturn(null);
authenticationKeyDataListener.onDataTreeChanged(Lists.newArrayList(change_nullModType));
- Mockito.verifyZeroInteractions(akdbMock);
+ Mockito.verifyNoInteractions(akdbMock);