use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class TransactionProvider method abortTestTransaction.
public synchronized void abortTestTransaction(final ObjectName testTx) {
LOG.debug("Aborting transaction {}", testTx);
ConfigTransactionClient transactionClient = configRegistryClient.getConfigTransactionClient(testTx);
allOpenedTransactions.remove(testTx);
transactionClient.abortConfig();
}
use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class TransactionProvider method validateTestTransaction.
public void validateTestTransaction(final ObjectName taON) throws ValidationException {
ConfigTransactionClient transactionClient = configRegistryClient.getConfigTransactionClient(taON);
transactionClient.validateConfig();
}
use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class TransactionProvider method wipeInternal.
/**
* Wiping means removing all module instances keeping the transaction open +
* service references.
*/
synchronized void wipeInternal(final ObjectName taON, final boolean isTest) {
ConfigTransactionClient transactionClient = configRegistryClient.getConfigTransactionClient(taON);
Set<ObjectName> lookupConfigBeans = transactionClient.lookupConfigBeans();
int index = lookupConfigBeans.size();
for (ObjectName instance : lookupConfigBeans) {
try {
transactionClient.destroyModule(instance);
} catch (final InstanceNotFoundException e) {
if (isTest) {
LOG.debug("Unable to clean configuration in transactiom {}", taON, e);
} else {
LOG.warn("Unable to clean configuration in transactiom {}", taON, e);
}
throw new IllegalStateException("Unable to clean configuration in transactiom " + taON, e);
}
}
LOG.debug("Transaction {} wiped clean of {} config beans", taON, index);
transactionClient.removeAllServiceReferences();
LOG.debug("Transaction {} wiped clean of all service references", taON);
}
Aggregations