예제 #1
0
 private void createActorRef() {
   if (slaveActorRef == null) {
     slaveActorRef =
         setup
             .getActorSystem()
             .actorOf(
                 NetconfNodeActor.props(setup, id, schemaRegistry, schemaRepository),
                 id.getName());
   }
 }
예제 #2
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();
    }
  }