Forum Discussion

Vinay_12452's avatar
Icon for Nimbostratus rankNimbostratus
Nov 24, 2011

How to set HTTPProfile for VirtualServer from Java

Hi..I am a beginner.



I created a VirtualServer using the below code...How can i set the attributes HTTPProfile, FTPProfile, XMLProfile etc to the VirtualServer from java code.




CommonVirtualServerDefinition vsDef = new CommonVirtualServerDefinition(vsName, ipAddress, port, CommonProtocolType.PROTOCOL_TCP);


LocalLBVirtualServerVirtualServerResource vsResource = new LocalLBVirtualServerVirtualServerResource(LocalLBVirtualServerType.RESOURCE_TYPE_POOL, poolName);


LocalLBVirtualServerVirtualServerProfile vsProfile = new LocalLBVirtualServerVirtualServerProfile(LocalLBProfileContextType.PROFILE_CONTEXT_TYPE_ALL, protocol);


virtualServerStub.create({vsdef}, {}, {vsResource}, {{vsprofile}})




using above code, i could create a VirtualServer. I am getting HTTPProfile, FTPProfile, XMLProfile..etc as 'NONE' in the interface.



How could i set these attributes from java code.



Thanks in advance.







3 Replies

  • Once you create the virtual server, you can add profiles with these methods












    You'll need to call the method depending on the type of profile you are assigning. HTTP, FTP, etc will just be with the standard add_profile() method.



    (There are get and remove versions of these methods as well to query and remove the profiles).



    The methods are documented here:





    and I wrote a Tech Tip a while back on the Stream Profile. This article shows how to call the add_profile() method to assign a Stream Profile to a Virtual Server:





    Hope this helps...