Search in sources :

Example 6 with OvsdbNodeId

use of org.onosproject.ovsdb.controller.OvsdbNodeId in project onos by opennetworkinglab.

the class OvsdbPortConfig method changeDeviceIdToNodeId.

// OvsdbNodeId(IP) is used in the adaptor while DeviceId(ovsdb:IP)
// is used in the core. So DeviceId need be changed to OvsdbNodeId.
private OvsdbNodeId changeDeviceIdToNodeId(DeviceId deviceId) {
    String[] splits = deviceId.toString().split(":");
    if (splits.length < 1) {
        return null;
    }
    IpAddress ipAddress = IpAddress.valueOf(splits[1]);
    return new OvsdbNodeId(ipAddress, 0);
}
Also used : IpAddress(org.onlab.packet.IpAddress) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId)

Example 7 with OvsdbNodeId

use of org.onosproject.ovsdb.controller.OvsdbNodeId in project onos by opennetworkinglab.

the class OvsdbPortConfig method getOvsdbClient.

private OvsdbClientService getOvsdbClient(DriverHandler handler) {
    OvsdbController ovsController = handler.get(OvsdbController.class);
    OvsdbNodeId nodeId = changeDeviceIdToNodeId(handler.data().deviceId());
    return ovsController.getOvsdbClient(nodeId);
}
Also used : OvsdbController(org.onosproject.ovsdb.controller.OvsdbController) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId)

Example 8 with OvsdbNodeId

use of org.onosproject.ovsdb.controller.OvsdbNodeId in project onos by opennetworkinglab.

the class OvsdbQueueConfig method changeDeviceIdToNodeId.

// OvsdbNodeId(IP) is used in the adaptor while DeviceId(ovsdb:IP)
// is used in the core. So DeviceId need be changed to OvsdbNodeId.
private OvsdbNodeId changeDeviceIdToNodeId(DeviceId deviceId) {
    String[] splits = deviceId.toString().split(":");
    if (splits.length < 1) {
        return null;
    }
    IpAddress ipAddress = IpAddress.valueOf(splits[1]);
    return new OvsdbNodeId(ipAddress, 0);
}
Also used : IpAddress(org.onlab.packet.IpAddress) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId)

Example 9 with OvsdbNodeId

use of org.onosproject.ovsdb.controller.OvsdbNodeId in project onos by opennetworkinglab.

the class OvsdbQueueConfig method getOvsdbClient.

private OvsdbClientService getOvsdbClient(DriverHandler handler) {
    OvsdbController ovsController = handler.get(OvsdbController.class);
    OvsdbNodeId nodeId = changeDeviceIdToNodeId(handler.data().deviceId());
    return ovsController.getOvsdbClient(nodeId);
}
Also used : OvsdbController(org.onosproject.ovsdb.controller.OvsdbController) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId)

Example 10 with OvsdbNodeId

use of org.onosproject.ovsdb.controller.OvsdbNodeId in project onos by opennetworkinglab.

the class OvsdbBridgeConfig method changeDeviceIdToNodeId.

// OvsdbNodeId(IP) is used in the adaptor while DeviceId(ovsdb:IP)
// is used in the core. So DeviceId need be changed to OvsdbNodeId.
private OvsdbNodeId changeDeviceIdToNodeId(DeviceId deviceId) {
    String[] splits = deviceId.toString().split(":");
    if (splits == null || splits.length < 1) {
        return null;
    }
    IpAddress ipAddress = IpAddress.valueOf(splits[1]);
    return new OvsdbNodeId(ipAddress, 0);
}
Also used : IpAddress(org.onlab.packet.IpAddress) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId)

Aggregations

OvsdbNodeId (org.onosproject.ovsdb.controller.OvsdbNodeId)19 IpAddress (org.onlab.packet.IpAddress)10 OvsdbController (org.onosproject.ovsdb.controller.OvsdbController)8 DeviceId (org.onosproject.net.DeviceId)4 OvsdbClientService (org.onosproject.ovsdb.controller.OvsdbClientService)3 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)2 Preconditions.checkState (com.google.common.base.Preconditions.checkState)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Test (org.junit.Test)2 TpPort (org.onlab.packet.TpPort)2 Tools.delay (org.onlab.util.Tools.delay)2 AnnotationKeys (org.onosproject.net.AnnotationKeys)2 DeviceService (org.onosproject.net.device.DeviceService)2 AbstractHandlerBehaviour (org.onosproject.net.driver.AbstractHandlerBehaviour)2 DriverHandler (org.onosproject.net.driver.DriverHandler)2 OvsdbBridge (org.onosproject.ovsdb.controller.OvsdbBridge)2 OvsdbConstant (org.onosproject.ovsdb.controller.OvsdbConstant)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 ChannelFuture (io.netty.channel.ChannelFuture)1