Search in sources :

Example 1 with IslBuilder

use of org.openkilda.model.Isl.IslBuilder in project open-kilda by telstra.

the class IslFsm method createIsl.

private Isl createIsl(Anchor source, Anchor dest, Instant timeNow) {
    final Endpoint sourceEndpoint = source.getEndpoint();
    final Endpoint destEndpoint = dest.getEndpoint();
    IslBuilder islBuilder = Isl.builder().srcSwitch(source.getSw()).srcPort(sourceEndpoint.getPortNumber()).destSwitch(dest.getSw()).destPort(destEndpoint.getPortNumber()).underMaintenance(source.getSw().isUnderMaintenance() || dest.getSw().isUnderMaintenance());
    initializeFromLinkProps(sourceEndpoint, destEndpoint, islBuilder);
    Isl link = islBuilder.build();
    log.info("Create new DB object (prefilled): {}", link);
    islRepository.add(link);
    return link;
}
Also used : IslBuilder(org.openkilda.model.Isl.IslBuilder) Isl(org.openkilda.model.Isl) Endpoint(org.openkilda.wfm.share.model.Endpoint)

Aggregations

Isl (org.openkilda.model.Isl)1 IslBuilder (org.openkilda.model.Isl.IslBuilder)1 Endpoint (org.openkilda.wfm.share.model.Endpoint)1