patrickmamaid_1
Dec 25, 2008Nimbostratus
how do i force down a pool member in java?
help I'm trying to force down a pool member in java but I'm having some trouble.
here is my attempt:
private iControl.Interfaces interfaces = new iControl.Interfaces();
//interfaces initialized somewhere in a constructor
interfaces.initialize(S_BIGIPPROD_MIT, L_BIGIPPORT, username, password);
public void forceDownMember(PoolMember member) {
//PoolMember is a predefined class just stores the what poolname it belongs to, ip addr and hostname
String[] pool = {member.getPoolName()};
LocalLBPoolMemberMemberSessionState[][] b = null;
try {
b = interfaces.getLocalLBPoolMember().get_session_enabled_state(pool);
} catch (Exception ex) {
Logger.getLogger(PatricksBIGIPSOAPGrabberClass.class.getName()).log(Level.SEVERE, null, ex);
}
if (b != null) {
for (int i = 0; i < b.length; i++) {
for (int j = 0; j < b.length; j++) {
if (b[j].getMember().getAddress().equals(member.getHostip())) {
b[j].setSession_state(CommonEnabledState.STATE_DISABLED);
System.out.println("connections are being drained");
}
}
}
}
}
the function doesnt seem to drain the connections or change anything?
is this the right function to force down a pool member? I want to do this in
order to perform maintenance on a server