return null;
}
@Override
public NetscalerLoadBalancerResponse createNetscalerLoadBalancerResponse(ExternalLoadBalancerDeviceVO lbDeviceVO) {
NetscalerLoadBalancerResponse response = new NetscalerLoadBalancerResponse();
Host lbHost = _hostDao.findById(lbDeviceVO.getHostId());
Map<String, String> lbDetails = _detailsDao.findDetails(lbDeviceVO.getHostId());
response.setId(lbDeviceVO.getUuid());
response.setIpAddress(lbHost.getPrivateIpAddress());
PhysicalNetwork pnw = ApiDBUtils.findPhysicalNetworkById(lbDeviceVO.getPhysicalNetworkId());
if (pnw != null) {
response.setPhysicalNetworkId(pnw.getUuid());
}
response.setPublicInterface(lbDetails.get("publicInterface"));
response.setPrivateInterface(lbDetails.get("privateInterface"));
response.setDeviceName(lbDeviceVO.getDeviceName());
if (lbDeviceVO.getCapacity() == 0) {
long defaultLbCapacity = NumbersUtil.parseLong(_configDao.getValue(Config.DefaultExternalLoadBalancerCapacity.key()), 50);
response.setDeviceCapacity(defaultLbCapacity);
} else {
response.setDeviceCapacity(lbDeviceVO.getCapacity());
}
response.setDedicatedLoadBalancer(lbDeviceVO.getIsDedicatedDevice());
response.setProvider(lbDeviceVO.getProviderName());
response.setDeviceState(lbDeviceVO.getState().name());
response.setObjectName("netscalerloadbalancer");
response.setGslbProvider(lbDeviceVO.getGslbProvider());
response.setExclusiveGslbProvider(lbDeviceVO.getExclusiveGslbProvider());
response.setGslbSitePublicIp(lbDeviceVO.getGslbSitePublicIP());
response.setGslbSitePrivateIp(lbDeviceVO.getGslbSitePrivateIP());
List<Long> associatedPods = new ArrayList<Long>();
List<NetScalerPodVO> currentPodVOs = _netscalerPodDao.listByNetScalerDeviceId(lbDeviceVO.getId());
if (currentPodVOs != null && currentPodVOs.size() > 0) {
for (NetScalerPodVO nsPodVo : currentPodVOs) {
associatedPods.add(nsPodVo.getPodId());
}
}
response.setAssociatedPods(associatedPods);
return response;
}