Search in sources :

Example 96 with DriverHandler

use of org.onosproject.net.driver.DriverHandler in project onos by opennetworkinglab.

the class OvsdbBridgeConfig method getPortNumbers.

@Override
public Set<PortNumber> getPortNumbers() {
    DriverHandler handler = handler();
    OvsdbClientService client = getOvsdbClientService(handler);
    if (client == null) {
        return Collections.emptySet();
    }
    Set<OvsdbPort> ports = client.getPorts();
    return ports.stream().map(x -> PortNumber.portNumber(x.portNumber().value(), x.portName().value())).collect(Collectors.toSet());
}
Also used : DefaultBridgeDescription(org.onosproject.net.behaviour.DefaultBridgeDescription) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId) BridgeDescription(org.onosproject.net.behaviour.BridgeDescription) Collection(java.util.Collection) BridgeName(org.onosproject.net.behaviour.BridgeName) PortNumber(org.onosproject.net.PortNumber) Set(java.util.Set) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) AbstractHandlerBehaviour(org.onosproject.net.driver.AbstractHandlerBehaviour) List(java.util.List) DefaultAnnotations(org.onosproject.net.DefaultAnnotations) DefaultPortDescription(org.onosproject.net.device.DefaultPortDescription) DriverHandler(org.onosproject.net.driver.DriverHandler) OvsdbController(org.onosproject.ovsdb.controller.OvsdbController) OvsdbBridge(org.onosproject.ovsdb.controller.OvsdbBridge) OvsdbPort(org.onosproject.ovsdb.controller.OvsdbPort) PortDescription(org.onosproject.net.device.PortDescription) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) DeviceId(org.onosproject.net.DeviceId) Collections(java.util.Collections) IpAddress(org.onlab.packet.IpAddress) BridgeConfig(org.onosproject.net.behaviour.BridgeConfig) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) DriverHandler(org.onosproject.net.driver.DriverHandler) OvsdbPort(org.onosproject.ovsdb.controller.OvsdbPort)

Example 97 with DriverHandler

use of org.onosproject.net.driver.DriverHandler in project onos by opennetworkinglab.

the class OvsdbMirroringConfig method getMirroringStatistics.

/**
 * Returns a collection of MirroringStatistics.
 *
 * @return statistics collection
 */
@Override
public Collection<MirroringStatistics> getMirroringStatistics() {
    DriverHandler handler = handler();
    OvsdbClientService ovsdbClient = getOvsdbClientService(handler);
    return ovsdbClient.getMirroringStatistics(handler.data().deviceId());
}
Also used : OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) DriverHandler(org.onosproject.net.driver.DriverHandler)

Example 98 with DriverHandler

use of org.onosproject.net.driver.DriverHandler in project onos by opennetworkinglab.

the class OvsdbMirroringConfig method deleteMirroring.

/**
 * Removes a mirroring.
 *
 * @param mirroringName mirroring name
 */
@Override
public void deleteMirroring(MirroringName mirroringName) {
    DriverHandler handler = handler();
    OvsdbClientService ovsdbClient = getOvsdbClientService(handler);
    ovsdbClient.dropMirror(mirroringName);
}
Also used : OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) DriverHandler(org.onosproject.net.driver.DriverHandler)

Example 99 with DriverHandler

use of org.onosproject.net.driver.DriverHandler in project onos by opennetworkinglab.

the class OFAgentVirtualFlowEntryBuilder method getDriver.

protected static DriverHandler getDriver(DeviceId devId, DriverService driverService) {
    log.debug("calling getDriver for {}", devId);
    Driver driver = driverService.getDriver(DRIVER_NAME);
    DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, devId));
    return handler;
}
Also used : DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) DriverHandler(org.onosproject.net.driver.DriverHandler) DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) Driver(org.onosproject.net.driver.Driver) DefaultDriverData(org.onosproject.net.driver.DefaultDriverData)

Example 100 with DriverHandler

use of org.onosproject.net.driver.DriverHandler in project onos by opennetworkinglab.

the class OFAgentVirtualGroupBucketEntryBuilder method getDriver.

/**
 * Retrieves the driver handler for the specified device.
 *
 * @param dpid datapath identifier
 * @return driver handler
 */
protected DriverHandler getDriver(Dpid dpid) {
    DeviceId devId = DeviceId.deviceId(Dpid.uri(dpid));
    log.debug("running getDriver for {}", devId);
    Driver driver = driverService.getDriver(DRIVER_NAME);
    DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, devId));
    return handler;
}
Also used : DeviceId(org.onosproject.net.DeviceId) DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) DriverHandler(org.onosproject.net.driver.DriverHandler) DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) Driver(org.onosproject.net.driver.Driver) DefaultDriverData(org.onosproject.net.driver.DefaultDriverData)

Aggregations

DriverHandler (org.onosproject.net.driver.DriverHandler)104 DeviceId (org.onosproject.net.DeviceId)46 DriverService (org.onosproject.net.driver.DriverService)22 NetconfController (org.onosproject.netconf.NetconfController)22 NetconfException (org.onosproject.netconf.NetconfException)22 MastershipService (org.onosproject.mastership.MastershipService)20 ArrayList (java.util.ArrayList)12 DefaultDriverHandler (org.onosproject.net.driver.DefaultDriverHandler)12 ItemNotFoundException (org.onlab.util.ItemNotFoundException)9 DeviceService (org.onosproject.net.device.DeviceService)9 OvsdbClientService (org.onosproject.ovsdb.controller.OvsdbClientService)9 DefaultDriverData (org.onosproject.net.driver.DefaultDriverData)8 Driver (org.onosproject.net.driver.Driver)8 Test (org.junit.Test)7 ControllerInfo (org.onosproject.net.behaviour.ControllerInfo)6 RestSBController (org.onosproject.protocol.rest.RestSBController)6 JsonNode (com.fasterxml.jackson.databind.JsonNode)5 ByteArrayInputStream (java.io.ByteArrayInputStream)5 PolicerConfigurable (org.onosproject.net.behaviour.trafficcontrol.PolicerConfigurable)5 PolicerId (org.onosproject.net.behaviour.trafficcontrol.PolicerId)5