@Override public Set<ModuleIdentifier> getAllModuleIdentifiers() { return getCurrentSchema().getAllModuleIdentifiers(); }
@Override public void onSuccess(SchemaContext schemaContext) { LOG.debug("{}: Schema context built successfully.", id); final NetconfDeviceCapabilities deviceCap = sessionPreferences.getNetconfDeviceCapabilities(); final Set<QName> providedSourcesQnames = Sets.newHashSet(); for(ModuleIdentifier id : schemaContext.getAllModuleIdentifiers()) { providedSourcesQnames.add(QName.create(id.getQNameModule(), id.getName())); } deviceCap.addNonModuleBasedCapabilities(sessionPreferences.getNonModuleCaps()); deviceCap.addCapabilities(providedSourcesQnames); ClusteredNetconfDevice.super.handleSalInitializationSuccess( schemaContext, sessionPreferences, getDeviceSpecificRpc(schemaContext, listener)); }
@Override protected void handleSalInitializationSuccess(SchemaContext result, NetconfSessionPreferences remoteSessionCapabilities, DOMRpcService deviceRpc) { super.handleSalInitializationSuccess(result, remoteSessionCapabilities, deviceRpc); final Set<SourceIdentifier> sourceIds = Sets.newHashSet(); for(ModuleIdentifier id : result.getAllModuleIdentifiers()) { sourceIds.add(SourceIdentifier.create(id.getName(), (SimpleDateFormatUtil.DEFAULT_DATE_REV == id.getRevision() ? Optional.<String>absent() : Optional.of(SimpleDateFormatUtil.getRevisionFormat().format(id.getRevision()))))); } //TODO extract string constant to util class LOG.debug("Creating master source provider"); masterSourceProvider = TypedActor.get(cachedContext).typedActorOf( new TypedProps<>(MasterSourceProvider.class, new Creator<MasterSourceProviderImpl>() { @Override public MasterSourceProviderImpl create() throws Exception { return new MasterSourceProviderImpl(schemaRepo, sourceIds, actorSystem, topologyId, nodeId); } }), NetconfTopologyPathCreator.MASTER_SOURCE_PROVIDER); }
/** * Notifies all the local shards of a change in the schema context * * @param message */ private void updateSchemaContext(final Object message) { schemaContext = ((UpdateSchemaContext) message).getSchemaContext(); LOG.debug("Got updated SchemaContext: # of modules {}", schemaContext.getAllModuleIdentifiers().size()); for (ShardInformation info : localShards.values()) { if (info.getActor() == null) { LOG.debug("Creating Shard {}", info.getShardId()); info.setActor(newShardActor(schemaContext, info)); } else { info.getActor().tell(message, getSelf()); } } }