use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class ConfigSubsystemFacade method set.
private void set(final ConfigExecution configExecution) throws DocumentedException {
ObjectName taON = transactionProvider.getOrCreateTransaction();
// default strategy = replace wipes config
if (configExecution.getDefaultStrategy() == EditStrategyType.replace) {
transactionProvider.wipeTransaction();
}
ConfigTransactionClient ta = configRegistryClient.getConfigTransactionClient(taON);
handleMisssingInstancesOnTransaction(ta, configExecution);
setServicesOnTransaction(ta, configExecution);
setOnTransaction(ta, configExecution);
}
use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class CandidateDatastoreQueryStrategy method queryInstances.
@Override
public Set<ObjectName> queryInstances(final ConfigRegistryClient configRegistryClient) {
ObjectName on = transactionProvider.getOrCreateTransaction();
ConfigTransactionClient proxy = configRegistryClient.getConfigTransactionClient(on);
return proxy.lookupConfigBeans();
}
use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class ConfigSubsystemFacade method test.
private void test(final ConfigExecution execution, final EditStrategyType editStrategyType) throws ValidationException, DocumentedException {
ObjectName taON = transactionProvider.getTestTransaction();
try {
// default strategy = replace wipes config
if (editStrategyType == EditStrategyType.replace) {
transactionProvider.wipeTestTransaction(taON);
}
ConfigTransactionClient ta = configRegistryClient.getConfigTransactionClient(taON);
handleMisssingInstancesOnTransaction(ta, execution);
setServicesOnTransaction(ta, execution);
setOnTransaction(ta, execution);
transactionProvider.validateTestTransaction(taON);
} finally {
transactionProvider.abortTestTransaction(taON);
}
}
use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class ConfigSubsystemFacade method get.
public Element get(final Document document) throws DocumentedException {
final ObjectName testTransaction = transactionProvider.getOrCreateReadTransaction();
final ConfigTransactionClient txClient = configRegistryClient.getConfigTransactionClient(testTransaction);
try {
// Runtime beans are not parts of transactions and have to be queried against
// the central registry
final Set<ObjectName> runtimeBeans = configRegistryClient.lookupRuntimeBeans();
final Set<ObjectName> configBeans = Datastore.getInstanceQueryStrategy(Datastore.running, transactionProvider).queryInstances(configRegistryClient);
final Map<String, Map<String, ModuleRuntime>> moduleRuntimes = createModuleRuntimes(configRegistryClient, yangStoreService.getModuleMXBeanEntryMap());
final YangStoreContext yangStoreSnapshot = yangStoreService.getCurrentSnapshot();
final Map<String, Map<String, ModuleConfig>> moduleConfigs = transformMbeToModuleConfigs(txClient, yangStoreSnapshot.getModuleMXBeanEntryMap());
final org.opendaylight.controller.config.facade.xml.runtime.Runtime runtime = new Runtime(moduleRuntimes, moduleConfigs);
return runtime.toXml(runtimeBeans, configBeans, document, yangStoreSnapshot.getEnumResolver());
} finally {
transactionProvider.closeReadTransaction();
}
}
use of org.opendaylight.controller.config.util.ConfigTransactionClient in project controller by opendaylight.
the class RunningDatastoreQueryStrategy method queryInstances.
@Override
public Set<ObjectName> queryInstances(final ConfigRegistryClient configRegistryClient) {
ObjectName on = transactionProvider.getOrCreateReadTransaction();
ConfigTransactionClient proxy = configRegistryClient.getConfigTransactionClient(on);
return proxy.lookupConfigBeans();
}
Aggregations