Prevent new code from using the DataBroker 04/70704/4
authorStephen Kitt <skitt@redhat.com>
Tue, 10 Apr 2018 11:35:53 +0000 (13:35 +0200)
committerSam Hague <shague@redhat.com>
Tue, 1 May 2018 00:45:29 +0000 (00:45 +0000)
commit61f953a58d181ec1afa1ac3205785443ad21e787
tree307407a58943aa93d465807624a7dafdcbf5d4b3
parent23f38082e9abc62575408316d9e2deccb4ad9651
Prevent new code from using the DataBroker

This introduces a new Checkstyle check to fail the build if code
*calls* the newReadWriteTransaction or newWriteOnlyTransaction methods
in DataBroker. I haven’t found a nice way to make this check
conditional, so for now it’s added via a new parent module,
managed-tx-parent, which is used instead of binding-parent in all
modules which currently support it.

This patch is self-contained, but the plan is to move the Checkstyle
implementation to infrautils and the Checkstyle configuration to
Genius or MD-SAL, alongside ManagedNewTransactionRunner. Once all the
existing code has been converted to use only
ManagedNewTransactionRunner, we’ll be able to apply the configuration
to binding-parent and do away with managed-tx-parent.

Change-Id: I27ab7f0744477606bae04bff31a2148134038bb8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
39 files changed:
aclservice/api/pom.xml
aclservice/impl/pom.xml
aclservice/shell/pom.xml
alarm/impl/pom.xml
bgpmanager/api/pom.xml
bgpmanager/impl/pom.xml
cache/impl/pom.xml
cloud-servicechain/api/pom.xml
cloud-servicechain/impl/pom.xml
coe/api/pom.xml
coe/impl/pom.xml
commons/checkstyle/pom.xml [new file with mode: 0644]
commons/checkstyle/src/main/java/org/opendaylight/netvirt/checkstyle/ForbiddenMethodCheck.java [new file with mode: 0644]
commons/checkstyle/src/main/resources/databroker-checks.xml [new file with mode: 0644]
commons/managed-tx-parent/pom.xml [new file with mode: 0644]
commons/pom.xml
dhcpservice/api/pom.xml
dhcpservice/impl/pom.xml
dhcpservice/shell/pom.xml
elanmanager/api/pom.xml
fibmanager/api/pom.xml
fibmanager/shell/pom.xml
ipv6service/api/pom.xml
ipv6service/impl/pom.xml
ipv6service/shell/pom.xml
model-bgp/pom.xml
natservice/api/pom.xml
neutronvpn/api/pom.xml
neutronvpn/shell/pom.xml
policyservice/api/pom.xml
policyservice/impl/pom.xml
qosservice/api/pom.xml
sfc/classifier/api/pom.xml
sfc/classifier/impl/pom.xml
sfc/translator/pom.xml
statemanager/impl/pom.xml
statistics/api/pom.xml
vpnmanager/api/pom.xml
vpnmanager/shell/pom.xml