@Test public void instantiateServiceInstance() throws Exception { controllerInstance.instantiateServiceInstance(); verify(writeTransaction, never()) .put(eq(LogicalDatastoreType.CONFIGURATION), eq(BINDING_ORIGINS), any()); verify(writeTransaction, times(2)) .put(eq(LogicalDatastoreType.CONFIGURATION), any(InstanceIdentifier.class), any(DataObject.class)); verify(writeTransaction, times(2)) .put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); verify(dataBroker, atLeastOnce()).registerDataTreeChangeListener(any(DataTreeIdentifier.class), any(ClusteredDataTreeChangeListener.class)); verify(rpcProviderService).registerRpcImplementation( eq(SxpControllerService.class), any(SxpRpcServiceImpl.class)); verify(rpcProviderService).registerRpcImplementation( eq(SxpConfigControllerService.class), any(SxpConfigRpcServiceImpl.class)); }
@Override public synchronized void instantiateServiceInstance() { LOG.warn("Instantiating {}", this.getClass().getSimpleName()); this.datastoreAccess = DatastoreAccess.getInstance(dataBroker); registerRpcServices(); initBindingOriginsInDS(datastoreAccess, BindingOriginsConfig.DEFAULT_ORIGIN_PRIORITIES); initBindingOriginsInternal(datastoreAccess); NodeIdentityListener datastoreListener = new NodeIdentityListener(datastoreAccess); datastoreListener.addSubListener( new DomainListener(datastoreAccess) .addSubListener(new DomainFilterListener(datastoreAccess)) .addSubListener(new ConnectionsListener(datastoreAccess)) .addSubListener(new ConnectionTemplateListener(datastoreAccess))); datastoreListener.addSubListener( new PeerGroupListener(datastoreAccess).addSubListener(new FilterListener(datastoreAccess))); initTopology(datastoreAccess, LogicalDatastoreType.CONFIGURATION); initTopology(datastoreAccess, LogicalDatastoreType.OPERATIONAL); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.CONFIGURATION)); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.OPERATIONAL)); }
SxpControllerInstance implements ClusterSingletonService, AutoCloseable { @Override public synchronized void instantiateServiceInstance() { LOG.warn("Instantiating {}", this.getClass().getSimpleName()); this.datastoreAccess = DatastoreAccess.getInstance(dataBroker); registerRpcServices(); initBindingOriginsInDS(datastoreAccess, BindingOriginsConfig.DEFAULT_ORIGIN_PRIORITIES); initBindingOriginsInternal(datastoreAccess); NodeIdentityListener datastoreListener = new NodeIdentityListener(datastoreAccess); datastoreListener.addSubListener( new DomainListener(datastoreAccess) .addSubListener(new DomainFilterListener(datastoreAccess)) .addSubListener(new ConnectionsListener(datastoreAccess)) .addSubListener(new ConnectionTemplateListener(datastoreAccess))); datastoreListener.addSubListener( new PeerGroupListener(datastoreAccess).addSubListener(new FilterListener(datastoreAccess))); initTopology(datastoreAccess, LogicalDatastoreType.CONFIGURATION); initTopology(datastoreAccess, LogicalDatastoreType.OPERATIONAL); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.CONFIGURATION)); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.OPERATIONAL)); } }
SxpControllerInstance implements ClusterSingletonService, AutoCloseable { @Override public synchronized void instantiateServiceInstance() { LOG.warn("Instantiating {}", this.getClass().getSimpleName()); this.datastoreAccess = DatastoreAccess.getInstance(dataBroker); registerRpcServices(); initBindingOriginsInDS(datastoreAccess, BindingOriginsConfig.DEFAULT_ORIGIN_PRIORITIES); initBindingOriginsInternal(datastoreAccess); NodeIdentityListener datastoreListener = new NodeIdentityListener(datastoreAccess); datastoreListener.addSubListener( new DomainListener(datastoreAccess) .addSubListener(new DomainFilterListener(datastoreAccess)) .addSubListener(new ConnectionsListener(datastoreAccess)) .addSubListener(new ConnectionTemplateListener(datastoreAccess))); datastoreListener.addSubListener( new PeerGroupListener(datastoreAccess).addSubListener(new FilterListener(datastoreAccess))); initTopology(datastoreAccess, LogicalDatastoreType.CONFIGURATION); initTopology(datastoreAccess, LogicalDatastoreType.OPERATIONAL); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.CONFIGURATION)); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.OPERATIONAL)); }  }
SxpControllerInstance implements ClusterSingletonService, AutoCloseable { @Override public synchronized void instantiateServiceInstance() { LOG.warn("Instantiating {}", this.getClass().getSimpleName()); this.datastoreAccess = DatastoreAccess.getInstance(dataBroker); registerRpcServices(); initBindingOriginsInDS(datastoreAccess, BindingOriginsConfig.DEFAULT_ORIGIN_PRIORITIES); initBindingOriginsInternal(datastoreAccess); NodeIdentityListener datastoreListener = new NodeIdentityListener(datastoreAccess); datastoreListener.addSubListener( new DomainListener(datastoreAccess) .addSubListener(new DomainFilterListener(datastoreAccess)) .addSubListener(new ConnectionsListener(datastoreAccess)) .addSubListener(new ConnectionTemplateListener(datastoreAccess))); datastoreListener.addSubListener( new PeerGroupListener(datastoreAccess).addSubListener(new FilterListener(datastoreAccess))); initTopology(datastoreAccess, LogicalDatastoreType.CONFIGURATION); initTopology(datastoreAccess, LogicalDatastoreType.OPERATIONAL); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.CONFIGURATION)); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.OPERATIONAL)); }  void init(); @Override synchronized void instantiateServiceInstance(); @Override synchronized ListenableFuture<Void> closeServiceInstance(); @Override ServiceGroupIdentifier getIdentifier(); @Override synchronized void close(); void setDataBroker(DataBroker dataBroker); void setClusteringServiceProvider(ClusterSingletonServiceProvider clusteringServiceProvider); void setRpcProviderService(RpcProviderService rpcProviderService); }
SxpControllerInstance implements ClusterSingletonService, AutoCloseable { @Override public synchronized void instantiateServiceInstance() { LOG.warn("Instantiating {}", this.getClass().getSimpleName()); this.datastoreAccess = DatastoreAccess.getInstance(dataBroker); registerRpcServices(); initBindingOriginsInDS(datastoreAccess, BindingOriginsConfig.DEFAULT_ORIGIN_PRIORITIES); initBindingOriginsInternal(datastoreAccess); NodeIdentityListener datastoreListener = new NodeIdentityListener(datastoreAccess); datastoreListener.addSubListener( new DomainListener(datastoreAccess) .addSubListener(new DomainFilterListener(datastoreAccess)) .addSubListener(new ConnectionsListener(datastoreAccess)) .addSubListener(new ConnectionTemplateListener(datastoreAccess))); datastoreListener.addSubListener( new PeerGroupListener(datastoreAccess).addSubListener(new FilterListener(datastoreAccess))); initTopology(datastoreAccess, LogicalDatastoreType.CONFIGURATION); initTopology(datastoreAccess, LogicalDatastoreType.OPERATIONAL); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.CONFIGURATION)); dataChangeListenerRegistrations.add(datastoreListener.register(dataBroker, LogicalDatastoreType.OPERATIONAL)); }  void init(); @Override synchronized void instantiateServiceInstance(); @Override synchronized ListenableFuture<Void> closeServiceInstance(); @Override ServiceGroupIdentifier getIdentifier(); @Override synchronized void close(); void setDataBroker(DataBroker dataBroker); void setClusteringServiceProvider(ClusterSingletonServiceProvider clusteringServiceProvider); void setRpcProviderService(RpcProviderService rpcProviderService); static final ServiceGroupIdentifier IDENTIFIER; }