this.dataBroker = session.getSALService(DataBroker.class); this.syslogsvrService = session.addRpcImplementation(TsdrSyslogCollectorService.class, manager); logger.info("Register SyslogsvrService to Session.");
@Override public void onSessionInitiated(final ProviderContext session){ s_logger.info( " Session Initiated for Arp Provider") ; try { DataBroker dataBroker = session.getSALService(DataBroker.class); PacketProcessingService packetProcessingService = session.getRpcService(PacketProcessingService.class); arpManager = new ArpUtilImpl( dataBroker, packetProcessingService, notificationPublishService, notificationService, mdsalApiManager, rpcProviderRegistry) ; rpcRegistration = rpcProviderRegistry. addRpcImplementation(OdlArputilService.class, arpManager); s_logger.info( " Session Initialized for Arp Provider") ; }catch( Exception e) { s_logger.error( "Error initializing Arp " , e ); } }
@Override public void onSessionInitiated(ProviderContext session) { logger.info("Packetcable Session Initiated"); logger.info("logging levels: error={}, warn={}, info={}, debug={}, trace={}", logger.isErrorEnabled(), logger.isWarnEnabled(), logger.isInfoEnabled(), logger.isDebugEnabled(), logger.isTraceEnabled()); dataBroker = session.getSALService(DataBroker.class); mdsalUtils = new MdsalUtils(dataBroker); ccapsDataChangeListenerRegistration = dataBroker.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION, ccapsIID.child(Ccap.class), ccapsDataChangeListener, DataBroker.DataChangeScope.SUBTREE); qosDataChangeListenerRegistration = dataBroker.registerDataChangeListener(LogicalDatastoreType.CONFIGURATION, PacketcableProvider.qosIID.child(Apps.class).child(App.class), qosDataChangeListener, DataBroker.DataChangeScope.SUBTREE); rpcRegistration = session.addRoutedRpcImplementation(PacketcableService.class, this); logger.info("onSessionInitiated().rpcRgistration: {}", rpcRegistration); }
new NeutronModelsDataStoreHelper(this.providerContext.getSALService(DataBroker.class))); registerAbstractHandlerService(context, new Class[] {NeutronL3Adapter.class, GatewayMacResolverListener.class}, AbstractEvent.HandlerType.NEUTRON_L3_ADAPTER, neutronL3Adapter); new String[]{MultiTenantAwareRouter.class.getName()}, null, openstackRouter); Southbound southbound = new SouthboundImpl(providerContext.getSALService(DataBroker.class)); registerService(context, new String[]{Southbound.class.getName()}, null, southbound);
itmStatusMonitor.reportStatus("STARTING"); try { dataBroker = session.getSALService(DataBroker.class); idManager = getRpcProviderRegistry().getRpcService(IdManagerService.class);
this.mountService = session.getSALService(MountPointService.class); this.dataBroker = session.getSALService(DataBroker.class); this.rpcReg = session.addRpcImplementation(NcmountService.class, this);
@Override public void onSessionInitiated(ProviderContext session) { LOG.info("AlivenessMonitorProvider Session Initiated"); try { final DataBroker dataBroker = session.getSALService(DataBroker.class); PacketProcessingService pktProcessingService = session.getRpcService(PacketProcessingService.class); IdManagerService idManager = rpcProviderRegistry.getRpcService(IdManagerService.class); OdlInterfaceRpcService interfaceService = rpcProviderRegistry.getRpcService(OdlInterfaceRpcService.class); alivenessMonitor = new AlivenessMonitor(dataBroker); alivenessMonitor.setPacketProcessingService(pktProcessingService); alivenessMonitor.setNotificationPublishService(notificationPublishService); alivenessMonitor.setIdManager(idManager); alivenessMonitor.setInterfaceManager(interfaceService); rpcRegistration = getRpcProviderRegistry().addRpcImplementation(AlivenessMonitorService.class, alivenessMonitor); listenerRegistration = notificationService.registerNotificationListener(alivenessMonitor); //ARP Handler AlivenessProtocolHandler arpHandler = new AlivenessProtocolHandlerARP(alivenessMonitor); OdlArputilService arpService = rpcProviderRegistry.getRpcService(OdlArputilService.class); ((AlivenessProtocolHandlerARP) arpHandler).setArpManagerService(arpService); alivenessMonitor.registerHandler(EtherTypes.Arp, arpHandler); //LLDP Handler AlivenessProtocolHandler lldpHandler = new AlivenessProtocolHandlerLLDP(alivenessMonitor); alivenessMonitor.registerHandler(EtherTypes.Lldp, lldpHandler); //TODO: Enable Interface Event Listener //DelegatingInterfaceEventListener listener = new DelegatingInterfaceEventListener(alivenessMonitor); //interfaceListenerRegistration = notificationService.registerNotificationListener(listener); } catch (Exception e) { LOG.error("Error initializing AlivenessMonitor service", e); } }
@Override public void onSessionInitiated(final ProviderContext session) { final NotificationService subscribe = session.getSALService(NotificationService.class); flow.setDelegate(session.getRpcService(SalFlowService.class)); flow.setDataBrokerService(session.getSALService(DataBrokerService.class)); inv.setDataService(session.getSALService(DataBrokerService.class)); inv.setFlowStatisticsService(session.getRpcService(OpendaylightFlowStatisticsService.class)); inv.setFlowTableStatisticsService(session.getRpcService(OpendaylightFlowTableStatisticsService.class)); inv.setNodeConnectorStatisticsService(session.getRpcService(OpendaylightPortStatisticsService.class)); inv.setTopologyDiscovery(session.getRpcService(FlowTopologyDiscoveryService.class)); inv.setDataProviderService(session.getSALService(DataProviderService.class)); final NodeDataChangeListener ndcl = new NodeDataChangeListener(inv,session.getSALService(DataBroker.class)); final NCDataChangeListener ncdcl = new NCDataChangeListener(inv,session.getSALService(DataBroker.class)); dps.setDelegate(session.getRpcService(PacketProcessingService.class)); topo.setDataService(session.getSALService(DataProviderService.class)); tpp.setDataService(session.getSALService(DataProviderService.class));
/** * Set up the test container. * * @throws Exception An error occurred. */ @Before @Override public void setup() throws Exception { super.setup(); // Get data broker service. ProviderContext sess = getSession(); dataBroker = sess.getSALService(DataBroker.class); // Get VTN RPC services. vtnService = sess.getRpcService(VtnService.class); vbridgeService = sess.getRpcService(VtnVbridgeService.class); vterminalService = sess.getRpcService(VtnVterminalService.class); vinterfaceService = sess.getRpcService(VtnVinterfaceService.class); macTableService = sess.getRpcService(VtnMacTableService.class); vlanMapService = sess.getRpcService(VtnVlanMapService.class); macMapService = sess.getRpcService(VtnMacMapService.class); portMapService = sess.getRpcService(VtnPortMapService.class); flowFilterService = sess.getRpcService(VtnFlowFilterService.class); flowCondService = sess.getRpcService(VtnFlowConditionService.class); pathPolicyService = sess.getRpcService(VtnPathPolicyService.class); pathMapService = sess.getRpcService(VtnPathMapService.class); versionService = sess.getRpcService(VtnVersionService.class); initVtnConfig(); }
/** * @param ctx * @return {@link ObjectRegistration} */ public ObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register( final ProviderContext ctx) { RoutedRpcRegistration<SalTableService> addRoutedRpcImplementation = ctx .<SalTableService> addRoutedRpcImplementation( SalTableService.class, this); setTableRegistration(addRoutedRpcImplementation); InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier .<Nodes> builder(Nodes.class); NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID); NodeKey nodeKey = new NodeKey(nodeId); InstanceIdentifierBuilder<Node> nodeIndentifier = builder1 .<Node, NodeKey> child(Node.class, nodeKey); InstanceIdentifier<Node> instance = nodeIndentifier.build(); tableRegistration.registerPath(NodeContext.class, instance); RoutedRpcRegistration<SalTableService> tableRegistration1 = this .getTableRegistration(); return new AbstractObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider>(this) { @Override protected void removeRegistration() { tableRegistration1.close(); } }; }
/** * @param ctx * @return {@link ObjectRegistration} */ public ObjectRegistration<OpenflowpluginMeterTestServiceProvider> register( final ProviderContext ctx) { RoutedRpcRegistration<SalMeterService> addRoutedRpcImplementation = ctx .<SalMeterService> addRoutedRpcImplementation( SalMeterService.class, this); setMeterRegistration(addRoutedRpcImplementation); InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier .<Nodes> builder(Nodes.class); NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID); NodeKey nodeKey = new NodeKey(nodeId); InstanceIdentifierBuilder<Node> nodeIndentifier = builder1 .<Node, NodeKey> child(Node.class, nodeKey); InstanceIdentifier<Node> instance = nodeIndentifier.build(); meterRegistration.registerPath(NodeContext.class, instance); RoutedRpcRegistration<SalMeterService> meterRegistration1 = this .getMeterRegistration(); return new AbstractObjectRegistration<OpenflowpluginMeterTestServiceProvider>(this) { @Override protected void removeRegistration() { meterRegistration1.close(); } }; }
/** * @param ctx * @return {@link ObjectRegistration} */ public ObjectRegistration<OpenflowpluginGroupTestServiceProvider> register( final ProviderContext ctx) { RoutedRpcRegistration<SalGroupService> addRoutedRpcImplementation = ctx .<SalGroupService> addRoutedRpcImplementation( SalGroupService.class, this); setGroupRegistration(addRoutedRpcImplementation); InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier .<Nodes> builder(Nodes.class); NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID); NodeKey nodeKey = new NodeKey(nodeId); InstanceIdentifierBuilder<Node> nodeIndentifier = builder1 .<Node, NodeKey> child(Node.class, nodeKey); InstanceIdentifier<Node> instance = nodeIndentifier.build(); groupRegistration.registerPath(NodeContext.class, instance); RoutedRpcRegistration<SalGroupService> groupRegistration1 = this .getGroupRegistration(); return new AbstractObjectRegistration<OpenflowpluginGroupTestServiceProvider>(this) { @Override protected void removeRegistration() { groupRegistration1.close(); } }; }
public static String makePingFlowForNode(final String nodeId, final ProviderContext pc) { NodeBuilder nodeBuilder = createNodeBuilder(nodeId); FlowBuilder flowBuilder = createFlowBuilder(1235, null, "ping"); DataBroker dataBroker = pc.<DataBroker>getSALService(DataBroker.class); ReadWriteTransaction modif = dataBroker.newReadWriteTransaction(); InstanceIdentifier<Flow> path = InstanceIdentifier.<Nodes>builder(Nodes.class) .<Node, NodeKey>child(Node.class, nodeBuilder.getKey()) .<FlowCapableNode>augmentation(FlowCapableNode.class) .<Table, TableKey>child(Table.class, new TableKey(flowBuilder.getTableId())) .<Flow, FlowKey>child(Flow.class, flowBuilder.getKey()) .build(); modif.put(LogicalDatastoreType.CONFIGURATION, path, flowBuilder.build()); CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modif.submit(); final StringBuilder aggregator = new StringBuilder(); Futures.addCallback(commitFuture, new FutureCallback<Void>() { @Override public void onSuccess(Void aVoid) { aggregator.append("Status of Flow Data Loaded Transaction: succes "); } @Override public void onFailure(Throwable throwable) { aggregator.append(throwable.getClass().getName()); } }); return aggregator.toString(); }
final ProviderContext ctx) { RoutedRpcRegistration<SalFlowService> addRoutedRpcImplementation = ctx .<SalFlowService> addRoutedRpcImplementation( SalFlowService.class, this);
@Override public void onSessionInitiated(ProviderContext session) { DataBroker salService = session .<DataBroker> getSALService(DataBroker.class); OpenflowpluginTestActivator.provider.setDataService(salService); NotificationProviderService salService1 = session .<NotificationProviderService> getSALService(NotificationProviderService.class); OpenflowpluginTestActivator.provider .setNotificationService(salService1); OpenflowpluginTestActivator.provider.start(); OpenflowpluginTestActivator.provider.register(session); OpenflowpluginTestActivator.groupProvider.register(session); OpenflowpluginTestActivator.meterProvider.register(session); OpenflowpluginTestActivator.tableProvider.register(session); this.cmdProvider.onSessionInitiated(session); this.cmdGroupProvider.onSessionInitiated(session); this.cmdMeterProvider.onSessionInitiated(session); this.cmdTableProvider.onSessionInitiated(session); this.cmdStatsProvider.onSessionInitiated(session); this.cmdNodeConnectorNotification.onSessionInitiated(session); this.cmdTopologyNotification.onSessionInitiated(session); this.bulkCmdProvider.onSessionInitiated(session); this.groupCmdProvider.onSessionInitiated(session); }
@Override public void onSessionInitiated(ProviderContext session) { try { dataBroker = session.getSALService(DataBroker.class); fibDSWriter = new FibDSWriter(dataBroker); BgpUtil.setBroker(dataBroker); bcm = new BgpConfigurationManager(this); Commands commands = new Commands(this); ConfigureBgpCli.setBgpManager(this); LOGGER.info("BgpManager started"); } catch (Exception e) { LOGGER.error("Failed to start BgpManager: "+e); } // Set up the Infra for Posting BGP Alarms as JMX notifications. try { qbgpAlarmProducer = new BgpAlarmBroadcaster(); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName alarmObj = new ObjectName("SDNC.FM:name=BgpAlarmObj"); mbs.registerMBean(qbgpAlarmProducer, alarmObj); } catch (JMException e) { LOGGER.error("Adding a NotificationBroadcaster failed." + e.toString()); e.printStackTrace(); } }
@Override public void onSessionInitiated(ProviderContext session) { dataBroker = session.getSALService(DataBroker.class); final WriteTransaction wtx = dataBroker.newWriteOnlyTransaction(); initTopology(wtx, LogicalDatastoreType.CONFIGURATION); initTopology(wtx, LogicalDatastoreType.OPERATIONAL); Futures.addCallback(wtx.submit(), new FutureCallback<Void>() { @Override public void onSuccess(Void result) { LOG.debug("topology initialization successful"); } @Override public void onFailure(Throwable t) { LOG.error("Unable to initialize netconf-topology, {}", t); } }); LOG.debug("Registering datastore listener"); datastoreListenerRegistration = dataBroker.registerDataTreeChangeListener( new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, TopologyUtil.createTopologyListPath(topologyId).child(Node.class)), this); }
@Override public void onSessionInitiated(ProviderContext session) { LOG.info("UsecpluginProvider Session Initiated"); usecpluginService = session.addRpcImplementation(UsecpluginService.class, new UsecpluginRPCImpl()); NotificationService notificationService = session.getSALService(NotificationService.class); PacketHandler packetHandler = new PacketHandler(); notificationService.registerNotificationListener(packetHandler); NotificationProviderService notificationProvider = session.getSALService(NotificationProviderService.class); packetHandler.setNotificationProviderService(notificationProvider); PacketHandler_HWM packetHandler_hwm = new PacketHandler_HWM(); notificationService.registerNotificationListener(packetHandler_hwm); dataBroker = session.getSALService(DataBroker.class); packetHandler_hwm.setdataBroker(dataBroker); packetHandler_hwm.dbHwm(); packetHandler.setdataBroker(dataBroker); packetHandler.dbOpen(); UsecpluginNotifImpl listener = new UsecpluginNotifImpl(); notificationService.registerNotificationListener(listener); packetHandler_hwm.getHWMSample(); packetHandler.getLWMSample(); }
@Override public void onSessionInitiated(ProviderContext session) { try { final DataBroker dbx = session.getSALService(DataBroker.class); nhManager = new NexthopManager(dbx); vpnIfListener = new VpnInterfaceChangeListener(dbx, nhManager); odlIfListener = new OdlInterfaceChangeListener(dbx, nhManager, interfaceManager); idManager = new IdManager(dbx); final BindingAwareBroker.RpcRegistration<L3nexthopService> rpcRegistration = getRpcProviderRegistry().addRpcImplementation(L3nexthopService.class, nhManager); nhManager.setMdsalManager(mdsalManager); nhManager.setInterfaceManager(interfaceManager); nhManager.setIdManager(idManager); nhManager.createNexthopPointerPool(); LOG.info("NexthopmgrProvider Session Initiated"); } catch (Exception e) { LOG.error("Error initializing services", e); } }
@Override public void onSessionInitiated(final ProviderContext session) { dataBroker = session.getSALService(DataBroker.class); final NodeWriter writer = new TopologyNodeWriter(topologyId, dataBroker); TypedActorExtension typedActorExtension = TypedActor.get(this.actorSystem); LOG.warn("Registering actor on path {}", actorSystem.name() + "/user/" + topologyId); topologyManager = typedActorExtension.typedActorOf(new TypedProps<>(TopologyManager.class, new Creator<BaseTopologyManager>() { @Override public BaseTopologyManager create() throws Exception { return new BaseTopologyManager(actorSystem, codecRegistry, dataBroker, topologyId, new TopologyCallbackFactory(ClusteredNetconfTopology.this, entityOwnershipService, writer), new NetconfNodeOperationalDataAggregator(), new LoggingSalNodeWriter(writer), new TopologyRoleChangeStrategy(dataBroker, entityOwnershipService, "topology-netconf", "topology-manager")); } }), topologyId); }