Forum Discussion
Fuchan_Tan_3092
Feb 16, 2012Nimbostratus
localLBPersistenceMode constructor
Hi,
I am not able to create a LocalLBPersistenceMode class. The constructor requires a String as argument, however it complains that the constructor LocalLBPersistenceMode(String) is not ...
Feb 16, 2012
the LocalLB.PersistenceMode type is an enumeration. If it were a structure, you would have to allocated a new one for each array element, but you don't for an enum. Think of it just like a native type (int, long, etc). You just have to allocate the correct array size and then assign it a value, just like you would for a "long []" type.
Something like this:
iControl.LocalLBPersistenceMode[] modes = new iControl.LocalLBPersistenceMode[1];
modes[0] = iControl.LocalLBPersistenceMode.PERSISTENCE_MODE_UIE;
To create a persistence profile "foo" with a persistence mode of "PERSISTENCE_MODE_UIE", you could do something like the following:
public void createPersistenceProfile() throws Exception
{
String [] profile_names = new String[1];
profile_names[0] = "foo";
iControl.LocalLBPersistenceMode[] modes = new iControl.LocalLBPersistenceMode[1];
modes[0] = iControl.LocalLBPersistenceMode.PERSISTENCE_MODE_UIE;
m_interfaces.getLocalLBProfilePersistence().create(profile_names, modes);
}
Hope this helps...
-Joe
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