Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.actions
Class QSYSBaseRemoteServerAction

java.lang.Object
  extended by SystemCascadingRemoteServerBaseAction
      extended by com.ibm.etools.iseries.rse.ui.actions.QSYSBaseRemoteServerAction
Direct Known Subclasses:
QSYSRemoteServerDDMAction, QSYSRemoteServerDebugRouterAction, QSYSRemoteServerDQAction, QSYSRemoteServerFileAction, QSYSRemoteServerRACAction, QSYSRemoteServerWebFacingAction

public abstract class QSYSBaseRemoteServerAction
extends SystemCascadingRemoteServerBaseAction

This is a base class for all actions for starting/stopping remote iSeries servers, within the Remote Servers cascading action. It handles common stuff, like testing if the connection is connected.


Field Summary
static String copyright
           
protected  IQSYSJob job
           
protected  Object[] returnedMessages
           
protected static String SBMJOB
           
protected  IBMiConnection selectedConnection
           
 
Constructor Summary
QSYSBaseRemoteServerAction(String label, String tooltip, Shell shell)
          Constructor.
 
Method Summary
protected  IBMiConnection getISeriesConnection()
          Helper method to return the currently selected iSeries connection.
protected  IQSYSJob getISeriesJob()
          Return the iSeries system job representing this remote server.
protected abstract  String getJobName()
          Overridable.
protected abstract  String getJobSubSystem()
          Overridable.
 Object[] getMessages()
          Return the messages resulting from the last call to startServer or stopServer.
protected abstract  String getStartServerCommand()
          Overridable method to return the SBMJOB command to be run to start this server
protected  String getStopServerCommand()
          Overridable parent method to return the SBMJOB command to be submitted to start this server By default we return "ENDJOB JOB(" + getISeriesJob().getFullJobName() + ") OPTION(*IMMED)"
protected  boolean isServerStarted(IBMiConnection iSeriesConnection)
          Overridable method to test if this remote server is started already or not.
protected  boolean isServerStarted(IHost connection)
          Overridden parent method to compute if this remote server/daemon is currently running or not.
protected  boolean shouldEnable(IHost connection)
          Parent method override.
 boolean startServer()
          Overridden parent method.
 boolean stopServer()
          Overridden parent method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

SBMJOB

protected static final String SBMJOB
See Also:
Constant Field Values

selectedConnection

protected IBMiConnection selectedConnection

returnedMessages

protected Object[] returnedMessages

job

protected IQSYSJob job
Constructor Detail

QSYSBaseRemoteServerAction

public QSYSBaseRemoteServerAction(String label,
                                  String tooltip,
                                  Shell shell)
Constructor.

Parameters:
shell - Shell of parent window, used as the parent for the dialog. Can be null, but be sure to call setParent before the action is used (ie, run).
Method Detail

getStartServerCommand

protected abstract String getStartServerCommand()
Overridable method to return the SBMJOB command to be run to start this server


getStopServerCommand

protected String getStopServerCommand()
Overridable parent method to return the SBMJOB command to be submitted to start this server By default we return "ENDJOB JOB(" + getISeriesJob().getFullJobName() + ") OPTION(*IMMED)"


getISeriesConnection

protected IBMiConnection getISeriesConnection()
Helper method to return the currently selected iSeries connection.


isServerStarted

protected boolean isServerStarted(IBMiConnection iSeriesConnection)
Overridable method to test if this remote server is started already or not. By default, this tests to see if the job, as named in getJobName(), is active in the system, returning true if it is. If this behaviour is sufficient, you need not override this.

Called from #enable(SystemConnection).


getISeriesJob

protected IQSYSJob getISeriesJob()
Return the iSeries system job representing this remote server. Will be null if this server is not running.


getJobName

protected abstract String getJobName()
Overridable. Return the job name to test if active, in order to determine if the server is started or not. This is just the name, to which * will be appended for each of the job number and user ID.


getJobSubSystem

protected abstract String getJobSubSystem()
Overridable. Return the subsystem the job runs in, if you know it. Else return null.


isServerStarted

protected boolean isServerStarted(IHost connection)
Overridden parent method to compute if this remote server/daemon is currently running or not. Do not override. Instead, override isServerStarted(IBMiConnection), which this method calls.

Returns:
true if the server is currently running or not.

startServer

public boolean startServer()
Overridden parent method. Do not override! This remotely runs the command returned from getStartServerCommand().

Returns:
true if the remote server was successfully started, false if not.

getMessages

public Object[] getMessages()
Return the messages resulting from the last call to startServer or stopServer.


stopServer

public boolean stopServer()
Overridden parent method. Do not override! Callback from the com.ibm.etools.systems.core.ui.actions.SystemRemoteServerStartAction class that is called when the user selects to stop this remote server/daemon.

Returns:
true if the remote server was successfully stopped, false if not.

shouldEnable

protected boolean shouldEnable(IHost connection)
Parent method override.
This method is an opportunity to decide whether to enable this action or not. Sometimes we can determine if the connection is connected or not, in which case we want to disable this action if the connection is not connected.
We return true iff the connection is connected.


Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.