Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.uda
Class QSYSUDActionSubsystem

java.lang.Object
  extended by SystemUDActionSubsystem
      extended by com.ibm.etools.iseries.rse.ui.uda.QSYSUDActionSubsystem
Direct Known Subclasses:
IFSUDActionSubsystem, JobUDActionSubsystem, NFSUDActionSubsystem

public abstract class QSYSUDActionSubsystem
extends SystemUDActionSubsystem

Abstraction of the common services for both iSeries Objects and iSeries Jobs for the support of user defined actions. There are subclasses for each of these.


Field Summary
static String ATTR_RUNENV
          Attribute containing the run environment: "RunEnv"
static String Copyright
           
protected  Object[] msgs
           
static String RUNENV_BATCH
          Value of Run Environment attribute for batch: "batch"
static String RUNENV_INTERACTIVE
          Value of Run Environment attribute for interactive: "interactive"
static String RUNENV_NORMAL
          Value of Run Environment attribute for normal: "normal"
static String TEMPMBR_FILE
          File containing temporary member for collected names, when using "Invoke once": QRSESELECT
static String TEMPMBR_LIB
          Library containing temporary member for collected names, when using "Invoke once": QRSETEMP
 
Constructor Summary
QSYSUDActionSubsystem()
          Constructor
 
Method Summary
protected  Object collectNames(Shell shell, Iterator elements, StringBuffer collectedNames)
          When processing an action that has elected to be invoked only once, versus once per selected object, we call this method to collect the names of the selected objects into a single string buffer.
protected  Object collectNamesQSYS(Shell shell, Iterator elements, StringBuffer collectedNames)
          Abstract out this code so subsystems can avoid calling it.
protected  String getAllNamesSubstitutionVariable()
          When processing an action that has elected to be invoked only once, versus once per selected object, we call this method to get the "all names" substitution variable so that we can substitute it with the collection of names of all selected objects.
 QSYSCommandSubSystem getCommandSubsystem(Object context)
           
 SystemUDActionEditPane getCustomUDActionEditPane(ISubSystem ss, ISubSystemConfiguration ssc, ISystemProfile profile, ISystemUDAEditPaneHoster parent, ISystemUDTreeView tv)
           
abstract  IHost getHost(Object element)
           
protected  char getNameDelimiter()
          When processing an action that has elected to be invoked only once, versus once per selected object, we call this method to get the delimiter character to surround each name in.
 String getOSType()
           
protected  IRunnableContext getRunnableContext(Shell rshell)
          Get the progress monitor dialog for this operation.
 String getSubstitutionValue(String subvar, Object context)
          From the interface ISystemSubstitutor.
 boolean getWorkingOfflineMode()
          We disable user defined actions if we are in work-offline mode.
protected  void printTestActionInvokeOnceInformation(Shell shell, PrintWriter writer)
          Overriddable method for printing out information about the collected names for "invoke once" actions, when in test mode.
protected  String promptCommand(Shell shell, String command)
          Called when processing user action that has the "prompt" attribute set.
 void run(IProgressMonitor monitor)
          As per IRunnableWithProgress interface.
protected  boolean runCommand(Shell shell, SystemUDActionElement action, String cmdString, IRemoteCmdSubSystem cmdSubSystem, Object context, Viewer viewer)
          After an action's command has been resolved (vars substituted) this method is called to actually do the remote command execution
 
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

ATTR_RUNENV

public static final String ATTR_RUNENV
Attribute containing the run environment: "RunEnv"

See Also:
Constant Field Values

RUNENV_NORMAL

public static final String RUNENV_NORMAL
Value of Run Environment attribute for normal: "normal"

See Also:
Constant Field Values

RUNENV_BATCH

public static final String RUNENV_BATCH
Value of Run Environment attribute for batch: "batch"

See Also:
Constant Field Values

RUNENV_INTERACTIVE

public static final String RUNENV_INTERACTIVE
Value of Run Environment attribute for interactive: "interactive"

See Also:
Constant Field Values

TEMPMBR_LIB

public static final String TEMPMBR_LIB
Library containing temporary member for collected names, when using "Invoke once": QRSETEMP

See Also:
Constant Field Values

TEMPMBR_FILE

public static final String TEMPMBR_FILE
File containing temporary member for collected names, when using "Invoke once": QRSESELECT

See Also:
Constant Field Values

msgs

protected Object[] msgs
Constructor Detail

QSYSUDActionSubsystem

public QSYSUDActionSubsystem()
Constructor

