/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2015, 2017 Cisco Systems, 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,
import org.opendaylight.controller.config.util.capability.Capability;
import org.opendaylight.controller.config.util.capability.YangModuleCapability;
import org.opendaylight.yangtools.yang.model.api.Module;
+import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
public class ConfigSubsystemFacadeFactory {
- private ConfigRegistryClient cfgRegClient;
- private ConfigRegistryJMXClient cfgRegClientNoNotifications;
- private YangStoreService yangStoreService;
+ private final ConfigRegistryClient cfgRegClient;
+ private final ConfigRegistryJMXClient cfgRegClientNoNotifications;
+ private final YangStoreService yangStoreService;
- public ConfigSubsystemFacadeFactory(final ConfigRegistryClient cfgRegClient, final ConfigRegistryJMXClient jmxClientNoNotifications, final YangStoreService yangStoreService) {
+ public ConfigSubsystemFacadeFactory(final ConfigRegistryClient cfgRegClient,
+ final ConfigRegistryJMXClient jmxClientNoNotifications, final YangStoreService yangStoreService) {
this.cfgRegClient = cfgRegClient;
this.cfgRegClientNoNotifications = jmxClientNoNotifications;
this.yangStoreService = yangStoreService;
}
/**
- * Create new instance of ConfigSubsystemFacade. Each instance works with a dedicated transaction provider, making
- * the instances suitable for facade-per-client use.
+ * Create new instance of ConfigSubsystemFacade. Each instance works with a
+ * dedicated transaction provider, making the instances suitable for
+ * facade-per-client use.
*/
public ConfigSubsystemFacade createFacade(final String id) {
return new ConfigSubsystemFacade(cfgRegClient, cfgRegClientNoNotifications, yangStoreService, id);
Set<Module> modules = yangStoreService.getModules();
final Set<Capability> capabilities = Sets.newHashSet();
for (Module module : modules) {
- capabilities.add(new YangModuleCapability(module, yangStoreService.getModuleSource(module)));
+ capabilities.add(new YangModuleCapability(module, yangStoreService.getModuleSource(
+ RevisionSourceIdentifier.create(module.getName(), module.getRevision()))));
}
-
return capabilities;
}
-
-
}