Search in sources :

Example 1 with BfdPropertiesByEndpoint

use of org.openkilda.northbound.dto.v2.links.BfdPropertiesByEndpoint in project open-kilda by telstra.

the class LinkMapper method mapResponse.

/**
 * Convert {@link BfdPropertiesResponse} into {@link BfdPropertiesPayload}.
 */
@Mapping(target = "intervalMs", source = "properties.interval")
@Mapping(target = "multiplier", source = "properties.multiplier")
public BfdPropertiesPayload mapResponse(BfdPropertiesResponse response) {
    org.openkilda.northbound.dto.v2.links.BfdProperties properties = map(response.getGoal());
    BfdPropertiesByEndpoint effectiveSource = new BfdPropertiesByEndpoint(response.getSource(), map(response.getEffectiveSource()), map(response.getEffectiveSource().getStatus()));
    BfdPropertiesByEndpoint effectiveDestination = new BfdPropertiesByEndpoint(response.getDestination(), map(response.getEffectiveDestination()), map(response.getEffectiveDestination().getStatus()));
    return new BfdPropertiesPayload(properties, effectiveSource, effectiveDestination);
}
Also used : BfdPropertiesPayload(org.openkilda.northbound.dto.v2.links.BfdPropertiesPayload) BfdPropertiesByEndpoint(org.openkilda.northbound.dto.v2.links.BfdPropertiesByEndpoint) Mapping(org.mapstruct.Mapping)

Aggregations

Mapping (org.mapstruct.Mapping)1 BfdPropertiesByEndpoint (org.openkilda.northbound.dto.v2.links.BfdPropertiesByEndpoint)1 BfdPropertiesPayload (org.openkilda.northbound.dto.v2.links.BfdPropertiesPayload)1