Search in sources :

Example 1 with OvsdbPortName

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

the class DefaultOvsdbClient method getPortError.

@Override
public boolean getPortError(List<OvsdbPortName> portNames, DeviceId bridgeId) {
    Uuid bridgeUuid = getBridgeUuid(bridgeId);
    List<Interface> interfaceList = portNames.stream().collect(Collectors.toMap(java.util.function.Function.identity(), port -> (Interface) getInterfacebyPort(getPortUuid(port.value(), bridgeUuid.value()), port.value()))).entrySet().stream().filter(intf -> Objects.nonNull(intf.getValue()) && ((OvsdbSet) intf.getValue().getOpenFlowPortColumn().data()).set().stream().findAny().orElse(OFPORT_ERROR_COMPARISON).equals(OFPORT_ERROR)).map(Map.Entry::getValue).collect(Collectors.toList());
    interfaceList.forEach(intf -> ((Consumer<Interface>) intf1 -> {
        try {
            Set<String> setErrors = ((OvsdbSet) intf1.getErrorColumn().data()).set();
            log.info("Port has errors. ofport value - {}, Interface - {} has error - {} ", intf1.getOpenFlowPortColumn().data(), intf1.getName(), setErrors.stream().findFirst().get());
        } catch (ColumnSchemaNotFoundException | VersionMismatchException e) {
            log.debug("Port has errors. ofport value - {}, Interface - {} has error - {} ", intf1.getOpenFlowPortColumn().data(), intf1.getName(), e);
        }
    }).accept(intf));
    return !interfaceList.isEmpty();
}
Also used : OvsdbSet(org.onosproject.ovsdb.rfc.notation.OvsdbSet) QUEUE_EXTERNAL_ID_KEY(org.onosproject.ovsdb.controller.OvsdbConstant.QUEUE_EXTERNAL_ID_KEY) Controller(org.onosproject.ovsdb.rfc.table.Controller) ColumnSchemaNotFoundException(org.onosproject.ovsdb.rfc.exception.ColumnSchemaNotFoundException) OFPORT(org.onosproject.ovsdb.controller.OvsdbConstant.OFPORT) PortNumber(org.onosproject.net.PortNumber) QueueId(org.onosproject.net.behaviour.QueueId) FromJsonUtil(org.onosproject.ovsdb.rfc.utils.FromJsonUtil) Map(java.util.Map) JsonNode(com.fasterxml.jackson.databind.JsonNode) Update(org.onosproject.ovsdb.rfc.operations.Update) Qos(org.onosproject.ovsdb.rfc.table.Qos) Callback(org.onosproject.ovsdb.rfc.jsonrpc.Callback) Set(java.util.Set) MIRRORS(org.onosproject.ovsdb.controller.OvsdbConstant.MIRRORS) OvsdbQueue(org.onosproject.ovsdb.controller.OvsdbQueue) Bridge(org.onosproject.ovsdb.rfc.table.Bridge) MIRROR(org.onosproject.ovsdb.controller.OvsdbConstant.MIRROR) Mirror(org.onosproject.ovsdb.rfc.table.Mirror) OvsdbPort(org.onosproject.ovsdb.controller.OvsdbPort) OperationResult(org.onosproject.ovsdb.rfc.message.OperationResult) OvsdbStore(org.onosproject.ovsdb.controller.OvsdbStore) DeviceId(org.onosproject.net.DeviceId) DATABASENAME(org.onosproject.ovsdb.controller.OvsdbConstant.DATABASENAME) Interface(org.onosproject.ovsdb.rfc.table.Interface) JsonRpcWriterUtil(org.onosproject.ovsdb.rfc.utils.JsonRpcWriterUtil) MirroringStatistics(org.onosproject.net.behaviour.MirroringStatistics) PORTS(org.onosproject.ovsdb.controller.OvsdbConstant.PORTS) ArrayList(java.util.ArrayList) DeviceCpuStats(org.onosproject.net.behaviour.DeviceCpuStats) Lists(com.google.common.collect.Lists) OvsdbInterface(org.onosproject.ovsdb.controller.OvsdbInterface) INTERFACE(org.onosproject.ovsdb.controller.OvsdbConstant.INTERFACE) BRIDGE_CONTROLLER(org.onosproject.ovsdb.controller.OvsdbConstant.BRIDGE_CONTROLLER) OvsdbPortName(org.onosproject.ovsdb.controller.OvsdbPortName) QUEUE(org.onosproject.ovsdb.controller.OvsdbConstant.QUEUE) QosId(org.onosproject.net.behaviour.QosId) OvsdbRowStore(org.onosproject.ovsdb.controller.OvsdbRowStore) EXTERNAL_ID(org.onosproject.ovsdb.controller.OvsdbConstant.EXTERNAL_ID) EXTERNAL_ID_INTERFACE_ID(org.onosproject.ovsdb.controller.OvsdbConstant.EXTERNAL_ID_INTERFACE_ID) Uuid(org.onosproject.ovsdb.rfc.notation.Uuid) OvsdbTable(org.onosproject.ovsdb.rfc.table.OvsdbTable) Channel(io.netty.channel.Channel) ExecutionException(java.util.concurrent.ExecutionException) Futures(com.google.common.util.concurrent.Futures) OvsdbBridge(org.onosproject.ovsdb.controller.OvsdbBridge) Column(org.onosproject.ovsdb.rfc.notation.Column) MutationUtil(org.onosproject.ovsdb.rfc.utils.MutationUtil) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) Row(org.onosproject.ovsdb.rfc.notation.Row) CONTROLLER(org.onosproject.ovsdb.controller.OvsdbConstant.CONTROLLER) TableGenerator(org.onosproject.ovsdb.rfc.table.TableGenerator) ControlProtocolVersion(org.onosproject.net.behaviour.ControlProtocolVersion) Mutation(org.onosproject.ovsdb.rfc.notation.Mutation) OvsdbPortNumber(org.onosproject.ovsdb.controller.OvsdbPortNumber) OvsdbTableStore(org.onosproject.ovsdb.controller.OvsdbTableStore) QOS_EXTERNAL_ID_KEY(org.onosproject.ovsdb.controller.OvsdbConstant.QOS_EXTERNAL_ID_KEY) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) SettableFuture(com.google.common.util.concurrent.SettableFuture) DeviceMemoryStats(org.onosproject.net.behaviour.DeviceMemoryStats) QUEUES(org.onosproject.ovsdb.controller.OvsdbConstant.QUEUES) Delete(org.onosproject.ovsdb.rfc.operations.Delete) UUID(org.onosproject.ovsdb.controller.OvsdbConstant.UUID) ConditionUtil(org.onosproject.ovsdb.rfc.utils.ConditionUtil) Function(com.google.common.base.Function) ImmutableSet(com.google.common.collect.ImmutableSet) OFPORT_ERROR(org.onosproject.ovsdb.controller.OvsdbConstant.OFPORT_ERROR) TYPEVXLAN(org.onosproject.ovsdb.controller.OvsdbConstant.TYPEVXLAN) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Operation(org.onosproject.ovsdb.rfc.operations.Operation) Objects(java.util.Objects) List(java.util.List) Optional(java.util.Optional) Queue(org.onosproject.ovsdb.rfc.table.Queue) OvsdbQos(org.onosproject.ovsdb.controller.OvsdbQos) Insert(org.onosproject.ovsdb.rfc.operations.Insert) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId) OvsdbMirror(org.onosproject.ovsdb.controller.OvsdbMirror) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) ConcurrentMap(java.util.concurrent.ConcurrentMap) BRIDGE(org.onosproject.ovsdb.controller.OvsdbConstant.BRIDGE) OvsdbMap(org.onosproject.ovsdb.rfc.notation.OvsdbMap) HashSet(java.util.HashSet) PORT(org.onosproject.ovsdb.controller.OvsdbConstant.PORT) ImmutableList(com.google.common.collect.ImmutableList) TableUpdates(org.onosproject.ovsdb.rfc.message.TableUpdates) OvsdbSet(org.onosproject.ovsdb.rfc.notation.OvsdbSet) PORT_QOS(org.onosproject.ovsdb.controller.OvsdbConstant.PORT_QOS) DatabaseSchema(org.onosproject.ovsdb.rfc.schema.DatabaseSchema) TableSchema(org.onosproject.ovsdb.rfc.schema.TableSchema) ColumnSchema(org.onosproject.ovsdb.rfc.schema.ColumnSchema) IpAddress(org.onlab.packet.IpAddress) Port(org.onosproject.ovsdb.rfc.table.Port) ControllerInfo(org.onosproject.net.behaviour.ControllerInfo) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) VersionMismatchException(org.onosproject.ovsdb.rfc.exception.VersionMismatchException) MirroringName(org.onosproject.net.behaviour.MirroringName) BRIDGES(org.onosproject.ovsdb.controller.OvsdbConstant.BRIDGES) Maps(com.google.common.collect.Maps) INTERFACES(org.onosproject.ovsdb.controller.OvsdbConstant.INTERFACES) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) QOS(org.onosproject.ovsdb.controller.OvsdbConstant.QOS) QueueDescription(org.onosproject.net.behaviour.QueueDescription) Mutate(org.onosproject.ovsdb.rfc.operations.Mutate) Collections(java.util.Collections) Condition(org.onosproject.ovsdb.rfc.notation.Condition) Uuid(org.onosproject.ovsdb.rfc.notation.Uuid) Set(java.util.Set) ImmutableSet(com.google.common.collect.ImmutableSet) HashSet(java.util.HashSet) OvsdbSet(org.onosproject.ovsdb.rfc.notation.OvsdbSet) Map(java.util.Map) HashMap(java.util.HashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) OvsdbMap(org.onosproject.ovsdb.rfc.notation.OvsdbMap) Interface(org.onosproject.ovsdb.rfc.table.Interface) OvsdbInterface(org.onosproject.ovsdb.controller.OvsdbInterface)

