use of com.vmware.flowgate.nlyteworker.model.JsonResultForLocationGroup in project flowgate by vmware.
the class NlyteAPIClient method getLocationGroups.
public List<LocationGroup> getLocationGroups(boolean isAllData) {
initAuthenticationWebToken();
JsonResultForLocationGroup locationGroupresult = this.restTemplate.exchange(getNlyteServiceEndpoint() + GetLocationGroupsURL, HttpMethod.GET, getDefaultEntity(), JsonResultForLocationGroup.class).getBody();
List<LocationGroup> locationGroups = new LinkedList<LocationGroup>();
locationGroups = locationGroupresult.getValue();
if (!isAllData) {
return locationGroups;
}
List<LocationGroup> nextPageLocationGroup = null;
while (locationGroupresult.getOdatanextLink() != null && !locationGroupresult.getOdatanextLink().equals("")) {
nextPageLocationGroup = new LinkedList<LocationGroup>();
locationGroupresult = this.restTemplate.exchange(locationGroupresult.getOdatanextLink(), HttpMethod.GET, getDefaultEntity(), JsonResultForLocationGroup.class).getBody();
nextPageLocationGroup = locationGroupresult.getValue();
locationGroups.addAll(nextPageLocationGroup);
}
return locationGroups;
}
Aggregations