<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>aclservice-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>aclservice-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>aclservice-shell</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>alarm-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>bgpmanager-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>bgpmanager-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>cache-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>cloud-servicechain-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>cloud-servicechain-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>coe-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>coe-impl</artifactId>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2018 Red Hat, Inc. and others.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>odlparent</artifactId>
+ <version>3.0.2</version>
+ </parent>
+
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <name>ODL :: netvirt :: ${project.artifactId}</name>
+ <modelVersion>4.0.0</modelVersion>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.puppycrawl.tools</groupId>
+ <artifactId>checkstyle</artifactId>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © 2018 Red Hat, Inc. and others.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.netvirt.checkstyle;
+
+import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
+import com.puppycrawl.tools.checkstyle.api.DetailAST;
+import com.puppycrawl.tools.checkstyle.api.TokenTypes;
+import java.util.Objects;
+
+public class ForbiddenMethodCheck extends AbstractCheck {
+ private String methodName;
+
+ public void setMethodName(String methodName) {
+ this.methodName = methodName;
+ }
+
+ public int[] getDefaultTokens() {
+ return new int[] {TokenTypes.METHOD_CALL};
+ }
+
+ public int[] getAcceptableTokens() {
+ return new int[0];
+ }
+
+ public int[] getRequiredTokens() {
+ return new int[0];
+ }
+
+ @Override
+ public void visitToken(DetailAST ast) {
+ // Method calls appear in the AST as DOT with two children IDENTs; the second one is the one we're after
+ DetailAST dot = ast.findFirstToken(TokenTypes.DOT);
+ if (dot != null) {
+ DetailAST target = dot.findFirstToken(TokenTypes.IDENT);
+ if (target != null) {
+ DetailAST method = target.getNextSibling();
+ if (method != null && Objects.equals(methodName, method.getText())) {
+ log(ast.getLineNo(), "method " + methodName + " must not be called");
+ }
+ }
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0"?>
+<!--
+Copyright © 2018 Red Hat, Inc. and others.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<!DOCTYPE module PUBLIC
+ "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+ "http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
+<module name="Checker">
+ <module name="TreeWalker">
+ <module name="org.opendaylight.netvirt.checkstyle.ForbiddenMethodCheck">
+ <property name="methodName" value="newWriteOnlyTransaction" />
+ </module>
+ <module name="org.opendaylight.netvirt.checkstyle.ForbiddenMethodCheck">
+ <property name="methodName" value="newReadWriteTransaction" />
+ </module>
+ </module>
+</module>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2018 Red Hat, Inc. and others.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <relativePath>../binding-parent</relativePath>
+ </parent>
+
+ <!-- This is a temporary parent, enforcing checks against the use of unmanaged transactions.
+ Once all of NetVirt can enforce this, the configuration will be merged into binding-parent. -->
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>managed-tx-parent</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <name>ODL :: netvirt :: ${project.artifactId}</name>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>pom</packaging>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>checkstyle</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>check-databroker</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <phase>process-sources</phase>
+ <configuration>
+ <configLocation>databroker-checks.xml</configLocation>
+ <includeResources>false</includeResources>
+ <includeTestSourceDirectory>false</includeTestSourceDirectory>
+ <includeTestResources>false</includeTestResources>
+ <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+ <failsOnError>true</failsOnError>
+ <consoleOutput>true</consoleOutput>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2016 Red hat, Inc. and others. All rights reserved.
+Copyright © 2016, 2018 Red Hat, Inc. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
<modules>
<module>binding-parent</module>
+ <module>checkstyle</module>
+ <module>managed-tx-parent</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>dhcpservice-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>dhcpservice-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>dhcpservice-shell</artifactId>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>elanmanager-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>fibmanager-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>fibmanager-shell</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>ipv6service-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>ipv6service-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>ipv6service-shell</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../commons/binding-parent</relativePath>
+ <relativePath>../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>model-bgp</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>natservice-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>neutronvpn-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>neutronvpn-shell</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>policyservice-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>policyservice-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>qosservice-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../../commons/binding-parent</relativePath>
+ <relativePath>../../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>sfc.classifier-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../../commons/binding-parent</relativePath>
+ <relativePath>../../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>sfc.classifier-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>sfc.translator</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>statemanager-impl</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>statistics-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>vpnmanager-api</artifactId>
<parent>
<groupId>org.opendaylight.netvirt</groupId>
- <artifactId>binding-parent</artifactId>
+ <artifactId>managed-tx-parent</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <relativePath>../../commons/binding-parent</relativePath>
+ <relativePath>../../commons/managed-tx-parent</relativePath>
</parent>
<artifactId>vpnmanager-shell</artifactId>