Forum Discussion
Radim_Bosticka_
Nimbostratus
Jan 23, 2009Server disabling structure
Hi,
I have problems to use function set_session_enabled_state from PoolMember class.
Everywhere is description some object structure as described:
http://devcentra...
Jan 23, 2009
The java proxies cannot dynamically convert string arrays into native iControl types. You need to create an array of LocalLBPoolMemberMemberSessionState objects, allocate those objects, fill those objects up with their data and pass those along to the method call.
Something like this should work for you:
public void setPoolMemberSessionState(
String poolname, String memberaddr, long memberport, String state) throws Exception
{
String [] pool_list = new String [] { poolname };
iControl.LocalLBPoolMemberMemberSessionState [][] statesAofA = new iControl.LocalLBPoolMemberMemberSessionState[ 1 ][];
statesAofA[ 0 ] = new iControl.LocalLBPoolMemberMemberSessionState[1];
statesAofA[ 0 ][ 0 ] = new iControl.LocalLBPoolMemberMemberSessionState();
statesAofA[ 0 ][ 0 ].setMember(new iControl.CommonIPPortDefinition());
statesAofA[ 0 ][ 0 ].getMember().setAddress(memberaddr);
statesAofA[ 0 ][ 0 ].getMember().setPort(memberport);
if ( state.equals("enable") )
{
statesAofA[ 0 ][ 0 ].setSession_state(iControl.CommonEnabledState.STATE_ENABLED);
}
else
{
statesAofA[ 0 ][ 0 ].setSession_state(iControl.CommonEnabledState.STATE_DISABLED);
}
m_interfaces.getLocalLBPoolMember().set_session_enabled_state(pool_list, statesAofA);
}
Make sense?
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects