use of com.vmware.flowgate.nlyteworker.model.JsonResultForManufacturer in project flowgate by vmware.
the class NlyteAPIClient method getManufacturers.
public List<Manufacturer> getManufacturers(boolean isAllData) {
initAuthenticationWebToken();
List<Manufacturer> manufacturers = new LinkedList<Manufacturer>();
JsonResultForManufacturer manufacturerResult = this.restTemplate.exchange(getNlyteServiceEndpoint() + GetManufacturersURL, HttpMethod.GET, getDefaultEntity(), JsonResultForManufacturer.class).getBody();
manufacturers = manufacturerResult.getValue();
if (!isAllData) {
return manufacturers;
}
List<Manufacturer> nextPageManufacturers = null;
while (manufacturerResult.getOdatanextLink() != null && !manufacturerResult.getOdatanextLink().equals("")) {
nextPageManufacturers = new LinkedList<Manufacturer>();
manufacturerResult = this.restTemplate.exchange(manufacturerResult.getOdatanextLink(), HttpMethod.GET, getDefaultEntity(), JsonResultForManufacturer.class).getBody();
nextPageManufacturers = manufacturerResult.getValue();
manufacturers.addAll(nextPageManufacturers);
}
return manufacturers;
}
Aggregations