Example 2 with OvsdbPortName

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

the class DefaultOvsdbClient method getPorts.

@Override
public List<OvsdbPortName> getPorts(List<String> portNames, DeviceId deviceId) {
    Uuid bridgeUuid = getBridgeUuid(deviceId);
    if (bridgeUuid == null) {
        log.error("Can't find the bridge for the deviceId {}", deviceId);
        return Collections.emptyList();
    }
    DatabaseSchema dbSchema = schema.get(DATABASENAME);
    Row bridgeRow = getRow(DATABASENAME, BRIDGE, bridgeUuid.value());
    Bridge bridge = (Bridge) TableGenerator.getTable(dbSchema, bridgeRow, OvsdbTable.BRIDGE);
    if (bridge == null) {
        return Collections.emptyList();
    }
    OvsdbSet setPorts = (OvsdbSet) bridge.getPortsColumn().data();
    Set<Uuid> portSet = setPorts.set();
    if (portSet.isEmpty()) {
        return Collections.emptyList();
    }
    Map<Uuid, Port> portMap = portSet.stream().collect(Collectors.toMap(java.util.function.Function.identity(), port -> (Port) TableGenerator.getTable(dbSchema, getRow(DATABASENAME, PORT, port.value()), OvsdbTable.PORT)));
    List<OvsdbPortName> portList = portMap.entrySet().stream().filter(port -> Objects.nonNull(port.getValue()) && portNames.contains(port.getValue().getName()) && Objects.nonNull(getInterfacebyPort(port.getKey().value(), port.getValue().getName()))).map(port -> new OvsdbPortName(port.getValue().getName())).collect(Collectors.toList());
    return Collections.unmodifiableList(portList);
}
Also used : OvsdbSet(org.onosproject.ovsdb.rfc.notation.OvsdbSet) QUEUE_EXTERNAL_ID_KEY(org.onosproject.ovsdb.controller.OvsdbConstant.QUEUE_EXTERNAL_ID_KEY) Controller(org.onosproject.ovsdb.rfc.table.Controller) ColumnSchemaNotFoundException(org.onosproject.ovsdb.rfc.exception.ColumnSchemaNotFoundException) OFPORT(org.onosproject.ovsdb.controller.OvsdbConstant.OFPORT) PortNumber(org.onosproject.net.PortNumber) QueueId(org.onosproject.net.behaviour.QueueId) FromJsonUtil(org.onosproject.ovsdb.rfc.utils.FromJsonUtil) Map(java.util.Map) JsonNode(com.fasterxml.jackson.databind.JsonNode) Update(org.onosproject.ovsdb.rfc.operations.Update) Qos(org.onosproject.ovsdb.rfc.table.Qos) Callback(org.onosproject.ovsdb.rfc.jsonrpc.Callback) Set(java.util.Set) MIRRORS(org.onosproject.ovsdb.controller.OvsdbConstant.MIRRORS) OvsdbQueue(org.onosproject.ovsdb.controller.OvsdbQueue) Bridge(org.onosproject.ovsdb.rfc.table.Bridge) MIRROR(org.onosproject.ovsdb.controller.OvsdbConstant.MIRROR) Mirror(org.onosproject.ovsdb.rfc.table.Mirror) OvsdbPort(org.onosproject.ovsdb.controller.OvsdbPort) OperationResult(org.onosproject.ovsdb.rfc.message.OperationResult) OvsdbStore(org.onosproject.ovsdb.controller.OvsdbStore) DeviceId(org.onosproject.net.DeviceId) DATABASENAME(org.onosproject.ovsdb.controller.OvsdbConstant.DATABASENAME) Interface(org.onosproject.ovsdb.rfc.table.Interface) JsonRpcWriterUtil(org.onosproject.ovsdb.rfc.utils.JsonRpcWriterUtil) MirroringStatistics(org.onosproject.net.behaviour.MirroringStatistics) PORTS(org.onosproject.ovsdb.controller.OvsdbConstant.PORTS) ArrayList(java.util.ArrayList) DeviceCpuStats(org.onosproject.net.behaviour.DeviceCpuStats) Lists(com.google.common.collect.Lists) OvsdbInterface(org.onosproject.ovsdb.controller.OvsdbInterface) INTERFACE(org.onosproject.ovsdb.controller.OvsdbConstant.INTERFACE) BRIDGE_CONTROLLER(org.onosproject.ovsdb.controller.OvsdbConstant.BRIDGE_CONTROLLER) OvsdbPortName(org.onosproject.ovsdb.controller.OvsdbPortName) QUEUE(org.onosproject.ovsdb.controller.OvsdbConstant.QUEUE) QosId(org.onosproject.net.behaviour.QosId) OvsdbRowStore(org.onosproject.ovsdb.controller.OvsdbRowStore) EXTERNAL_ID(org.onosproject.ovsdb.controller.OvsdbConstant.EXTERNAL_ID) EXTERNAL_ID_INTERFACE_ID(org.onosproject.ovsdb.controller.OvsdbConstant.EXTERNAL_ID_INTERFACE_ID) Uuid(org.onosproject.ovsdb.rfc.notation.Uuid) OvsdbTable(org.onosproject.ovsdb.rfc.table.OvsdbTable) Channel(io.netty.channel.Channel) ExecutionException(java.util.concurrent.ExecutionException) Futures(com.google.common.util.concurrent.Futures) OvsdbBridge(org.onosproject.ovsdb.controller.OvsdbBridge) Column(org.onosproject.ovsdb.rfc.notation.Column) MutationUtil(org.onosproject.ovsdb.rfc.utils.MutationUtil) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) Row(org.onosproject.ovsdb.rfc.notation.Row) CONTROLLER(org.onosproject.ovsdb.controller.OvsdbConstant.CONTROLLER) TableGenerator(org.onosproject.ovsdb.rfc.table.TableGenerator) ControlProtocolVersion(org.onosproject.net.behaviour.ControlProtocolVersion) Mutation(org.onosproject.ovsdb.rfc.notation.Mutation) OvsdbPortNumber(org.onosproject.ovsdb.controller.OvsdbPortNumber) OvsdbTableStore(org.onosproject.ovsdb.controller.OvsdbTableStore) QOS_EXTERNAL_ID_KEY(org.onosproject.ovsdb.controller.OvsdbConstant.QOS_EXTERNAL_ID_KEY) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) SettableFuture(com.google.common.util.concurrent.SettableFuture) DeviceMemoryStats(org.onosproject.net.behaviour.DeviceMemoryStats) QUEUES(org.onosproject.ovsdb.controller.OvsdbConstant.QUEUES) Delete(org.onosproject.ovsdb.rfc.operations.Delete) UUID(org.onosproject.ovsdb.controller.OvsdbConstant.UUID) ConditionUtil(org.onosproject.ovsdb.rfc.utils.ConditionUtil) Function(com.google.common.base.Function) ImmutableSet(com.google.common.collect.ImmutableSet) OFPORT_ERROR(org.onosproject.ovsdb.controller.OvsdbConstant.OFPORT_ERROR) TYPEVXLAN(org.onosproject.ovsdb.controller.OvsdbConstant.TYPEVXLAN) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Operation(org.onosproject.ovsdb.rfc.operations.Operation) Objects(java.util.Objects) List(java.util.List) Optional(java.util.Optional) Queue(org.onosproject.ovsdb.rfc.table.Queue) OvsdbQos(org.onosproject.ovsdb.controller.OvsdbQos) Insert(org.onosproject.ovsdb.rfc.operations.Insert) MoreExecutors(com.google.common.util.concurrent.MoreExecutors) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId) OvsdbMirror(org.onosproject.ovsdb.controller.OvsdbMirror) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) ConcurrentMap(java.util.concurrent.ConcurrentMap) BRIDGE(org.onosproject.ovsdb.controller.OvsdbConstant.BRIDGE) OvsdbMap(org.onosproject.ovsdb.rfc.notation.OvsdbMap) HashSet(java.util.HashSet) PORT(org.onosproject.ovsdb.controller.OvsdbConstant.PORT) ImmutableList(com.google.common.collect.ImmutableList) TableUpdates(org.onosproject.ovsdb.rfc.message.TableUpdates) OvsdbSet(org.onosproject.ovsdb.rfc.notation.OvsdbSet) PORT_QOS(org.onosproject.ovsdb.controller.OvsdbConstant.PORT_QOS) DatabaseSchema(org.onosproject.ovsdb.rfc.schema.DatabaseSchema) TableSchema(org.onosproject.ovsdb.rfc.schema.TableSchema) ColumnSchema(org.onosproject.ovsdb.rfc.schema.ColumnSchema) IpAddress(org.onlab.packet.IpAddress) Port(org.onosproject.ovsdb.rfc.table.Port) ControllerInfo(org.onosproject.net.behaviour.ControllerInfo) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) VersionMismatchException(org.onosproject.ovsdb.rfc.exception.VersionMismatchException) MirroringName(org.onosproject.net.behaviour.MirroringName) BRIDGES(org.onosproject.ovsdb.controller.OvsdbConstant.BRIDGES) Maps(com.google.common.collect.Maps) INTERFACES(org.onosproject.ovsdb.controller.OvsdbConstant.INTERFACES) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) QOS(org.onosproject.ovsdb.controller.OvsdbConstant.QOS) QueueDescription(org.onosproject.net.behaviour.QueueDescription) Mutate(org.onosproject.ovsdb.rfc.operations.Mutate) Collections(java.util.Collections) Condition(org.onosproject.ovsdb.rfc.notation.Condition) Uuid(org.onosproject.ovsdb.rfc.notation.Uuid) OvsdbPort(org.onosproject.ovsdb.controller.OvsdbPort) Port(org.onosproject.ovsdb.rfc.table.Port) OvsdbPortName(org.onosproject.ovsdb.controller.OvsdbPortName) Row(org.onosproject.ovsdb.rfc.notation.Row) Bridge(org.onosproject.ovsdb.rfc.table.Bridge) OvsdbBridge(org.onosproject.ovsdb.controller.OvsdbBridge) DatabaseSchema(org.onosproject.ovsdb.rfc.schema.DatabaseSchema)

