Exemplo n.º 1
0
 private void createActorRef() {
   if (slaveActorRef == null) {
     slaveActorRef =
         setup
             .getActorSystem()
             .actorOf(
                 NetconfNodeActor.props(setup, id, schemaRegistry, schemaRepository),
                 id.getName());
   }
 }
Exemplo n.º 2
0
 void registerDataTreeChangeListener(final String topologyId, final NodeKey key) {
   LOG.debug("{}: Registering data tree change listener on node {}", id, key);
   dataChangeListenerRegistration =
       setup
           .getDataBroker()
           .registerDataTreeChangeListener(
               new DataTreeIdentifier<>(
                   LogicalDatastoreType.OPERATIONAL,
                   NetconfTopologyUtils.createTopologyNodeListPath(key, topologyId)),
               this);
 }
Exemplo n.º 3
0
  private void handleSlaveMountPoint(final DataObjectModification<Node> rootNode) {
    @SuppressWarnings("ConstantConditions")
    final NetconfNode netconfNodeAfter = rootNode.getDataAfter().getAugmentation(NetconfNode.class);

    if (NetconfNodeConnectionStatus.ConnectionStatus.Connected.equals(
        netconfNodeAfter.getConnectionStatus())) {
      createActorRef();
      final String masterAddress =
          netconfNodeAfter.getClusteredConnectionStatus().getNetconfMasterNode();
      final String path =
          NetconfTopologyUtils.createActorPath(
              masterAddress,
              NetconfTopologyUtils.createMasterActorName(
                  id.getName(),
                  netconfNodeAfter.getClusteredConnectionStatus().getNetconfMasterNode()));
      setup.getActorSystem().actorSelection(path).tell(new AskForMasterMountPoint(), slaveActorRef);
    } else {;
      closeActor();
    }
  }