out.addChild(new SendMediator());
mainSeq.addChild(in);
mainSeq.addChild(out);
SendMediator send = new SendMediator();
LoadbalanceEndpoint lb = new LoadbalanceEndpoint();
FilterMediator filterMediator = new FilterMediator();
in.addChild(filterMediator);
SynapseXPath xpath = new SynapseXPath("get-property('To')");
filterMediator.setSource(xpath);
filterMediator.setRegex(Pattern.compile("/carbon"));
PropertyMediator httpSCProperty = new PropertyMediator();
httpSCProperty.setName("HTTP_SC");
httpSCProperty.setScope("axis2");
httpSCProperty.setValue("302");
PropertyMediator locationHeader = new PropertyMediator();
locationHeader.setName("Location");
locationHeader.setScope("transport");
locationHeader.setValue(getMasterHttpsEndpoint(PortSelector.normalEndpointList));
PropertyMediator responseProperty = new PropertyMediator();
responseProperty.setName(SynapseConstants.RESPONSE);
responseProperty.setValue("true");
HeaderMediator headerMediator = new HeaderMediator();
headerMediator.setQName(new QName("To"));
headerMediator.setAction(1);
SendMediator sendMediator = new SendMediator();
DropMediator dropMediator = new DropMediator();
filterMediator.addChild(locationHeader);
filterMediator.addChild(httpSCProperty);
filterMediator.addChild(responseProperty);
filterMediator.addChild(headerMediator);
filterMediator.addChild(sendMediator);
filterMediator.addChild(dropMediator);
AnonymousListMediator elseMediator = new AnonymousListMediator();
filterMediator.setElseMediator(elseMediator);
elseMediator.addChild(new LogMediator());
elseMediator.addChild(send);
/* if there are ncew endpoints we are removing the current sequence */
RoundRobin algorithm = new RoundRobin(childEndpoints);
lb.setAlgorithm(algorithm);
/* adding all the endpoints started since the current main sequence is removing */
if(!"set".equals(System.getProperty("lb.disable"))){
lb.setMembers(new ArrayList<Member>(addedEndpointList.values()));
}
send.setEndpoint(lb);
//in.addChild(send);
synCfg.addSequence(mainSeq.getName(), mainSeq);
if(!"set".equals(System.getProperty("lb.disable"))){