Example 3 with OvsdbPortName

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

the class DefaultOvsdbClient method getOvsdbPort.

private OvsdbPort getOvsdbPort(Row row) {
    DatabaseSchema dbSchema = getDatabaseSchema(DATABASENAME);
    Interface intf = (Interface) TableGenerator.getTable(dbSchema, row, OvsdbTable.INTERFACE);
    if (intf == null) {
        return null;
    }
    long ofPort = getOfPort(intf);
    String portName = intf.getName();
    if ((ofPort < 0) || (portName == null)) {
        return null;
    }
    return new OvsdbPort(new OvsdbPortNumber(ofPort), new OvsdbPortName(portName));
}
Also used : OvsdbPortNumber(org.onosproject.ovsdb.controller.OvsdbPortNumber) OvsdbPortName(org.onosproject.ovsdb.controller.OvsdbPortName) Interface(org.onosproject.ovsdb.rfc.table.Interface) OvsdbInterface(org.onosproject.ovsdb.controller.OvsdbInterface) OvsdbPort(org.onosproject.ovsdb.controller.OvsdbPort) DatabaseSchema(org.onosproject.ovsdb.rfc.schema.DatabaseSchema)

Example 4 with OvsdbPortName

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

the class OvsdbControllerImpl method dispatchInterfaceEvent.

