- public <T extends DOMDataTreeCommitCohort> DOMDataTreeCommitCohortRegistration<T> registerCommitCohort(
- DOMDataTreeIdentifier path, T cohort) {
- DOMStore store = getTxFactories().get(toLegacy(path.getDatastoreType()));
- if (store instanceof DOMDataTreeCommitCohortRegistry) {
- return ((DOMDataTreeCommitCohortRegistry) store).registerCommitCohort(path, cohort);
- }
- throw new UnsupportedOperationException("Commit cohort is not supported for " + path);
- }
-
- private static LogicalDatastoreType toLegacy(org.opendaylight.mdsal.common.api.LogicalDatastoreType datastoreType) {
- switch (datastoreType) {
- case CONFIGURATION:
- return LogicalDatastoreType.CONFIGURATION;
- case OPERATIONAL:
- return LogicalDatastoreType.OPERATIONAL;
- default:
- throw new IllegalArgumentException("Unsupported data store type: " + datastoreType);
- }