import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
import org.opendaylight.netconf.topology.singleton.messages.CreateInitialMasterActorData;
import org.opendaylight.yangtools.rfc8528.data.api.MountPointContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
import org.opendaylight.yangtools.yang.model.util.SchemaContextUtil;
private final ActorRef masterActorRef;
private final ActorSystem actorSystem;
- private SchemaContext currentSchemaContext = null;
+ private MountPointContext currentMountContext = null;
private NetconfSessionPreferences netconfSessionPreferences = null;
private DOMRpcService deviceRpc = null;
private DOMDataBroker deviceDataBroker = null;
public void onDeviceConnected(final MountPointContext mountContext,
final NetconfSessionPreferences sessionPreferences,
final DOMRpcService domRpcService) {
- this.currentSchemaContext = mountContext.getSchemaContext();
+ this.currentMountContext = mountContext;
this.netconfSessionPreferences = sessionPreferences;
this.deviceRpc = domRpcService;
registerMasterMountPoint();
- sendInitialDataToActor().onComplete(new OnComplete<Object>() {
+ sendInitialDataToActor().onComplete(new OnComplete<>() {
@Override
public void onComplete(final Throwable failure, final Object success) {
if (failure == null) {
private void registerMasterMountPoint() {
requireNonNull(id);
- requireNonNull(currentSchemaContext, "Device has no remote schema context yet. Probably not fully connected.");
+ requireNonNull(currentMountContext, "Device has no remote schema context yet. Probably not fully connected.");
requireNonNull(netconfSessionPreferences, "Device has no capabilities yet. Probably not fully connected.");
final NetconfDeviceNotificationService notificationService = new NetconfDeviceNotificationService();
// on leader node would be same as on follower node
final ProxyDOMDataBroker proxyDataBroker = new ProxyDOMDataBroker(id, masterActorRef, actorSystem.dispatcher(),
actorResponseWaitTime);
- salProvider.getMountInstance().onTopologyDeviceConnected(currentSchemaContext,
+ salProvider.getMountInstance().onTopologyDeviceConnected(currentMountContext.getSchemaContext(),
proxyDataBroker, deviceRpc, notificationService, deviceAction);
}
protected DOMDataBroker newDeviceDataBroker() {
- return new NetconfDeviceDataBroker(id, currentSchemaContext, deviceRpc, netconfSessionPreferences);
+ return new NetconfDeviceDataBroker(id, currentMountContext, deviceRpc, netconfSessionPreferences);
}
private Future<Object> sendInitialDataToActor() {
final List<SourceIdentifier> sourceIdentifiers =
- SchemaContextUtil.getConstituentModuleIdentifiers(currentSchemaContext).stream()
+ SchemaContextUtil.getConstituentModuleIdentifiers(currentMountContext.getSchemaContext()).stream()
.map(mi -> RevisionSourceIdentifier.create(mi.getName(), mi.getRevision()))
.collect(Collectors.toList());