本文整理汇总了Java中org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig类的典型用法代码示例。如果您正苦于以下问题:Java SegmentRoutingDeviceConfig类的具体用法?Java SegmentRoutingDeviceConfig怎么用?Java SegmentRoutingDeviceConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SegmentRoutingDeviceConfig类属于org.onosproject.segmentrouting.config包,在下文中一共展示了SegmentRoutingDeviceConfig类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isRelevant
import org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig; //导入依赖的package包/类
@Override
public boolean isRelevant(NetworkConfigEvent event) {
if (event.configClass().equals(SegmentRoutingDeviceConfig.class) ||
event.configClass().equals(SegmentRoutingAppConfig.class) ||
event.configClass().equals(InterfaceConfig.class) ||
event.configClass().equals(XConnectConfig.class) ||
event.configClass().equals(PwaasConfig.class)) {
return true;
}
log.debug("Ignore irrelevant event class {}", event.configClass().getName());
return false;
}
示例2: setUp
import org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
// Initialize pairDevice and pairLocalPort config
ObjectMapper mapper = new ObjectMapper();
ConfigApplyDelegate delegate = config -> { };
SegmentRoutingDeviceConfig dev3Config = new SegmentRoutingDeviceConfig();
JsonNode dev3Tree = mapper.createObjectNode();
dev3Config.init(DEV3, "host-handler-test", dev3Tree, mapper, delegate);
dev3Config.setPairDeviceId(DEV4).setPairLocalPort(P9);
SegmentRoutingDeviceConfig dev4Config = new SegmentRoutingDeviceConfig();
JsonNode dev4Tree = mapper.createObjectNode();
dev4Config.init(DEV4, "host-handler-test", dev4Tree, mapper, delegate);
dev4Config.setPairDeviceId(DEV3).setPairLocalPort(P9);
MockNetworkConfigRegistry mockNetworkConfigRegistry = new MockNetworkConfigRegistry();
mockNetworkConfigRegistry.applyConfig(dev3Config);
mockNetworkConfigRegistry.applyConfig(dev4Config);
// Initialize Segment Routing Manager
SegmentRoutingManager srManager = new MockSegmentRoutingManager(NEXT_TABLE);
srManager.cfgService = new NetworkConfigRegistryAdapter();
srManager.deviceConfiguration = new DeviceConfiguration(srManager);
srManager.flowObjectiveService = new MockFlowObjectiveService(BRIDGING_TABLE, NEXT_TABLE);
srManager.routingRulePopulator = new MockRoutingRulePopulator(srManager, ROUTING_TABLE);
srManager.defaultRoutingHandler = new MockDefaultRoutingHandler(srManager, SUBNET_TABLE);
srManager.interfaceService = new MockInterfaceService(INTERFACES);
srManager.mastershipService = new MockMastershipService(LOCAL_DEVICES);
srManager.hostService = new MockHostService(HOSTS);
srManager.cfgService = mockNetworkConfigRegistry;
mockLocationProbingService = new MockLocationProbingService();
srManager.probingService = mockLocationProbingService;
srManager.linkHandler = new MockLinkHandler(srManager);
hostHandler = new HostHandler(srManager);
ROUTING_TABLE.clear();
BRIDGING_TABLE.clear();
}
示例3: createConfig
import org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig; //导入依赖的package包/类
@Override
public SegmentRoutingDeviceConfig createConfig() {
return new SegmentRoutingDeviceConfig();
}
示例4: setUp
import org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
ObjectMapper mapper = new ObjectMapper();
ConfigApplyDelegate delegate = config -> { };
SegmentRoutingDeviceConfig dev1Config = new SegmentRoutingDeviceConfig();
JsonNode dev1Tree = mapper.createObjectNode();
dev1Config.init(CP1.deviceId(), "host-handler-test", dev1Tree, mapper, delegate);
dev1Config.setPairDeviceId(CP2.deviceId()).setPairLocalPort(P9);
SegmentRoutingDeviceConfig dev2Config = new SegmentRoutingDeviceConfig();
JsonNode dev2Tree = mapper.createObjectNode();
dev2Config.init(CP2.deviceId(), "host-handler-test", dev2Tree, mapper, delegate);
dev2Config.setPairDeviceId(CP1.deviceId()).setPairLocalPort(P9);
MockNetworkConfigRegistry mockNetworkConfigRegistry = new MockNetworkConfigRegistry();
mockNetworkConfigRegistry.applyConfig(dev1Config);
mockNetworkConfigRegistry.applyConfig(dev2Config);
// Initialize Segment Routing Manager
SegmentRoutingManager srManager = new MockSegmentRoutingManager(NEXT_TABLE);
srManager.cfgService = new NetworkConfigRegistryAdapter();
srManager.deviceConfiguration = new DeviceConfiguration(srManager);
srManager.flowObjectiveService = new MockFlowObjectiveService(BRIDGING_TABLE, NEXT_TABLE);
srManager.routingRulePopulator = new MockRoutingRulePopulator(srManager, ROUTING_TABLE);
srManager.defaultRoutingHandler = new MockDefaultRoutingHandler(srManager, SUBNET_TABLE);
srManager.interfaceService = new MockInterfaceService(INTERFACES);
srManager.mastershipService = new MockMastershipService(LOCAL_DEVICES);
hostService = new MockHostService(HOSTS);
srManager.hostService = hostService;
srManager.cfgService = mockNetworkConfigRegistry;
srManager.routeService = new MockRouteService(ROUTING_TABLE);
routeHandler = new RouteHandler(srManager) {
// routeEventCache is not necessary for unit tests
@Override
void enqueueRouteEvent(RouteEvent routeEvent) {
dequeueRouteEvent(routeEvent);
}
};
ROUTING_TABLE.clear();
BRIDGING_TABLE.clear();
SUBNET_TABLE.clear();
}
示例5: getPairDeviceId
import org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig; //导入依赖的package包/类
/**
* Returns optional pair device ID of given device.
*
* @param deviceId device ID
* @return optional pair device ID. Might be empty if pair device is not configured
*/
Optional<DeviceId> getPairDeviceId(DeviceId deviceId) {
SegmentRoutingDeviceConfig deviceConfig =
cfgService.getConfig(deviceId, SegmentRoutingDeviceConfig.class);
return Optional.ofNullable(deviceConfig).map(SegmentRoutingDeviceConfig::pairDeviceId);
}
示例6: getPairLocalPorts
import org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig; //导入依赖的package包/类
/**
* Returns optional pair device local port of given device.
*
* @param deviceId device ID
* @return optional pair device ID. Might be empty if pair device is not configured
*/
Optional<PortNumber> getPairLocalPorts(DeviceId deviceId) {
SegmentRoutingDeviceConfig deviceConfig =
cfgService.getConfig(deviceId, SegmentRoutingDeviceConfig.class);
return Optional.ofNullable(deviceConfig).map(SegmentRoutingDeviceConfig::pairLocalPort);
}