@Override public List<? extends Network> listNetworks(ListNetscalerLoadBalancerNetworksCmd cmd) { Long lbDeviceId = cmd.getLoadBalancerDeviceId(); List<NetworkVO> networks = new ArrayList<NetworkVO>(); ExternalLoadBalancerDeviceVO lbDeviceVo = _lbDeviceDao.findById(lbDeviceId); if (lbDeviceVo == null || !isNetscalerDevice(lbDeviceVo.getDeviceName())) { throw new InvalidParameterValueException( "Could not find Netscaler load balancer device with ID " + lbDeviceId); } List<NetworkExternalLoadBalancerVO> networkLbMaps = _networkLBDao.listByLoadBalancerDeviceId(lbDeviceId); if (networkLbMaps != null && !networkLbMaps.isEmpty()) { for (NetworkExternalLoadBalancerVO networkLbMap : networkLbMaps) { NetworkVO network = _networkDao.findById(networkLbMap.getNetworkId()); networks.add(network); } } return networks; }
@Override public boolean deleteNetscalerLoadBalancer(DeleteNetscalerLoadBalancerCmd cmd) { Long lbDeviceId = cmd.getLoadBalancerDeviceId(); ExternalLoadBalancerDeviceVO lbDeviceVo = _lbDeviceDao.findById(lbDeviceId); if ((lbDeviceVo == null) || !isNetscalerDevice(lbDeviceVo.getDeviceName())) { throw new InvalidParameterValueException("No netscaler device found with ID: " + lbDeviceId); } return deleteExternalLoadBalancer(lbDeviceVo.getHostId()); }
final Map<String, String> lbDetails = _detailsDao.findDetails(lbDeviceVo.getHostId()); if ((lbDeviceVo == null) || !isNetscalerDevice(lbDeviceVo.getDeviceName())) { throw new InvalidParameterValueException("No netscaler device found with ID: " + lbDeviceId); String deviceName = lbDeviceVo.getDeviceName(); if (dedicatedUse != null || capacity != null) { if (NetworkDevice.NetscalerSDXLoadBalancer.getName().equalsIgnoreCase(deviceName)
if (!isNetscalerDevice(lbDeviceVO.getDeviceName())) { errMsg = "There are no NetScaler load balancer assigned for this network. So NetScaler element can not be handle elastic load balancer rules."; s_logger.error(errMsg);
@Override public List<ExternalLoadBalancerDeviceVO> listNetscalerLoadBalancers(ListNetscalerLoadBalancersCmd cmd) { Long physcialNetworkId = cmd.getPhysicalNetworkId(); Long lbDeviceId = cmd.getLoadBalancerDeviceId(); PhysicalNetworkVO pNetwork = null; List<ExternalLoadBalancerDeviceVO> lbDevices = new ArrayList<ExternalLoadBalancerDeviceVO>(); if (physcialNetworkId == null && lbDeviceId == null) { throw new InvalidParameterValueException( "Either physical network Id or load balancer device Id must be specified"); } if (lbDeviceId != null) { ExternalLoadBalancerDeviceVO lbDeviceVo = _lbDeviceDao.findById(lbDeviceId); if (lbDeviceVo == null || !isNetscalerDevice(lbDeviceVo.getDeviceName())) { throw new InvalidParameterValueException( "Could not find Netscaler load balancer device with ID: " + lbDeviceId); } lbDevices.add(lbDeviceVo); return lbDevices; } if (physcialNetworkId != null) { pNetwork = _physicalNetworkDao.findById(physcialNetworkId); if (pNetwork == null) { throw new InvalidParameterValueException( "Could not find phyical network with ID: " + physcialNetworkId); } lbDevices = _lbDeviceDao.listByPhysicalNetworkAndProvider(physcialNetworkId, Provider.Netscaler.getName()); return lbDevices; } return null; }
if (!isNetscalerDevice(lbDeviceVO.getDeviceName())) { errMsg = "There are no NetScaler load balancer assigned for this network. So NetScaler element can not be handle elastic load balancer rules."; s_logger.error(errMsg);
if (!isNetscalerDevice(lbDevice.getDeviceName())) { errMsg = "There are no NetScaler load balancer assigned for this network. So NetScaler element will not be handling the static nat rules."; s_logger.error(errMsg);
response.setDeviceName(lbDeviceVO.getDeviceName()); if (lbDeviceVO.getCapacity() == 0) { long defaultLbCapacity = NumbersUtil