本文整理汇总了Java中org.onosproject.event.EventDeliveryService类的典型用法代码示例。如果您正苦于以下问题:Java EventDeliveryService类的具体用法?Java EventDeliveryService怎么用?Java EventDeliveryService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventDeliveryService类属于org.onosproject.event包,在下文中一共展示了EventDeliveryService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: injectEventDispatcher
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
/**
* Injects the given event delivery service into the specified manager
* component.
*
* @param manager manager component
* @param svc service reference to be injected
*/
public static void injectEventDispatcher(Object manager, EventDeliveryService svc) {
Class mc = manager.getClass();
for (Field f : mc.getSuperclass().getDeclaredFields()) {
if (f.getType().equals(EventDeliveryService.class)) {
try {
TestUtils.setField(manager, f.getName(), svc);
} catch (TestUtils.TestUtilsException e) {
throw new IllegalArgumentException("Unable to inject reference", e);
}
break;
}
}
}
示例2: AbstractVirtualListenerManager
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
public AbstractVirtualListenerManager(VirtualNetworkService manager,
NetworkId networkId,
Class<? extends Event> eventClass) {
this.manager = manager;
this.networkId = networkId;
this.serviceDirectory = manager.getServiceDirectory();
//Set default event delivery service by default
this.eventDispatcher = serviceDirectory.get(EventDeliveryService.class);
//Initialize and reference to the listener registry
this.listenerRegistry = listenerManager.getRegistry(networkId, eventClass);
}
示例3: testServiceGetReturnsSavedInstance
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
/**
* Tests that the get() method returns saved service instances.
*/
@Test
public void testServiceGetReturnsSavedInstance() {
manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
VirtualNetwork virtualNetwork =
manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), DeviceService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), LinkService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), TopologyService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), HostService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), PathService.class);
// extra setup needed for FlowRuleService, PacketService, GroupService, and IntentService
VirtualProviderManager virtualProviderManager = new VirtualProviderManager();
virtualProviderManager.registerProvider(new DefaultVirtualFlowRuleProvider());
virtualProviderManager.registerProvider(new DefaultVirtualPacketProvider());
virtualProviderManager.registerProvider(new DefaultVirtualGroupProvider());
testDirectory.add(CoreService.class, coreService)
.add(VirtualProviderRegistryService.class, virtualProviderManager)
.add(EventDeliveryService.class, new TestEventDispatcher())
.add(ClusterService.class, new ClusterServiceAdapter())
.add(VirtualNetworkFlowRuleStore.class, new SimpleVirtualFlowRuleStore())
.add(VirtualNetworkPacketStore.class, new SimpleVirtualPacketStore())
.add(VirtualNetworkGroupStore.class, new SimpleVirtualGroupStore())
.add(VirtualNetworkIntentStore.class, new SimpleVirtualIntentStore())
.add(VirtualNetworkFlowObjectiveStore.class, new SimpleVirtualFlowObjectiveStore());
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), FlowRuleService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), FlowObjectiveService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), PacketService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), GroupService.class);
validateServiceGetReturnsSavedInstance(virtualNetwork.id(), IntentService.class);
}
示例4: getAdminDefaultPerms
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
private static List<Permission> getAdminDefaultPerms() {
List<Permission> permSet = Lists.newArrayList();
permSet.add(new ServicePermission(ApplicationAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LeadershipAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterMetadataAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MastershipAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DriverAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(HostAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceKeyAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LinkAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ResourceAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(RegionAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PartitionAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(StorageAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ApplicationService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ComponentConfigService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterMetadataService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LeadershipService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(CodecService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(CoreService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(EventDeliveryService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MastershipService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MastershipTermService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(BasicNetworkConfigService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(NetworkConfigService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceClockService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DriverService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(EdgePortService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(FlowRuleService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(FlowObjectiveService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(GroupService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(HostService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(IntentService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(IntentClockService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(IntentExtensionService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(IntentPartitionService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceKeyService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LinkService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(MulticastRouteService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(MeterService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ResourceService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PacketService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ProxyArpService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(RegionService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(LinkResourceService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(FlowStatisticService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(StatisticService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PathService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(TopologyService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PersistenceService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(ApiDocService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterCommunicationService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MessagingService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PartitionService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LogicalClockService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(StorageService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(UiExtensionService.class.getName(), ServicePermission.GET));
return permSet;
}
示例5: TestVirtualNetworkManager
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
public TestVirtualNetworkManager() {
serviceDirectory.add(EventDeliveryService.class, dispatcher);
}
示例6: setUp
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
CoreService coreService = new TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", storageService);
virtualNetworkManagerStore.activate();
flowObjectiveStore = new SimpleVirtualFlowObjectiveStore();
TestUtils.setField(flowObjectiveStore, "storageService", storageService);
flowObjectiveStore.activate();
flowRuleStore = new SimpleVirtualFlowRuleStore();
flowRuleStore.activate();
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
TestUtils.setField(manager, "coreService", coreService);
providerRegistryService = new VirtualProviderManager();
providerRegistryService.registerProvider(flowRuleProvider);
eventDeliveryService = new TestEventDispatcher();
NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
appId = new TestApplicationId("FlowRuleManagerTest");
testDirectory = new TestServiceDirectory()
.add(VirtualNetworkStore.class, virtualNetworkManagerStore)
.add(CoreService.class, coreService)
.add(EventDeliveryService.class, eventDeliveryService)
.add(VirtualProviderRegistryService.class, providerRegistryService)
.add(VirtualNetworkFlowRuleStore.class, flowRuleStore)
.add(VirtualNetworkFlowObjectiveStore.class, flowObjectiveStore);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
vnet1 = setupVirtualNetworkTopology(manager, TID1);
vnet2 = setupVirtualNetworkTopology(manager, TID2);
service1 = new VirtualNetworkFlowObjectiveManager(manager, vnet1.id());
service2 = new VirtualNetworkFlowObjectiveManager(manager, vnet2.id());
}
示例7: setUp
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
CoreService coreService = new TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
virtualNetworkManagerStore.activate();
groupStore = new SimpleVirtualGroupStore();
providerRegistryService = new VirtualProviderManager();
providerRegistryService.registerProvider(provider);
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
TestUtils.setField(manager, "coreService", coreService);
eventDeliveryService = new TestEventDispatcher();
injectEventDispatcher(manager, eventDeliveryService);
appId = new TestApplicationId("VirtualGroupManagerTest");
testDirectory = new TestServiceDirectory()
.add(VirtualNetworkStore.class, virtualNetworkManagerStore)
.add(CoreService.class, coreService)
.add(VirtualProviderRegistryService.class, providerRegistryService)
.add(EventDeliveryService.class, eventDeliveryService)
.add(VirtualNetworkGroupStore.class, groupStore);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
vnet1 = setupVirtualNetworkTopology(manager, TID1);
vnet2 = setupVirtualNetworkTopology(manager, TID2);
groupManager1 = new VirtualNetworkGroupManager(manager, vnet1.id());
groupManager2 = new VirtualNetworkGroupManager(manager, vnet2.id());
groupManager1.addListener(listener1);
groupManager2.addListener(listener2);
providerService1 = (VirtualGroupProviderService)
providerRegistryService.getProviderService(vnet1.id(),
VirtualGroupProvider.class);
providerService2 = (VirtualGroupProviderService)
providerRegistryService.getProviderService(vnet2.id(),
VirtualGroupProvider.class);
}
示例8: setUp
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
CoreService coreService = new TestCoreService();
TestStorageService storageService = new TestStorageService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", storageService);
virtualNetworkManagerStore.activate();
meterStore = new SimpleVirtualMeterStore();
providerRegistryService = new VirtualProviderManager();
providerRegistryService.registerProvider(provider);
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
TestUtils.setField(manager, "coreService", coreService);
eventDeliveryService = new TestEventDispatcher();
NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
// eventDeliveryService.addSink(VirtualEvent.class, listenerRegistryManager);
appId = new TestApplicationId("MeterManagerTest");
testDirectory = new TestServiceDirectory()
.add(VirtualNetworkStore.class, virtualNetworkManagerStore)
.add(CoreService.class, coreService)
.add(VirtualProviderRegistryService.class, providerRegistryService)
.add(EventDeliveryService.class, eventDeliveryService)
.add(StorageService.class, storageService)
.add(VirtualNetworkMeterStore.class, meterStore);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
vnet1 = setupVirtualNetworkTopology(manager, TID1);
vnet2 = setupVirtualNetworkTopology(manager, TID2);
meterManager1 = new VirtualNetworkMeterManager(manager, vnet1.id());
meterManager2 = new VirtualNetworkMeterManager(manager, vnet2.id());
providerService1 = (VirtualMeterProviderService)
providerRegistryService.getProviderService(vnet1.id(), VirtualMeterProvider.class);
providerService2 = (VirtualMeterProviderService)
providerRegistryService.getProviderService(vnet2.id(), VirtualMeterProvider.class);
assertTrue("provider should be registered",
providerRegistryService.getProviders().contains(provider.id()));
setupMeterTestVariables();
}
示例9: setUp
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
CoreService coreService = new TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
virtualNetworkManagerStore.activate();
flowRuleStore = new SimpleVirtualFlowRuleStore();
providerRegistryService = new VirtualProviderManager();
providerRegistryService.registerProvider(provider);
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
TestUtils.setField(manager, "coreService", coreService);
eventDeliveryService = new TestEventDispatcher();
NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
appId = new TestApplicationId("FlowRuleManagerTest");
testDirectory = new TestServiceDirectory()
.add(VirtualNetworkStore.class, virtualNetworkManagerStore)
.add(CoreService.class, coreService)
.add(VirtualProviderRegistryService.class, providerRegistryService)
.add(EventDeliveryService.class, eventDeliveryService)
.add(VirtualNetworkFlowRuleStore.class, flowRuleStore);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
vnet1 = setupVirtualNetworkTopology(manager, TID1);
vnet2 = setupVirtualNetworkTopology(manager, TID2);
vnetFlowRuleService1 = new VirtualNetworkFlowRuleManager(manager, vnet1.id());
vnetFlowRuleService2 = new VirtualNetworkFlowRuleManager(manager, vnet2.id());
vnetFlowRuleService1.addListener(listener1);
vnetFlowRuleService2.addListener(listener2);
vnetFlowRuleService1.operationsService = MoreExecutors.newDirectExecutorService();
vnetFlowRuleService2.operationsService = MoreExecutors.newDirectExecutorService();
vnetFlowRuleService1.deviceInstallers = MoreExecutors.newDirectExecutorService();
vnetFlowRuleService2.deviceInstallers = MoreExecutors.newDirectExecutorService();
providerService1 = (VirtualFlowRuleProviderService)
providerRegistryService.getProviderService(vnet1.id(), VirtualFlowRuleProvider.class);
providerService2 = (VirtualFlowRuleProviderService)
providerRegistryService.getProviderService(vnet2.id(), VirtualFlowRuleProvider.class);
}
示例10: getAdminDefaultPerms
import org.onosproject.event.EventDeliveryService; //导入依赖的package包/类
private static List<Permission> getAdminDefaultPerms() {
List<Permission> permSet = Lists.newArrayList();
permSet.add(new ServicePermission(ApplicationAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LeadershipAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterMetadataAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MastershipAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DriverAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(HostAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceKeyAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LinkAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ResourceAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(RegionAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PartitionAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(StorageAdminService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ApplicationService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ComponentConfigService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterMetadataService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LeadershipService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(CodecService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(CoreService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(EventDeliveryService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MastershipService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MastershipTermService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(BasicNetworkConfigService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(NetworkConfigService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceClockService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DriverService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(EdgePortService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(FlowRuleService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(FlowObjectiveService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(GroupService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(HostService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(IntentService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(IntentClockService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(IntentExtensionService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(WorkPartitionService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(DeviceKeyService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LinkService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(MulticastRouteService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(MeterService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ResourceService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PacketService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(RegionService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(LinkResourceService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(FlowStatisticService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(StatisticService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PathService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(TopologyService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PersistenceService.class.getName(), ServicePermission.GET));
// permSet.add(new ServicePermission(ApiDocService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(ClusterCommunicationService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(MessagingService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(PartitionService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(LogicalClockService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(StorageService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(UiExtensionService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(UpgradeService.class.getName(), ServicePermission.GET));
permSet.add(new ServicePermission(UpgradeAdminService.class.getName(), ServicePermission.GET));
return permSet;
}