当前位置: 首页>>代码示例>>Java>>正文


Java Device.Type方法代码示例

本文整理汇总了Java中org.onosproject.net.Device.Type方法的典型用法代码示例。如果您正苦于以下问题:Java Device.Type方法的具体用法?Java Device.Type怎么用?Java Device.Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.net.Device的用法示例。


在下文中一共展示了Device.Type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: routerAdded

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Override
public void routerAdded(IsisRouter isisRouter) {
    String systemId = isisRouter.systemId();
    log.info("Added device {}", systemId);
    DeviceId deviceId = DeviceId.deviceId(IsisRouterId.uri(systemId));
    Device.Type deviceType = Device.Type.ROUTER;
    //If our routerType is Dr or Bdr type is PSEUDO
    if (isisRouter.isDis()) {
        deviceType = Device.Type.ROUTER;
    } else {
        deviceType = Device.Type.VIRTUAL;
    }
    ChassisId cId = new ChassisId();
    DefaultAnnotations.Builder newBuilder = DefaultAnnotations.builder();
    newBuilder.set(AnnotationKeys.TYPE, "L3");
    newBuilder.set("RouterId", systemId);
    DeviceDescription description =
            new DefaultDeviceDescription(IsisRouterId.uri(systemId), deviceType, UNKNOWN, UNKNOWN, UNKNOWN,
                                         UNKNOWN, cId, newBuilder.build());
    deviceProviderService.deviceConnected(deviceId, description);
    System.out.println("Device added: " + systemId);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:IsisTopologyProvider.java

示例2: updateDeviceTypeRule

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Test
public void updateDeviceTypeRule() {
    Device.Type deviceType1 = Device.Type.ROADM;
    Device.Type deviceType2 = Device.Type.SWITCH;
    Set<Device.Type> deviceTypes = new HashSet<>();

    deviceTypes.add(deviceType1);
    cfg.deviceTypes(deviceTypes);

    configEvent(NetworkConfigEvent.Type.CONFIG_ADDED);

    deviceTypes.add(deviceType2);
    cfg.deviceTypes(deviceTypes);

    configEvent(NetworkConfigEvent.Type.CONFIG_UPDATED);

    assertAfter(EVENT_MS, () -> {
        assertTrue(provider.rules().getSuppressedDeviceType().contains(deviceType1));
        assertTrue(provider.rules().getSuppressedDeviceType().contains(deviceType2));
    });
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:LldpLinkProviderTest.java

示例3: deviceType

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Override
public Device.Type deviceType() {
    String hwDesc = hardwareDescription();
    switch (hwDesc) {
        case "Optical-ROADM":
            return Device.Type.ROADM;
        case "Optical-OTN":
            return Device.Type.OTN;
        default:
            log.error("Unsupported hardwareDescription {}", hwDesc);
            return Device.Type.OTHER;
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:OFOpticalSwitch13.java

示例4: switchAdded

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Override
public void switchAdded(PcepDpid dpid) {
    if (deviceProviderService == null) {
        return;
    }
    DeviceId deviceId = deviceId(uri(dpid));
    PcepSwitch sw = controller.getSwitch(dpid);
    checkNotNull(sw, "device should not null.");
    // The default device type is switch.
    ChassisId cId = new ChassisId(dpid.value());
    Device.Type deviceType;

    switch (sw.getDeviceType()) {
        case ROADM:
            deviceType = Device.Type.ROADM;
            break;
        case OTN:
            deviceType = Device.Type.SWITCH;
            break;
        case ROUTER:
            deviceType = Device.Type.ROUTER;
            break;
        default:
            deviceType = Device.Type.OTHER;
    }

    DeviceDescription description = new DefaultDeviceDescription(
            deviceId.uri(),
            deviceType,
            sw.manufacturerDescription(),
            sw.hardwareDescription(),
            sw.softwareDescription(),
            sw.serialNumber(),
            cId);
    deviceProviderService.deviceConnected(deviceId, description);

}
 
开发者ID:shlee89,项目名称:athena,代码行数:38,代码来源:PcepTopologyProvider.java

示例5: isCrossConnectLink

import org.onosproject.net.Device; //导入方法依赖的package包/类
/**
 * Verifies if given link forms a cross-connection between packet and optical layer.
 *
 * @param link the link
 * @return true if the link is a cross-connect link, false otherwise
 */
private boolean isCrossConnectLink(Link link) {
    if (link.type() != Link.Type.OPTICAL) {
        return false;
    }

    Device.Type src = deviceService.getDevice(link.src().deviceId()).type();
    Device.Type dst = deviceService.getDevice(link.dst().deviceId()).type();

    return src != dst &&
            ((isPacketLayer(src) && isTransportLayer(dst)) || (isPacketLayer(dst) && isTransportLayer(src)));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OpticalPathProvisioner.java

示例6: addDeviceTypeRule

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Test
public void addDeviceTypeRule() {
    Device.Type deviceType1 = Device.Type.ROADM;
    Device.Type deviceType2 = Device.Type.SWITCH;

    Set<Device.Type> deviceTypes = new HashSet<>();
    deviceTypes.add(deviceType1);

    cfg.deviceTypes(deviceTypes);

    configEvent(NetworkConfigEvent.Type.CONFIG_ADDED);

    assertTrue(provider.rules().getSuppressedDeviceType().contains(deviceType1));
    assertFalse(provider.rules().getSuppressedDeviceType().contains(deviceType2));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:LldpLinkProviderTest.java

示例7: deviceType

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Override
public Device.Type deviceType() {
    return Device.Type.ROADM;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:OplinkRoadmHandshaker.java

示例8: deviceType

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Override
public Device.Type deviceType() {
    return Device.Type.FIBER_SWITCH;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:CalientFiberSwitchHandshaker.java

示例9: deviceType

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Override
public Device.Type deviceType() {
    return Device.Type.SWITCH;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:AbstractOpenFlowSwitch.java

示例10: getSuppressedDeviceType

import org.onosproject.net.Device; //导入方法依赖的package包/类
Set<Device.Type> getSuppressedDeviceType() {
    return suppressedDeviceType;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:4,代码来源:SuppressionRules.java

示例11: deviceTypes

import org.onosproject.net.Device; //导入方法依赖的package包/类
@Override
public Set<Device.Type> deviceTypes() {
    return ImmutableSet.copyOf(deviceTypes);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:LldpLinkProviderTest.java

示例12: type

import org.onosproject.net.Device; //导入方法依赖的package包/类
/**
 * Returns the device type.
 *
 * @return device type override
 */
public Device.Type type() {
    return get(TYPE, Device.Type.SWITCH, Device.Type.class);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:BasicDeviceConfig.java

示例13: isTransportLayer

import org.onosproject.net.Device; //导入方法依赖的package包/类
/**
 * Verifies if given device type is in packet layer, i.e., switch or router device.
 *
 * @param type device type
 * @return true if in packet layer, false otherwise
 */
private boolean isTransportLayer(Device.Type type) {
    return type == Device.Type.ROADM || type == Device.Type.OTN || type == Device.Type.ROADM_OTN;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:10,代码来源:OpticalPathProvisioner.java

示例14: deviceType

import org.onosproject.net.Device; //导入方法依赖的package包/类
/**
 * Returns the switch device type.
 *
 * @return device type
 */
Device.Type deviceType();
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:OpenFlowSwitch.java

示例15: getDevices

import org.onosproject.net.Device; //导入方法依赖的package包/类
/**
 * Returns a collection of the currently known infrastructure
 * devices by device type.
 *
 * @param type device type
 * @return collection of devices
 */
Iterable<Device> getDevices(Device.Type type);
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:DeviceService.java


注:本文中的org.onosproject.net.Device.Type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。