Method Detail

getCustomUDActionEditPane

public SystemUDActionEditPane getCustomUDActionEditPane(ISubSystem ss,
                                                        ISubSystemConfiguration ssc,
                                                        ISystemProfile profile,
                                                        ISystemUDAEditPaneHoster parent,
                                                        ISystemUDTreeView tv)

runCommand

protected boolean runCommand(Shell shell,
                             SystemUDActionElement action,
                             String cmdString,
                             IRemoteCmdSubSystem cmdSubSystem,
                             Object context,
                             Viewer viewer)
After an action's command has been resolved (vars substituted) this method is called to actually do the remote command execution

Parameters:
shell - - the shell to use if need to prompt for password or show msg dialog
action - - the action being processed, in case attributes of it need to be queried
cmdString - - the resolved command
cmdSubSystem - - this connection's command subsystem, which will run the command
context - - any context information the subsystem's runCommand might need
Returns:
true if we should continue, false if something went wrong

promptCommand

protected String promptCommand(Shell shell,
                               String command)
Called when processing user action that has the "prompt" attribute set. Override of parent to simply insert a '?' character

Parameters:
shell - - the shell to host the modal dialog
command - - the fully resolved (variables substituted) command
Returns:
the edited command string, or null if the user pressed cancel

collectNames

protected Object collectNames(Shell shell,
                              Iterator elements,
                              StringBuffer collectedNames)
When processing an action that has elected to be invoked only once, versus once per selected object, we call this method to collect the names of the selected objects into a single string buffer.

This is an override of the parent, as we handle this option different for iSeries. Rather than collecting all the names into a single list of quoted, blank-delimited names, we instead create a temporary member and put all the fully-qualified names of the selected objects in it. The name of this temporary member can then be passed to a server program via the &Mx substitution variables, and that program can open and read the names from there.

This different behaviour makes it easier to write server side programs to process the list of selected names, as we can neither pre-determine the number of parameters, or the length of a single parameter if we concatenated them. On iSeries, it is necessary for called-programs to know ahead of time the number of parameters and the size of each. Further, there is a limit of 40 parameters for any one call.

Returns:
first selected object, or null if something went wrong (msg will have been issued)

collectNamesQSYS

protected Object collectNamesQSYS(Shell shell,
                                  Iterator elements,
                                  StringBuffer collectedNames)
Abstract out this code so subsystems can avoid calling it.


run

public void run(IProgressMonitor monitor)
         throws InvocationTargetException,
                InterruptedException
As per IRunnableWithProgress interface. We use this when needed to show progress monitor

Throws:
InvocationTargetException
InterruptedException

getRunnableContext

protected IRunnableContext getRunnableContext(Shell rshell)
Get the progress monitor dialog for this operation. We try to use one for all phases of a single operation, such as connecting and resolving.


printTestActionInvokeOnceInformation

protected void printTestActionInvokeOnceInformation(Shell shell,
                                                    PrintWriter writer)
Overriddable method for printing out information about the collected names for "invoke once" actions, when in test mode.


getAllNamesSubstitutionVariable

protected String getAllNamesSubstitutionVariable()
When processing an action that has elected to be invoked only once, versus once per selected object, we call this method to get the "all names" substitution variable so that we can substitute it with the collection of names of all selected objects.

We return null to indicate to our parent class that we handle this option differently


getNameDelimiter

protected char getNameDelimiter()
When processing an action that has elected to be invoked only once, versus once per selected object, we call this method to get the delimiter character to surround each name in.

We return a single quote.


getWorkingOfflineMode

public boolean getWorkingOfflineMode()
We disable user defined actions if we are in work-offline mode. Currently, how we determine this is dependent on the subsystem factory.


getSubstitutionValue

public String getSubstitutionValue(String subvar,
                                   Object context)
From the interface ISystemSubstitutor. Return the string to substitute for the given substitution variable, given the current context object. This object will be passed whatever was passed into the doSubstitution method.

It is VERY IMPORTANT to return null if you can't do the substitution for some reason! This is a clue to the algorithm that no change was made and increases performance.

This is an override of the parent class method, because iSeries has unique variable substitution support (&x vs ${x}).

After processing the variables common to jobs and objs/mbrs, this defers to the child classes by calling internalGetSubstitutionValue.


getCommandSubsystem

public QSYSCommandSubSystem getCommandSubsystem(Object context)

getOSType

public String getOSType()

getHost

public abstract IHost getHost(Object element)

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.