Search in sources :

Example 66 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class LinkOperationsBolt method bfdPropertiesWrite.

private BfdPropertiesResponse bfdPropertiesWrite(BfdPropertiesWriteRequest request) {
    Endpoint source = new Endpoint(request.getSource());
    Endpoint destination = new Endpoint(request.getDestination());
    try {
        return linkOperationsService.writeBfdProperties(source, destination, request.getProperties());
    } catch (IslNotFoundException e) {
        throw new MessageException(ErrorType.NOT_FOUND, e.getMessage(), "ISL was not found.");
    }
}
Also used : IslEndpoint(org.openkilda.model.IslEndpoint) Endpoint(org.openkilda.wfm.share.model.Endpoint) MessageException(org.openkilda.messaging.error.MessageException) IslNotFoundException(org.openkilda.wfm.error.IslNotFoundException)

Example 67 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class NetworkBfdLogicalPortService method removeController.

private void removeController(BfdLogicalPortFsm controller) {
    final Endpoint logical = controller.getLogicalEndpoint();
    final Endpoint physical = controller.getPhysicalEndpoint();
    controllerByEndpoint.remove(logical);
    controllerByEndpoint.remove(physical);
    log.debug("BFD logical port controller {} pysical-port={} have done it's jobs and been deleted", logical, physical.getPortNumber());
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint)

Example 68 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class NetworkBfdLogicalPortService method portAdd.

/**
 * Handle BFD logical port add notification.
 */
public void portAdd(Endpoint logical, int physicalPortNumber) {
    logServiceCall("PORT-ADD logical={}, physical-port={}", logical, physicalPortNumber);
    Endpoint physical = Endpoint.of(logical.getDatapath(), physicalPortNumber);
    BfdLogicalPortFsm controller = lookupControllerCreateIfMissing(physical, logical.getPortNumber());
    handle(controller, Event.PORT_ADD);
}
Also used : Endpoint(org.openkilda.wfm.share.model.Endpoint) BfdLogicalPortFsm(org.openkilda.wfm.topology.network.controller.bfd.BfdLogicalPortFsm)

Example 69 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class IslHandler method islChangedNotifyFlowMonitor.

@Override
public void islChangedNotifyFlowMonitor(IslReference reference, boolean removed) {
    Endpoint src = reference.getSource();
    Endpoint dst = reference.getDest();
    IslChangedInfoData islChangedInfoData = IslChangedInfoData.builder().source(new NetworkEndpoint(src.getDatapath(), src.getPortNumber())).destination(new NetworkEndpoint(dst.getDatapath(), dst.getPortNumber())).removed(removed).build();
    emit(STREAM_FLOW_MONITORING_ID, getCurrentTuple(), makeIslChangedTuple(islChangedInfoData));
}
Also used : IslChangedInfoData(org.openkilda.messaging.info.event.IslChangedInfoData) NetworkEndpoint(org.openkilda.messaging.model.NetworkEndpoint) Endpoint(org.openkilda.wfm.share.model.Endpoint) NetworkEndpoint(org.openkilda.messaging.model.NetworkEndpoint)

Example 70 with Endpoint

use of org.openkilda.wfm.share.model.Endpoint in project open-kilda by telstra.

the class NetworkWatcherService method addWatch.

void addWatch(Endpoint endpoint, long currentTime) {
    Packet packet = Packet.of(endpoint, packetNo);
    log.debug("Watcher service receive ADD-watch request for {} and produce packet id:{} task:{}", endpoint, packet.packetNo, taskId);
    discoveryPackets.add(packet);
    roundTripPackets.add(packet);
    timeouts.computeIfAbsent(currentTime + awaitTime, key -> new HashSet<>()).add(packet);
    DiscoverIslCommandData discoveryRequest = new DiscoverIslCommandData(endpoint.getDatapath(), endpoint.getPortNumber(), packetNo);
    carrier.sendDiscovery(discoveryRequest);
    packetNo += 1;
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) HashSet(java.util.HashSet) Slf4j(lombok.extern.slf4j.Slf4j) IslInfoData(org.openkilda.messaging.info.event.IslInfoData) TreeMap(java.util.TreeMap) Endpoint(org.openkilda.wfm.share.model.Endpoint) Set(java.util.Set) VisibleForTesting(com.google.common.annotations.VisibleForTesting) SortedMap(java.util.SortedMap) DiscoverIslCommandData(org.openkilda.messaging.command.discovery.DiscoverIslCommandData) Value(lombok.Value) DiscoverIslCommandData(org.openkilda.messaging.command.discovery.DiscoverIslCommandData) HashSet(java.util.HashSet)

Aggregations

Endpoint (org.openkilda.wfm.share.model.Endpoint)72 Test (org.junit.Test)33 Isl (org.openkilda.model.Isl)17 IslInfoData (org.openkilda.messaging.info.event.IslInfoData)13 SwitchId (org.openkilda.model.SwitchId)10 Switch (org.openkilda.model.Switch)8 IslReference (org.openkilda.wfm.share.model.IslReference)8 PathNode (org.openkilda.messaging.info.event.PathNode)7 Instant (java.time.Instant)6 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)6 HashSet (java.util.HashSet)4 Set (java.util.Set)4 DiscoverIslCommandData (org.openkilda.messaging.command.discovery.DiscoverIslCommandData)4 IslNotFoundException (org.openkilda.wfm.error.IslNotFoundException)4 Values (org.apache.storm.tuple.Values)3 IslRoundTripLatency (org.openkilda.messaging.info.event.IslRoundTripLatency)3 InMemoryGraphBasedTest (org.openkilda.persistence.inmemory.InMemoryGraphBasedTest)3 CommandContext (org.openkilda.wfm.CommandContext)3 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 HashMap (java.util.HashMap)2