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 visible.
Has anyone out there created a LocalLBProfilePersistence sucessfully using iControl.Assembler for java 11.1.1?
Any idea?
Thanks, Mike Tan
-------------------section of the code ---------------------------------
String [] localLBProfilePersistence = new String[1];
iControl.LocalLBPersistenceMode[] localLBPersistenceMode = new iControl.LocalLBPersistenceMode[1];
localLBPersistenceMode[0]= new LocalLBPersistenceMode(iControl.LocalLBPersistenceMode._PERSISTENCE_MODE_UIE);
//localLBPersistenceMode[0]= new LocalLBPersistenceMode();
i_interfaces.getLocalLBProfilePersistence().create(localLBProfilePersistence, localLBPersistenceMode);
--------------------------------------------------------------------
- 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.
iControl.LocalLBPersistenceMode[] modes = new iControl.LocalLBPersistenceMode[1]; modes[0] = iControl.LocalLBPersistenceMode.PERSISTENCE_MODE_UIE;
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); }
- Fuchan_Tan_3092NimbostratusJoe,
- Great, glad I could help!
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