/** * Construct a new instance. * * @param md A {@link MdsalUtils} instance. * @param rpc A {@link RpcConsumerRegistry} instance. */ public VTNManagerService(MdsalUtils md, RpcConsumerRegistry rpc) { mdSal = md; vtnService = rpc.getRpcService(VtnService.class); vbridgeService = rpc.getRpcService(VtnVbridgeService.class); vinterfaceService = rpc.getRpcService(VtnVinterfaceService.class); portMapService = rpc.getRpcService(VtnPortMapService.class); }
@Override public <T extends RpcService> T getRpcService(final Class<T> type) { return consumerRegistry.getRpcService(type); }
/** * Construct a new instance. * * @param md A {@link MdsalUtils} instance. * @param rpc A {@link RpcConsumerRegistry} instance. */ public VTNManagerService(MdsalUtils md, RpcConsumerRegistry rpc) { mdSal = md; vtnService = rpc.getRpcService(VtnService.class); vbridgeService = rpc.getRpcService(VtnVbridgeService.class); vinterfaceService = rpc.getRpcService(VtnVinterfaceService.class); portMapService = rpc.getRpcService(VtnPortMapService.class); vlanMapService = rpc.getRpcService(VtnVlanMapService.class); flowConditionService = rpc.getRpcService(VtnFlowConditionService.class); flowFilterService = rpc.getRpcService(VtnFlowFilterService.class); }
public OcpService(final RpcConsumerRegistry rpcRegistry) { executor = Executors.newFixedThreadPool(1); LOG.info("OcpService() created"); this.ocpConfigMgmtService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalConfigMgmtService.class), "RPC OcpConfigMgmtService not found."); this.ocpFaultMgmtService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalFaultMgmtService.class), "RPC OcpFaultMgmtService not found."); this.ocpObjectStateMgmtService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalObjectStateMgmtService.class), "RPC OcpObjectStateMgmtService not found."); this.ocpDeviceMgmtService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalDeviceMgmtService.class), "RPC OcpDeviceMgmtService not found."); this.ocpObjectLifecycleService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalObjectLifecycleService.class), "RPC OcpDeviceMgmtService not found."); } public static final InstanceIdentifier<ResourceModel> RM_IID = InstanceIdentifier.builder(ResourceModel.class).build();
public SystemNotificationsListenerImpl(@Nonnull final ConnectionContext connectionContext, @Nonnull final RpcConsumerRegistry rpcRegistry) { this.connectionContext = Preconditions.checkNotNull(connectionContext); this.rpcService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalDeviceMgmtService.class)); }
public ForwardingRulesManagerImpl(final DataBroker dataBroker, final RpcConsumerRegistry rpcRegistry, final ForwardingRulesManagerConfig config, final ClusterSingletonServiceProvider clusterSingletonService) { this.dataService = Preconditions.checkNotNull(dataBroker, "DataBroker can not be null!"); this.forwardingRulesManagerConfig = Preconditions.checkNotNull(config, "Configuration for FRM cannot be null"); this.clusterSingletonServiceProvider = Preconditions.checkNotNull(clusterSingletonService, "ClusterSingletonService provider can not be null"); Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry can not be null !"); this.salFlowService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalFlowService.class), "RPC SalFlowService not found."); this.salGroupService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalGroupService.class), "RPC SalGroupService not found."); this.salMeterService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalMeterService.class), "RPC SalMeterService not found."); this.salTableService = Preconditions.checkNotNull(rpcRegistry.getRpcService(SalTableService.class), "RPC SalTableService not found."); }
@Override public <T extends RpcService> T getRpcService(Class<T> module) { return getRpcRegistryChecked().getRpcService(module); }
@Override public final <T extends RpcService> T getRpcService(Class<T> module) { return getSALService(RpcConsumerRegistry.class).getRpcService(module); }
@Override public final <T extends RpcService> T getRpcService(Class<T> module) { return getSALService(RpcConsumerRegistry.class).getRpcService(module); }
@Override public <T extends RpcService> T getRpcService(Class<T> module) { return getRpcRegistryChecked().getRpcService(module); }
public StatRpcMsgManagerImpl (final StatisticsManager manager, final RpcConsumerRegistry rpcRegistry, final long maxNodeForCollector) { Preconditions.checkArgument(manager != null, "StatisticManager can not be null!"); Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry can not be null !"); groupStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightGroupStatisticsService.class), "OpendaylightGroupStatisticsService can not be null!"); meterStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightMeterStatisticsService.class), "OpendaylightMeterStatisticsService can not be null!"); flowStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightFlowStatisticsService.class), "OpendaylightFlowStatisticsService can not be null!"); portStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightPortStatisticsService.class), "OpendaylightPortStatisticsService can not be null!"); flowTableStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightFlowTableStatisticsService.class), "OpendaylightFlowTableStatisticsService can not be null!"); queueStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightQueueStatisticsService.class), "OpendaylightQueueStatisticsService can not be null!"); statsRpcJobQueue = new LinkedBlockingQueue<>(QUEUE_CAPACITY); txCache = CacheBuilder.newBuilder().expireAfterWrite((maxNodeForCollector * POSSIBLE_STAT_WAIT_FOR_NOTIFICATION), TimeUnit.SECONDS) .maximumSize(MAX_CACHE_SIZE).build(); }
@Override public <T extends RpcService> T getRpcService(final Class<T> serviceInterface) { return service(RpcConsumerRegistry.class).getRpcService(serviceInterface); }
public StatRpcMsgManagerImpl (final StatisticsManager manager, final RpcConsumerRegistry rpcRegistry, final long maxNodeForCollector) { Preconditions.checkArgument(manager != null, "StatisticManager can not be null!"); Preconditions.checkArgument(rpcRegistry != null, "RpcConsumerRegistry can not be null !"); groupStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightGroupStatisticsService.class), "OpendaylightGroupStatisticsService can not be null!"); meterStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightMeterStatisticsService.class), "OpendaylightMeterStatisticsService can not be null!"); flowStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightFlowStatisticsService.class), "OpendaylightFlowStatisticsService can not be null!"); portStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightPortStatisticsService.class), "OpendaylightPortStatisticsService can not be null!"); flowTableStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightFlowTableStatisticsService.class), "OpendaylightFlowTableStatisticsService can not be null!"); queueStatsService = Preconditions.checkNotNull( rpcRegistry.getRpcService(OpendaylightQueueStatisticsService.class), "OpendaylightQueueStatisticsService can not be null!"); statsRpcJobQueue = new LinkedBlockingQueue<>(queueCapacity); /* nr. 7 is here nr. of possible statistic which are waiting for notification * - check it in StatPermCollectorImpl method collectStatCrossNetwork */ txCache = CacheBuilder.newBuilder().expireAfterWrite((maxNodeForCollector * 7), TimeUnit.SECONDS) .maximumSize(10000).build(); }
private ServiceFunctionDescriptionMonitorReportService getSfDescriptionMonitorService(String nodeName) { InstanceIdentifier<?> nodeIID = NETCONF_TOPO_IID.child(Node.class, new NodeKey(new NodeId(nodeName))); MountPointService mountService = SfcNetconfDataProvider.GetNetconfDataProvider().getMountService(); if (mountService == null) { LOG.error("Mount service is null"); return null; } Optional<MountPoint> mountPoint = mountService.getMountPoint(nodeIID); if (!mountPoint.isPresent()) { LOG.error("Mount point for node {} doesn't exist", nodeName); return null; } final Optional<RpcConsumerRegistry> service = mountPoint.get().getService(RpcConsumerRegistry.class); if (!service.isPresent()) { LOG.error("Failed to get RpcService for node {}", nodeName); return null; } return service.get().getRpcService(ServiceFunctionDescriptionMonitorReportService.class); }
public RoutedBindingRTClient(final RpcConsumerRegistry registry, final int inSize, final List<InstanceIdentifier<?>> routeIid) { if (registry != null) { this.service = registry.getRpcService(RpcbenchPayloadService.class); } else { this.service = null; } this.inSize = inSize; this.inVal = new ArrayList<>(); List<Payload> listVals = new ArrayList<>(); for (int i = 0; i < inSize; i++) { listVals.add(new PayloadBuilder().setId(i).build()); } for (InstanceIdentifier<?> iid : routeIid) { inVal.add(new RoutedRpcBenchInputBuilder().setNode(iid).setPayload(listVals).build()); } }
public RoutedBindingRTClient(RpcConsumerRegistry registry, int inSize, List<InstanceIdentifier<?>> routeIid) { if (registry != null) { this.service = registry.getRpcService(RpcbenchPayloadService.class); } else { this.service = null; } this.inSize = inSize; this.inVal = new ArrayList<>(); List<Payload> listVals = new ArrayList<>(); for (int i = 0; i < inSize; i++) { listVals.add(new PayloadBuilder().setId(i).build()); } for (InstanceIdentifier<?> iid : routeIid) { inVal.add(new RoutedRpcBenchInputBuilder().setNode(iid).setPayload(listVals).build()); } }
public GlobalBindingRTCClient(final RpcConsumerRegistry registry, final int inSize) { if (registry != null) { this.service = registry.getRpcService(RpcbenchPayloadService.class); } else { this.service = null; } this.inSize = inSize; List<Payload> listVals = new ArrayList<>(); for (int i = 0; i < inSize; i++) { listVals.add(new PayloadBuilder().setId(i).build()); } inVal = new GlobalRpcBenchInputBuilder().setPayload(listVals).build(); }
public GlobalBindingRTCClient(RpcConsumerRegistry registry, int inSize) { if (registry != null) { this.service = registry.getRpcService(RpcbenchPayloadService.class); } else { this.service = null; } this.inSize = inSize; List<Payload> listVals = new ArrayList<>(); for (int i = 0; i < inSize; i++) { listVals.add(new PayloadBuilder().setId(i).build()); } inVal = new GlobalRpcBenchInputBuilder().setPayload(listVals).build(); }
final NotificationsService rpcService = service.get().getRpcService(NotificationsService.class); final CreateSubscriptionInputBuilder createSubscriptionInputBuilder = new CreateSubscriptionInputBuilder(); createSubscriptionInputBuilder.setStream(new StreamNameType(streamName));