當前位置: 首頁>>代碼示例>>Java>>正文


Java SegmentRoutingDeviceConfig類代碼示例

本文整理匯總了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;
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:13,代碼來源:SegmentRoutingManager.java

示例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();
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:41,代碼來源:HostHandlerTest.java

示例3: createConfig

import org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig; //導入依賴的package包/類
@Override
public SegmentRoutingDeviceConfig createConfig() {
    return new SegmentRoutingDeviceConfig();
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:SegmentRoutingManager.java

示例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();
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:46,代碼來源:RouteHandlerTest.java

示例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);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:12,代碼來源:SegmentRoutingManager.java

示例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);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:12,代碼來源:SegmentRoutingManager.java


注:本文中的org.onosproject.segmentrouting.config.SegmentRoutingDeviceConfig類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。