public RemoteTask getRemoteTask(Task localTaskOwner, String strUserID, String strPassword, boolean bCreateIfNotFound)
    {
        if (localTaskOwner == null)
            localTaskOwner = m_taskMain;   // No task = main task
        RemoteTask server = m_mapTasks.get(localTaskOwner);
        if (server == null)
            if (bCreateIfNotFound)
        {
            String strServer = this.getAppServerName();
            String strRemoteApp = null;
            if (localTaskOwner != null)
                strRemoteApp = localTaskOwner.getProperty(Params.REMOTE_APP_NAME);
            if ((strRemoteApp == null) || (strRemoteApp.length() == 0))
                strRemoteApp = this.getProperty(Params.REMOTE_APP_NAME);
            if ((strRemoteApp == null) || (strRemoteApp.length() == 0))
                strRemoteApp = Params.DEFAULT_REMOTE_APP;
            if (strUserID == null)
                strUserID = this.getProperty(Params.USER_ID);
            if (strPassword == null)
                strPassword = this.getProperty(Params.PASSWORD);
            server = this.createRemoteTask(strServer, strRemoteApp, strUserID, strPassword);
            if (server != null)
            {
                if (localTaskOwner == null)
                	localTaskOwner = new AutoTask(this, null, null);	// Default task = server task
                this.addTask(localTaskOwner, server);	// NOTE: IF autotask was just created, I re-add this with a remote pointer
            }
        }
        return server;
    }
public RemoteTask getRemoteTask ( Task localTaskOwner , String strUserID , String strPassword , boolean bCreateIfNotFound ) { if ( localTaskOwner == null ) localTaskOwner = m_taskMain ; RemoteTask server = m_mapTasks . get ( localTaskOwner ) ; if ( server == null ) if ( bCreateIfNotFound ) { String strServer = this . getAppServerName ( ) ; String strRemoteApp = null ; if ( localTaskOwner != null ) strRemoteApp = localTaskOwner . getProperty ( Params . REMOTE_APP_NAME ) ; if ( ( strRemoteApp == null ) || ( strRemoteApp . length ( ) == 0 ) ) strRemoteApp = this . getProperty ( Params . REMOTE_APP_NAME ) ; if ( ( strRemoteApp == null ) || ( strRemoteApp . length ( ) == 0 ) ) strRemoteApp = Params . DEFAULT_REMOTE_APP ; if ( strUserID == null ) strUserID = this . getProperty ( Params . USER_ID ) ; if ( strPassword == null ) strPassword = this . getProperty ( Params . PASSWORD ) ; server = this . createRemoteTask ( strServer , strRemoteApp , strUserID , strPassword ) ; if ( server != null ) { if ( localTaskOwner == null ) localTaskOwner = new AutoTask ( this , null , null ) ; this . addTask ( localTaskOwner , server ) ; } } return server ; }
Get the connection to the server for this applet.
Optionally create the server connection.
@param localTaskOwner The task that will own this remote task (or application) server) [If null, get the app server].
@param strUserID The user id (or name) to initialize the server's application to.
@param bCreateIfNotFound If the server is null, initialize the server.
@return The server object (application defined).