Forum Discussion
RichKL_77280
Nimbostratus
Jun 25, 2008Setting PoolMember session_enabled_state
I have two questions for you; one is for a specific answer, one for a more general understanding.
First, I am attempting to set a poolmember's state to STATE_DISABLED using the Java iControl Assembly. I have the following code, but keep seeing "null" printed to the console; it's erroring out on the line surrounded by the ////s, and e.getLocalizedMessage() is apparently null. Can you fix it please?
try {
m_endpoint = "https://" + f5User + ":" + f5Password + "@" + f5Address + "/iControl/iControlPortal.cgi";
LocalLBPoolMemberBindingStub pm = (LocalLBPoolMemberBindingStub) new LocalLBPoolMemberLocator().getLocalLBPoolMemberPort(new URL(m_endpoint));
String[] pools = {"pool_name"};
LocalLBPoolMemberMemberSessionState[][] states = new LocalLBPoolMemberMemberSessionState[1][];
states[0] = new LocalLBPoolMemberMemberSessionState[1];
////////////////////////////////////////////////////////////////////////////////////////
/// states[0][0].setMember(new CommonIPPortDefinition("my.ip.add.ress", 80)); ///
////////////////////////////////////////////////////////////////////////////////////////
states[0][0].setSession_state(CommonEnabledState.STATE_DISABLED);
pm.set_session_enabled_state(pools, states);
LocalLBPoolMemberMemberSessionState[][] ret = pm.get_session_enabled_state(pools);
System.out.println(ret[0][0].getSession_state());
} catch (Exception e) {
System.out.println(e.getLocalizedMessage());
}
Secondly, I'm very new working with iControl, and I'm finding the learning curve very steep. I've cobbled the above code together after combing extensively through the forums here, after looking through the SDK, the sample code in the downloadable SDK, and much trial and error. The iControl APIReference shows the functions that are available, but nowhere do I see anything that maps those to Java classes and methods. I don't see any reference to such classes as LocalLBPoolMemberBindingStub.
Maybe it's just because I'm just such a new programmer, but I was expecting to be using a class named something like iControl.LocalLB.PoolMember. I also don't know what a binding stub is or why we're using them.
So, what I'd really like to know is how would someone totally unfamiliar with the iControl Assembly be able to look at the SDK and know what Java classes and methods to use? Could you make some sort of tutorial for Java that goes beyond setting up the IDE, to actually understanding how to write our first programs?
Thanks for your hard work. I can see the power in your many tools, and I know you're doing your best to make using your product easy for all of us.
(And third, why does this forum translate [ 0 ] into ' Y ] ?)
- RStraka_79753
Nimbostratus
When first populating the states array have you tried setting states = pm.get_session_enabled_state(pools)?
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