use of org.openkilda.integration.model.response.IslLink in project open-kilda by telstra.
the class SwitchIntegrationService method getIslLinkPortsInfo.
/**
* Gets the isl links port info.
*
* @return the isl links port info
*/
public List<IslLink> getIslLinkPortsInfo(final LinkProps keys) {
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(applicationProperties.getNbBaseUrl() + IConstants.NorthBoundUrl.GET_LINKS);
builder = setLinkProps(keys, builder);
String fullUri = builder.build().toUriString();
HttpResponse response = restClientManager.invoke(fullUri, HttpMethod.GET, "", "", applicationService.getAuthHeader());
if (RestClientManager.isValidResponse(response)) {
List<IslLink> links = restClientManager.getResponseList(response, IslLink.class);
return links;
}
return null;
}
use of org.openkilda.integration.model.response.IslLink in project open-kilda by telstra.
the class StatsService method getIslPorts.
/**
* Sets the isl ports.
*
* @param portInfos
* the port infos
* @param switchid
* the switchid
* @return the list
*/
private List<PortInfo> getIslPorts(final Map<String, Map<String, Double>> portStatsByPortNo, String switchid) {
List<PortInfo> portInfos = getPortInfo(portStatsByPortNo);
List<IslLink> islLinkPorts = switchIntegrationService.getIslLinkPortsInfo(null);
String switchIdInfo = null;
if (islLinkPorts != null) {
for (IslLink islLink : islLinkPorts) {
for (IslPath islPath : islLink.getPath()) {
switchIdInfo = ("SW" + islPath.getSwitchId().replaceAll(":", "")).toUpperCase();
if (switchIdInfo.equals(switchid)) {
for (int i = 0; i < portInfos.size(); i++) {
if (portInfos.get(i).getPortNumber().equals(islPath.getPortNo().toString())) {
portInfos.get(i).setAssignmenttype("ISL");
}
}
}
}
}
}
return portInfos;
}
Aggregations