<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>6.0.5</version>
+ <version>7.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>2.0.4</version>
+ <version>3.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.1" name="odl-neutron-model-${project.version}">
<feature name="odl-neutron-model" version="${project.version}">
- <feature version="[6,7)">odl-mdsal-model-rfc6991</feature>
+ <feature version="[7,8)">odl-mdsal-model-rfc6991</feature>
</feature>
</features>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.1" name="odl-neutron-spi-${project.version}">
<feature name="odl-neutron-spi" version="${project.version}">
- <feature version="[7,8)">odl-apache-commons-net</feature>
- <feature version="[2,3)">odl-mdsal-broker</feature>
+ <feature version="[8,9)">odl-apache-commons-net</feature>
+ <feature version="[3,4)">odl-mdsal-broker</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>6.0.5</version>
+ <version>7.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
}
+ // TODO: Java 11+ has HttpClient, we should be using that instead
static HttpURLConnection httpURLConnectionFactoryGet(URL url) throws IOException {
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
httpConn.setRequestMethod("GET");
}
private static String fetchResponse(String urlStr, String context) {
- StringBuffer response = new StringBuffer();
+ StringBuilder response = new StringBuilder();
try {
URL url = new URL(urlStr);
<parent>
<groupId>org.opendaylight.controller</groupId>
<artifactId>mdsal-it-parent</artifactId>
- <version>2.0.4</version>
+ <version>3.0.0</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>7.0.6</version>
+ <version>8.0.0</version>
<relativePath/>
</parent>
*/
package org.opendaylight.neutron.hostconfig.vpp;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
+import static java.util.Objects.requireNonNull;
+
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.util.HashMap;
private static final String VNIC_TYPE = "normal";
private static final String HAS_DATAPATH_TYPE_NETDEV = "False";
private static final String SUPPORT_VHOST_USER = "True";
- private static final List<String> SUPPORTED_NET_TYPES = Lists.newArrayList("local", "vlan", "vxlan", "gre");
+ private static final List<String> SUPPORTED_NET_TYPES = List.of("local", "vlan", "vxlan", "gre");
private HostconfigUtil() {
}
public static Map<String, String> createHostconfigsDataFor(NodeId nodeId, SocketInfo socketInfo) {
- Preconditions.checkNotNull(nodeId);
- Preconditions.checkNotNull(socketInfo);
+ requireNonNull(nodeId);
+ requireNonNull(socketInfo);
JsonObject odlL2 = new JsonObject();
odlL2.add("allowed_network_types", buildSupportedNetworkTypes());
odlL2.add("supported_vnic_types", buildSupportedVnicTypes(socketInfo));
*/
package org.opendaylight.neutron.hostconfig.vpp;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.base.Preconditions;
import java.net.URI;
import java.util.ArrayList;
private static final List<QName> REQUIRED_CAPABILITIES = new ArrayList<>();
private final SocketInfo socketInfo;
- public NeutronHostconfigVppListener(final DataBroker dataBroker, String spath, String sname, String vhostMode) {
+ public NeutronHostconfigVppListener(final DataBroker dataBroker, final String spath, final String sname,
+ final String vhostMode) {
LOG.info("Initializing Neutron-Hostconfig-Vpp-Listener");
- this.dataBroker = Preconditions.checkNotNull(dataBroker);
- final String vhostModeChecked = Preconditions.checkNotNull(vhostMode).toLowerCase(Locale.ROOT);
+ this.dataBroker = requireNonNull(dataBroker);
+ final String vhostModeChecked = requireNonNull(vhostMode).toLowerCase(Locale.ROOT);
Preconditions.checkArgument(vhostModeChecked.equals("server") || vhostModeChecked.equals("client"),
"Supported values for vhostuser-mode are client and server.");
- this.socketInfo =
- new SocketInfo(Preconditions.checkNotNull(spath), Preconditions.checkNotNull(sname), vhostModeChecked);
+ this.socketInfo = new SocketInfo(spath, sname, vhostModeChecked);
this.neutronHostconfig = new NeutronHostconfigUtils(dataBroker);
REQUIRED_CAPABILITIES.add(V3PO_1704_CAPABILITY);
REQUIRED_CAPABILITIES.add(V3PO_1701_CAPABILITY);
}
@Override
- public void onDataTreeChanged(@NonNull Collection<DataTreeModification<Node>> changes) {
+ public void onDataTreeChanged(@NonNull final Collection<DataTreeModification<Node>> changes) {
LOG.info("onDataTreeChanged: Received Data Tree Changes: {}", changes);
executorService.execute(() -> {
try {
- for (DataTreeModification<Node> change : Preconditions.checkNotNull(changes,
- "Changes may not be null!")) {
+ for (DataTreeModification<Node> change : requireNonNull(changes, "Changes may not be null!")) {
processDataTreeModification(change);
}
} catch (TransactionCommitFailedException e) {
});
}
- private void processDataTreeModification(DataTreeModification<Node> change)
+ private void processDataTreeModification(final DataTreeModification<Node> change)
throws TransactionCommitFailedException {
final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
final DataObjectModification<Node> mod = change.getRootNode();
LOG.info("Registered listener to netconf nodes {}.", dataTreeIdentifier.getRootIdentifier());
}
- private void updateHostConfig(Node node, NeutronHostconfigUtils.Action action)
+ private void updateHostConfig(final Node node, final NeutronHostconfigUtils.Action action)
throws TransactionCommitFailedException {
for (Map.Entry<String, String> entry : HostconfigUtil.createHostconfigsDataFor(node.getNodeId(), socketInfo)
.entrySet()) {
}
}
- private static boolean validateVppNode(Node node) {
+ private static boolean validateVppNode(final Node node) {
LOG.info("Registering new node {}", node.getNodeId().getValue());
NetconfNode netconfNode = node.augmentation(NetconfNode.class);
if (netconfNode == null) {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.neutron.hostconfig.vpp;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
public class SocketInfo {
private static final String PORT_ID = "$PORT_ID";
public SocketInfo(String socketPath, String socketPrefix, String vhostuserMode) {
- this.socketPath = Preconditions.checkNotNull(socketPath);
- this.socketPrefix = Preconditions.checkNotNull(socketPrefix);
- this.vhostuserMode = Preconditions.checkNotNull(vhostuserMode);
+ this.socketPath = requireNonNull(socketPath);
+ this.socketPrefix = requireNonNull(socketPrefix);
+ this.vhostuserMode = requireNonNull(vhostuserMode);
}
public String getSocketPath() {
*/
package org.opendaylight.neutron.logger;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import java.util.Collection;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
@Inject
public NeutronLogger(@NonNull DataBroker db) {
LOG.info("Creating NeutronLogger {}", db);
- this.db = Preconditions.checkNotNull(db, "null db");
+ this.db = requireNonNull(db, "null db");
}
private <T extends DataObject> void formatModification(@NonNull final StringBuilder messageBuilder,
@PostConstruct
public void init() {
LOG.info("Register listener for Neutron model data changes");
- InstanceIdentifier<Neutron> instanceId = Preconditions.checkNotNull(InstanceIdentifier.create(Neutron.class));
+ InstanceIdentifier<Neutron> instanceId = InstanceIdentifier.create(Neutron.class);
DataTreeIdentifier<Neutron> configurationDataTreeId = DataTreeIdentifier.create(
LogicalDatastoreType.CONFIGURATION, instanceId);
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.neutron.spi;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.base.Preconditions;
import java.io.Serializable;
import java.util.regex.Pattern;
String uuid;
private static void checkUuidPattern(String uuid) {
- Preconditions.checkNotNull(uuid, "Supplied value may not be null");
- Preconditions.checkArgument(UUID_PATTERN.matcher(uuid).matches(),
+ Preconditions.checkArgument(
+ UUID_PATTERN.matcher(requireNonNull(uuid, "Supplied value may not be null")).matches(),
"Supplied value \"%s\" does not match uuid pattern \"%s\"", uuid, UUID_PATTERN_REGEX);
}
build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: neutron :: ${project.artifactId}</name>
+ <properties>
+ <!-- FIXME: Remove this -->
+ <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
+ </properties>
+
<dependencyManagement>
<dependencies>
<dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>6.0.5</version>
+ <version>7.0.0</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.infrautils</groupId>
<artifactId>infrautils-artifacts</artifactId>
- <version>1.8.1</version>
+ <version>1.9.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>controller-artifacts</artifactId>
- <version>2.0.4</version>
+ <version>3.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
- <!-- This is the same version (of EclipseLink) currently used in odlparent (4.0.6);
- we just have to repeat it here because, apparently, Maven is too dumb to inherit
- the version from a dependencyManagement in a parent POM to the dependencyManagement here.
- (The alternative to repeat the exclusion below in each Neutron project is much worse.) -->
<version>2.7.5</version>
<exclusions>
<exclusion>
<!-- do not touch this version, see above -->
<version>1.0.4</version>
</dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.1.0.Final</version>
+ </dependency>
</dependencies>
</dependencyManagement>