for (final DestinationTO dest : lbTO.getDestinations()) { if (dest.isRevoked()) { continue; .append(Integer.toString(i++)) .append(" ") .append(dest.getDestIp()) .append(":") .append(dest.getDestPort()) .append(" check"); if(lbTO.getLbProtocol() != null && lbTO.getLbProtocol().equals("tcp-proxy")) { sb.append(" cookie ").append(dest.getDestIp().replace(".", "_")).append('-').append(dest.getDestPort()).toString(); dstWithCookieSubRule.add(sb.toString());
JSONObject dt = dest.getJSONObject(d); if( dt!=null ) { DestinationTO destTO = new DestinationTO(dt.getString("destIp"), dt.getInt("destPort"), dt.getString("monitorState")); listDestTo.add(destTO);
boolean deleteCert = false; for (final DestinationTO destination : loadBalancer.getDestinations()) { if (!destination.isRevoked()) { destinationsToAdd = true; break; final String nsServerName = generateNSServerName(destination.getDestIp()); final String nsServiceName = generateNSServiceName(destination.getDestIp(), destination.getDestPort()); if (!destination.isRevoked()) { final com.citrix.netscaler.nitro.resource.config.basic.server nsServer = new com.citrix.netscaler.nitro.resource.config.basic.server(); nsServer.set_name(nsServerName); nsServer.set_ipaddress(destination.getDestIp()); apiCallResult = com.citrix.netscaler.nitro.resource.config.basic.server.add(_netscalerService, nsServer); if (apiCallResult.errorcode != 0 && apiCallResult.errorcode != NitroError.NS_RESOURCE_EXISTS) { throw new ExecutionException("Failed to add server " + destination.getDestIp() + " due to" + apiCallResult.message); final com.citrix.netscaler.nitro.resource.config.basic.service newService = new com.citrix.netscaler.nitro.resource.config.basic.service(); newService.set_name(nsServiceName); newService.set_port(destination.getDestPort()); newService.set_servername(nsServerName); newService.set_state("ENABLED"); s_logger.debug("Successfully added LB destination: " + destination.getDestIp() + ":" + destination.getDestPort() + " to load balancer " + srcIp + ":" + srcPort);
if (dstIp.equalsIgnoreCase(lbto.getDestinations()[i].getDestIp())) { lbVmMap.setState(des.getMonitorState()); _lb2VmMapDao.persist(lbVmMap); s_logger.debug("Updating the LB VM Map table with the service state");
final String nsServiceName = generateNSServiceName(destination.getDestIp(), destination.getDestPort()); for (final com.citrix.netscaler.nitro.resource.config.lb.lbvserver_service_binding binding : serviceBindings) { if (nsServiceName.equalsIgnoreCase(binding.get_servicename())) { destination.setMonitorState(binding.get_curstate()); break;
public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List<LbDestination> destinations) { if (destinations == null) { // for autoscaleconfig destinations will be null; destinations = new ArrayList<LbDestination>(); } this.uuid = uuid; this.srcIp = srcIp; this.srcPort = srcPort; this.protocol = protocol; this.algorithm = algorithm; this.revoked = revoked; this.alreadyAdded = alreadyAdded; this.inline = inline; this.destinations = new DestinationTO[destinations.size()]; this.stickinessPolicies = null; this.sslCert = null; this.lbProtocol = null; int i = 0; for (LbDestination destination : destinations) { this.destinations[i++] = new DestinationTO(destination.getIpAddress(), destination.getDestinationPortStart(), destination.isRevoked(), false); } }
public LoadBalancerTO(String id, List<DestinationTO> destinations) { this.uuid = id; int i = 0; this.destinations = new DestinationTO[destinations.size()]; for (DestinationTO destination : destinations) { this.destinations[i++] = new DestinationTO(destination.getDestIp(), destination.getDestPort(), destination.getMonitorState()); } }