Search in sources :

Example 1 with JsonResultForLocationGroup

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;
}
Also used : JsonResultForLocationGroup(com.vmware.flowgate.nlyteworker.model.JsonResultForLocationGroup) LocationGroup(com.vmware.flowgate.nlyteworker.model.LocationGroup) JsonResultForLocationGroup(com.vmware.flowgate.nlyteworker.model.JsonResultForLocationGroup) LinkedList(java.util.LinkedList)

Aggregations

JsonResultForLocationGroup (com.vmware.flowgate.nlyteworker.model.JsonResultForLocationGroup)1 LocationGroup (com.vmware.flowgate.nlyteworker.model.LocationGroup)1 LinkedList (java.util.LinkedList)1