/**
 * Dispatches event to the north.
 *
 * @param clientService OvsdbClientService instance
 * @param row           a new row
 * @param eventType     type of event
 * @param dbSchema      ovsdb database schema
 */
private void dispatchInterfaceEvent(OvsdbClientService clientService, Row row, Type eventType, DatabaseSchema dbSchema) {
    long dpid = getDataPathid(clientService, dbSchema);
    Interface intf = (Interface) TableGenerator.getTable(dbSchema, row, OvsdbTable.INTERFACE);
    if (intf == null) {
        return;
    }
    String portType = (String) intf.getTypeColumn().data();
    long localPort = getOfPort(intf);
    if (localPort < 0) {
        return;
    }
    String[] macAndIfaceId = getMacAndIfaceid(intf);
    if (macAndIfaceId == null) {
        return;
    }
    EventSubject eventSubject = new DefaultEventSubject(MacAddress.valueOf(macAndIfaceId[0]), new HashSet<>(), new OvsdbPortName(intf.getName()), new OvsdbPortNumber(localPort), new OvsdbDatapathId(Long.toString(dpid)), new OvsdbPortType(portType), new OvsdbIfaceId(macAndIfaceId[1]));
    for (OvsdbEventListener listener : ovsdbEventListener) {
        listener.handle(new OvsdbEvent<>(eventType, eventSubject));
    }
}
Also used : DefaultEventSubject(org.onosproject.ovsdb.controller.DefaultEventSubject) OvsdbPortName(org.onosproject.ovsdb.controller.OvsdbPortName) OvsdbPortNumber(org.onosproject.ovsdb.controller.OvsdbPortNumber) DefaultEventSubject(org.onosproject.ovsdb.controller.DefaultEventSubject) EventSubject(org.onosproject.ovsdb.controller.EventSubject) OvsdbDatapathId(org.onosproject.ovsdb.controller.OvsdbDatapathId) OvsdbEventListener(org.onosproject.ovsdb.controller.OvsdbEventListener) OvsdbPortType(org.onosproject.ovsdb.controller.OvsdbPortType) OvsdbIfaceId(org.onosproject.ovsdb.controller.OvsdbIfaceId) Interface(org.onosproject.ovsdb.rfc.table.Interface)

