For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

spuds23_86950's avatar
spuds23_86950
Icon for Nimbostratus rankNimbostratus
Apr 19, 2014

iControl - defining SystemConfigSyncBindingStub objects

Hi,

 

I am working with the java wrapper fileIO API and wondering what is required to define a new SystemConfigSyncBindingStub instance?

 

I see this in an example from the sdk:

 

public boolean parseArgs(String[] args) throws Exception { boolean bSuccess = false;

 

    if ( args.length < 4 )
    {
        usage();
    }
    else
    {
        // build parameters
        m_sHostname = args[0];
        m_sPort = args[1];
        m_sUsername = args[2];
        m_sPassword = args[3];

        if ( m_sPort.equals("443") )
        {
            m_sProtocol = "https";
        }
        m_endpoint = m_sProtocol + "://" + m_sUsername + ":" + m_sPassword + "@" + m_sHostname + ":" + m_sPort + "/iControl/iControlPortal.cgi";

        m_configSync = (iControl.SystemConfigSyncBindingStub)
            new iControl.SystemConfigSyncLocator().getSystemConfigSyncPort(new java.net.URL(m_endpoint));

        m_configSync.setTimeout(60000);

        bSuccess = true;

However, is the following line required to properly initialize the m_configSync instance?

 

m_configSync = (iControl.SystemConfigSyncBindingStub) new iControl.SystemConfigSyncLocator().getSystemConfigSyncPort(new java.net.URL(m_endpoint));

 

I just want to download a config file from bigip and am using the below example code in my current class but getting a "null" value on the m_configSync object when I make the call below (I do not currently have the above line of code):

 

public Interfaces m_interfaces = new iControl.Interfaces(); public iControl.SystemConfigSyncBindingStub m_configSync; private final long DEFAULT_CHUNK_SIZE = (64 * 1024);

 

public void handle_download(String config_name, String local_file) throws Exception { iControl.SystemConfigSyncFileTransferContext ctx; final long chunk_size = DEFAULT_CHUNK_SIZE; final LongHolder file_offset = new LongHolder(0); boolean bContinue = true;

 

    final FileOutputStream fs = new FileOutputStream(new File(local_file));

    while (bContinue) {

        //  m_configSync value is null
        ctx = m_configSync.download_configuration(config_name, chunk_size, file_offset);
        ...

Another example of defining and initializing this type of ConfigSync object would be much appreciated ... (:*) ...

 

Thank you.

 

  • Spuds23
No RepliesBe the first to reply