use of org.openkilda.messaging.info.stats.YFlowStatsInfoFactory in project open-kilda by telstra.
the class YFlowProcessingFsm method newYFlowStatsInfoFactory.
private YFlowStatsInfoFactory newYFlowStatsInfoFactory(YFlowResources resources) throws InsufficientDataException {
YFlowResources.EndpointResources sharedEndpoint = resources.getSharedEndpointResources();
YFlowResources.EndpointResources yPoint = resources.getMainPathYPointResources();
String missing;
if (sharedEndpoint == null && yPoint == null) {
missing = "shared and y-point endpoints";
} else if (sharedEndpoint == null) {
missing = "shared endpoint";
} else if (yPoint == null) {
missing = "y-point endpoint";
} else {
missing = null;
}
if (missing != null) {
throw new InsufficientDataException(String.format("%s data are empty (is null)", missing));
}
return new YFlowStatsInfoFactory(getYFlowId(), new YFlowEndpointResources(sharedEndpoint.getEndpoint(), sharedEndpoint.getMeterId()), new YFlowEndpointResources(yPoint.getEndpoint(), yPoint.getMeterId()));
}
Aggregations