Example 5 with OvsdbPortName

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

the class OvsdbHostProviderTest method portRemoved.

@Test
public void portRemoved() {
    DefaultEventSubject eventSubject = new DefaultEventSubject(MAC, null, new OvsdbPortName("portName"), new OvsdbPortNumber(0L), new OvsdbDatapathId("10002"), new OvsdbPortType("vxlan"), new OvsdbIfaceId("102345"));
    controller.ovsdbEventListener.handle(new OvsdbEvent<EventSubject>(OvsdbEvent.Type.PORT_REMOVED, eventSubject));
    assertEquals("port status unhandled", 1, providerService.removeCount);
}
Also used : DefaultEventSubject(org.onosproject.ovsdb.controller.DefaultEventSubject) OvsdbPortType(org.onosproject.ovsdb.controller.OvsdbPortType) OvsdbIfaceId(org.onosproject.ovsdb.controller.OvsdbIfaceId) OvsdbPortName(org.onosproject.ovsdb.controller.OvsdbPortName) OvsdbPortNumber(org.onosproject.ovsdb.controller.OvsdbPortNumber) OvsdbDatapathId(org.onosproject.ovsdb.controller.OvsdbDatapathId) DefaultEventSubject(org.onosproject.ovsdb.controller.DefaultEventSubject) EventSubject(org.onosproject.ovsdb.controller.EventSubject) Test(org.junit.Test)

Aggregations

OvsdbPortName (org.onosproject.ovsdb.controller.OvsdbPortName)7 OvsdbPortNumber (org.onosproject.ovsdb.controller.OvsdbPortNumber)7 Interface (org.onosproject.ovsdb.rfc.table.Interface)5 OvsdbInterface (org.onosproject.ovsdb.controller.OvsdbInterface)4 OvsdbPort (org.onosproject.ovsdb.controller.OvsdbPort)4 DatabaseSchema (org.onosproject.ovsdb.rfc.schema.DatabaseSchema)4 HashSet (java.util.HashSet)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 Function (com.google.common.base.Function)2 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 Lists (com.google.common.collect.Lists)2 Maps (com.google.common.collect.Maps)2 Sets (com.google.common.collect.Sets)2 Futures (com.google.common.util.concurrent.Futures)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)2 MoreExecutors (com.google.common.util.concurrent.MoreExecutors)2 SettableFuture (com.google.common.util.concurrent.SettableFuture)2 Channel (io.netty.channel.Channel)2 InetSocketAddress (java.net.InetSocketAddress)2