@Override
public ListResponse<UcsManagerResponse> listUcsManager(ListUcsManagerCmd cmd) {
List<UcsManagerResponse> rsps = new ArrayList<UcsManagerResponse>();
ListResponse<UcsManagerResponse> response = new ListResponse<UcsManagerResponse>();
if (cmd.getId() != null) {
UcsManagerVO vo = ucsDao.findById(cmd.getId());
UcsManagerResponse rsp = new UcsManagerResponse();
rsp.setObjectName("ucsmanager");
rsp.setId(vo.getUuid());
rsp.setName(vo.getName());
rsp.setUrl(vo.getUrl());
rsp.setZoneId(zoneIdToUuid(vo.getZoneId()));
rsps.add(rsp);
response.setResponses(rsps);
return response;
}
SearchCriteria<UcsManagerVO> sc = ucsDao.createSearchCriteria();
sc.addAnd("zoneId", Op.EQ, cmd.getZoneId());
List<UcsManagerVO> vos = ucsDao.search(sc, null);
for (UcsManagerVO vo : vos) {
UcsManagerResponse rsp = new UcsManagerResponse();
rsp.setObjectName("ucsmanager");
rsp.setId(vo.getUuid());
rsp.setName(vo.getName());
rsp.setUrl(vo.getUrl());
rsp.setZoneId(zoneIdToUuid(vo.getZoneId()));
rsps.add(rsp);
}
response.setResponses(rsps);
return response;
}