Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.subsystems.shells.core.subsystems
Class RemoteCmdSubSystem


java.lang.Object
  extended by 

org.eclipse.rse.core.model.RSEPersistableObject
      extended by 

org.eclipse.rse.core.model.PropertySetContainer
          extended by 

org.eclipse.rse.core.model.RSEModelObject
              extended by 

org.eclipse.rse.core.subsystems.SubSystem
                  extended by 
org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem
All Implemented Interfaces:
IAdaptable, ISchedulingRule, ISystemFilterPoolReferenceManagerProvider, IPropertySetContainer, IRSEModelObject, IRSEPersistableContainer, ICommunicationsListener, IRemoteObjectResolver, ISubSystem, IRemoteCmdSubSystem
Direct Known Subclasses:
ShellServiceSubSystem

public abstract class RemoteCmdSubSystem
extends SubSystem
implements IRemoteCmdSubSystem, ICommunicationsListener

This is the abstraction of a subsystem specialized for remote execution of commands.


Nested Class Summary
protected  class RemoteCmdSubSystem.CancelShellJob
          Represents the subsystem operation of cancelling a remote shell.
 class RemoteCmdSubSystem.Refresh
           
 class RemoteCmdSubSystem.RefreshRemovedShell
           
 class RemoteCmdSubSystem.RefreshSubSystem
           
protected  class RemoteCmdSubSystem.RemoveShellJob
          Represents the subsystem operation of cancelling and removing a remote shell from the view.
protected  class RemoteCmdSubSystem.RunCommandJob
          Represents the subsystem operation of running a remote command.
protected  class RemoteCmdSubSystem.RunShellJob
          Represents the subsystem operation of running a remote shell.
protected  class RemoteCmdSubSystem.SendCommandToShellJob
          Represents the subsystem operation of sending a command to a remote shell.
 
Nested classes/interfaces inherited from class org.eclipse.rse.core.subsystems. SubSystem
SubSystem.ChangeStatusJob, SubSystem.ConnectJob, SubSystem.DisconnectJob, SubSystem.DisplayErrorMessageJob, SubSystem.GetPropertiesJob, SubSystem.GetPropertyJob, SubSystem.ResolveAbsoluteJob, SubSystem.ResolveAbsolutesJob, SubSystem.ResolveRelativeJob, SubSystem.SetPropertiesJob, SubSystem.SetPropertyJob, SubSystem.SubSystemOperationJob, SubSystem.SystemMessageDialogRunnable
 
Field Summary
protected   ArrayList _cmdShells
           
protected   IRemoteCommandShell _defaultShell
           
protected   IRemoteFileSubSystem _fileSubSystem
           
 
Fields inherited from class org.eclipse.rse.core.subsystems. SubSystem
_connectionError, _connectorService, _disconnecting, _hidden, _host, _name, _subsystemConfigurationId, cancelable, doConnection, filterPoolReferenceManager, OPERATION_CANCEL_SHELL, OPERATION_CONNECT, OPERATION_DISCONNECT, OPERATION_GET_PROPERTIES, OPERATION_GET_PROPERTY, OPERATION_REMOVE_SHELL, OPERATION_RESOLVE_ABSOLUTE, OPERATION_RESOLVE_ABSOLUTES, OPERATION_RESOLVE_RELATIVE, OPERATION_RUN_COMMAND, OPERATION_RUN_SHELL, OPERATION_SEND_COMMAND_TO_SHELL, OPERATION_SET_PROPERTIES, OPERATION_SET_PROPERTY, parentSubSystemConfiguration, pmDialog, previousUserIdKey, runInThread, saveFileName, shell, sortResults, SUBSYSTEM_FILE_NAME, supportsConnecting
 
Fields inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
NO_CHILDREN
 
Constructor Summary
RemoteCmdSubSystem ( IHost host, IConnectorService connectorService)
           
 
Method Summary
 void addEnvironmentVariable ( IRemoteSystemEnvVar rsev)
          Add environment variable entry, given a RemoteSystemEnvVar object
 void addEnvironmentVariable ( String name, String value)
          Add environment variable entry, given a name and value
 void cancelAllShells ()
           
 void cancelShell ( Object commandObject)
          Cancel a shell or running command.
 void cancelShell ( Object commandObject, IProgressMonitor monitor)
          Cancel a shell or running command.
 boolean canRunCommand ()
          Determine whether the command subsystem can run a command
 boolean canRunShell ()
          Determine whether the command subsystem can run a shell
 boolean checkForCancel ( IProgressMonitor monitor)
          Long running list processing calls this method to check for a user-cancel event.
 void communicationsStateChange ( CommunicationsEvent e)
          This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes.
  IPropertySet createPropertySet ( String name)
          Creates a new property set of a particular name in this container.
  ICandidateCommand[] getCandidateCommands ( Object context)
          Lists the possible commands for the given context
  Object[] getChildren ()
          Return the children of this subsystem, to populate the GUI subtree of this subsystem.
  IRemoteCmdSubSystem getCommandSubSystem ()
          Return the associated command subsystem.
  IRemoteCommandShell getDefaultShell ()
          Get the default running command shell for this command subsystem.
  IRemoteSystemEnvVar getEnvironmentVariable ( String name)
          Given an environment variable name, find its RemoteSystemEnvVar object.
  IRemoteSystemEnvVar[] getEnvironmentVariableList ()
          Get the initial environment variable list as a string of RemoteSystemEnvVar objects.
  String getEnvironmentVariableValue ( String name)
          Given an environment variable name, find its value.
protected   String[] getEnvVarsAsStringArray ()
           
  IRemoteFileSubSystem getFileSubSystem ()
           
  String getInvalidEnvironmentVariableNameCharacters ()
          Default implementation of getInvalidEnvironmentVariableNameCharacters.
  Object getObjectWithAbsoluteName ( String key, IProgressMonitor monitor)
          Return the object within the subsystem that corresponds to the specified unique ID.
  IRemoteCmdSubSystemConfiguration getParentRemoteCmdSubSystemConfiguration ()
          Return parent subsystem factory, cast to a RemoteCmdSubSystemConfiguration
  IRemoteCommandShell[] getShells ()
          Get all command shells and transient commands that have been run or are running for this command subsystem.
protected   String[] getUserAndHostEnvVarsAsStringArray ()
           
 boolean hasChildren ()
          CHILD CLASSES MAY OVERRIDE THIS.
 void initializeSubSystem ( IProgressMonitor monitor)
          Initialize this subsystem instance after the corresponding IConnectorService connect method finishes.
protected  void internalCancelShell ( Object command, IProgressMonitor monitor)
          Cancels a running shell.
protected  void internalRemoveShell ( Object command)
           
protected   Object[] internalResolveFilterString ( String filterString, IProgressMonitor monitor)
          Actually resolve an absolute filter string.
protected   Object[] internalRunCommand ( String cmd, Object context, boolean interpretOutput, IProgressMonitor monitor)
          Runs a remote command and interprets any resulting output.
protected   Object[] internalRunCommand ( String cmd, Object context, IProgressMonitor monitor)
          Runs a remote command.
protected   IRemoteCommandShell internalRunShell ( Object context, IProgressMonitor monitor)
          Establishes a new shell.
protected  void internalSendCommandToShell ( String cmd, Object command, IProgressMonitor monitor)
          Sends a command to a shell for execution.
 boolean isPassiveCommunicationsListener ()
          This method determines if the communications listener is a passive or active listener.
protected  boolean isUniqueVariable ( List variables, String varName)
           
 boolean isWindows ()
           
protected   List parsePathEnvironmentVariable ( String path)
           
 void removeEnvironmentVariable ( IRemoteSystemEnvVar rsev)
          Remove environment variable entry given its RemoteSystemEnvVar object
 void removeEnvironmentVariable ( String name)
          Remove environment variable entry given only its environment variable name
 void removeShell ( Object commandObject)
          Remove and Cancel a shell or running command.
  IRemoteCommandShell[] restoreShellState ( Shell shellWindow)
          Restore all the command shells that were open before disconnecting during the previous session
  Object[] runCommand ( String command, Object context)
          Deprecated. use runCommand(String, Object, IProgressMonitor)
  Object[] runCommand ( String command, Object context, boolean interpretOutput)
          Deprecated. use runCommand(String, Object, boolean, IProgressMonitor)
  Object[] runCommand ( String command, Object context, boolean interpretOutput, IProgressMonitor monitor)
          overridden so that for universal we don't need to do in modal thread
  Object[] runCommand ( String command, Object context, IProgressMonitor monitor)
          Execute a remote command.
  IRemoteCommandShell runShell ( Object context)
          Deprecated. use runShell(Object, IProgressMonitor)
  IRemoteCommandShell runShell ( Object context, IProgressMonitor monitor)
          overridden so that for universal we don't need to do in modal thread
protected  void saveShellState ( List cmdShells)
           
 void sendCommandToShell ( String input, Object commandObject, IProgressMonitor monitor)
          Send a command as input to a running command shell.
 void setEnvironmentVariableList ( String[] names, String[] values)
          Set the initial environment variable list entries, all in one shot, using a pair of String arrays: the first is the environment variable names, the second is the corresponding environment variable values.
 
Methods inherited from class org.eclipse.rse.core.subsystems. SubSystem
addResolvedFilterStringObjects, canSwitchTo, checkIsConnected, clearLocalUserId, commit, connect, connect, contains, deletingConnection, disconnect, disconnect, displayAsyncMsg, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, doesFilterTypeMatch, filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, forceUserIdToUpperCase, getAdapter, getCacheManager, getConfigurationId, getConnectionOwnedFilterPoolName, getConnectionPrivateFilterPool, getConnectorService, getExecutedCommands, getFilterPoolReferenceManager, getFilterReferenceWithAbsoluteName, getFirstParentFilterString, getHost, getHostAliasName, getHostName, getInteractionProvider, getLocalUserId, getLocalUserId, getName, getObjectWithAbsoluteName, getPersistableChildren, getPersistableParent, getPreferencesKey, getPreferencesKey, getPrimarySubSystem, getProperties, getProperty, getPropertyPage, getQueryingMessage, getQueryingMessage, getRemoteAttribute, getResolvingMessage, getRunnableContext, getRunningMessage, getServiceType, getSettingMessage, getSettingMessage, getShell, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, getTargetsForFilter, getUniqueOwningSystemFilterPool, getUserId, getVendorAttribute, implicitConnect, internalDisconnect, internalGetProperties, internalGetProperty, internalResolveFilterString, internalResolveFilterStrings, internalSetProperties, internalSetProperty, internalSwitchSubSystemConfiguration, isConflicting, isConnected, isConnectionError, isHidden, isOffline, isPrimarySubSystem, promptForPassword, promptForPassword, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterStrings, scheduleJob, selectCommandSubSystem, setConfigurationId, setConnectionError, setConnectorService, setFilterPoolReferenceManager, setHidden, setHost, setInteractionProvider, setName, setProperties, setProperty, setRemoteAttribute, setSubSystemConfiguration, setVendorAttribute, showConnectCancelledMessage, showConnectErrorMessage, showDisconnectCancelledMessage, showDisconnectErrorMessage, showOperationCancelledMessage, showOperationErrorMessage, showOperationMessage, sortResolvedFilterStringObjects, supportsCaching, switchServiceFactory, uninitializeSubSystem
 
Methods inherited from class org.eclipse.rse.core.model. RSEModelObject
getDescription
 
Methods inherited from class org.eclipse.rse.core.model. PropertySetContainer
addPropertySet, addPropertySets, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from class org.eclipse.rse.core.model. RSEPersistableObject
compareStrings, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.subsystems.shells.core.subsystems. IRemoteCmdSubSystem
getExecutedCommands, getHostEnvironmentVariables
 
Methods inherited from interface org.eclipse.rse.core.subsystems. ISubSystem
canSwitchTo, checkIsConnected, clearLocalUserId, connect, connect, deletingConnection, disconnect, disconnect, doesFilterListContentsOf, doesFilterMatch, doesFilterStringListContentsOf, doesFilterStringMatch, forceUserIdToUpperCase, getCacheManager, getConfigurationId, getConnectorService, getFilterPoolReferenceManager, getHost, getHostAliasName, getLocalUserId, getName, getPrimarySubSystem, getProperties, getProperty, getServiceType, getSubSystemConfiguration, getSystemFilterPoolReferenceManager, getSystemProfile, getSystemProfileName, getTargetForFilter, getUserId, getVendorAttribute, isConnected, isConnectionError, isHidden, isOffline, isPrimarySubSystem, renamingConnection, renamingProfile, resolveFilterString, resolveFilterString, resolveFilterStrings, setConfigurationId, setConnectionError, setConnectorService, setFilterPoolReferenceManager, setHidden, setHost, setName, setProperties, setProperty, setSubSystemConfiguration, setVendorAttribute, supportsCaching, switchServiceFactory, uninitializeSubSystem
 
Methods inherited from interface org.eclipse.rse.core.filters. ISystemFilterPoolReferenceManagerProvider
filterEventFilterCreated, filterEventFilterPoolReferenceCreated, filterEventFilterPoolReferenceDeleted, filterEventFilterPoolReferenceRenamed, filterEventFilterPoolReferenceReset, filterEventFilterPoolReferencesRePositioned, filterEventFilterPoolReferencesReset, filterEventFilterStringCreated, getUniqueOwningSystemFilterPool
 
Methods inherited from interface org.eclipse.rse.core.subsystems. IRemoteObjectResolver
getObjectWithAbsoluteName
 
Methods inherited from interface org.eclipse.core.runtime.jobs. ISchedulingRule
contains, isConflicting
 
Methods inherited from interface org.eclipse.rse.core.model. IRSEModelObject
getDescription
 
Methods inherited from interface org.eclipse.rse.core.model. IPropertySetContainer
addPropertySet, addPropertySets, createPropertySet, getPropertySet, getPropertySets, removePropertySet
 
Methods inherited from interface org.eclipse.rse.core.model. IRSEPersistableContainer
commit, getPersistableChildren, getPersistableParent, isDirty, isTainted, setDirty, setTainted, setWasRestored, wasRestored
 

Field Detail

_cmdShells

protected 
ArrayList _cmdShells

_defaultShell

protected 
IRemoteCommandShell _defaultShell

_fileSubSystem

protected 
IRemoteFileSubSystem _fileSubSystem
Constructor Detail

RemoteCmdSubSystem

public RemoteCmdSubSystem(
IHost host,
                          
IConnectorService connectorService)
Method Detail

initializeSubSystem

public void initializeSubSystem(
IProgressMonitor monitor)
                         throws 
SystemMessageException
Description copied from class: SubSystem
Initialize this subsystem instance after the corresponding IConnectorService connect method finishes. This method should be overridden if any initialization for the subsystem needs to occur at this time.

The default implementation currently does nothing, but overriding methods should call super before doing any other work.

Specified by:
initializeSubSystem in interface ISubSystem
Overrides:
initializeSubSystem in class SubSystem
Parameters:
monitor - a progress monitor that can be used to show progress during long-running operation. Cancellation is typically not supported since it might leave the system in an inconsistent state.
Throws:
SystemMessageException - if an error occurs during initialization.

getParentRemoteCmdSubSystemConfiguration

public 
IRemoteCmdSubSystemConfiguration getParentRemoteCmdSubSystemConfiguration()
Return parent subsystem factory, cast to a RemoteCmdSubSystemConfiguration

Specified by:
getParentRemoteCmdSubSystemConfiguration in interface IRemoteCmdSubSystem

checkForCancel

public boolean checkForCancel(
IProgressMonitor monitor)
Long running list processing calls this method to check for a user-cancel event. If user did cancel, an exception is thrown.

Returns:
true if caller wants to cancel

getEnvironmentVariableList

public 
IRemoteSystemEnvVar[] getEnvironmentVariableList()
Get the initial environment variable list as a string of RemoteSystemEnvVar objects. Array returned may be size zero but will not be null.

Specified by:
getEnvironmentVariableList in interface IRemoteCmdSubSystem

setEnvironmentVariableList

public void setEnvironmentVariableList(
String[] names,
                                       
String[] values)
Set the initial environment variable list entries, all in one shot, using a pair of String arrays: the first is the environment variable names, the second is the corresponding environment variable values.

Specified by:
setEnvironmentVariableList in interface IRemoteCmdSubSystem
Parameters:
names - the array of names
values - the array of string values

addEnvironmentVariable

public void addEnvironmentVariable(
String name,
                                   
String value)
Add environment variable entry, given a name and value

Specified by:
addEnvironmentVariable in interface IRemoteCmdSubSystem

addEnvironmentVariable

public void addEnvironmentVariable(
IRemoteSystemEnvVar rsev)
Add environment variable entry, given a RemoteSystemEnvVar object

Specified by:
addEnvironmentVariable in interface IRemoteCmdSubSystem

removeEnvironmentVariable

public void removeEnvironmentVariable(
IRemoteSystemEnvVar rsev)
Remove environment variable entry given its RemoteSystemEnvVar object

Specified by:
removeEnvironmentVariable in interface IRemoteCmdSubSystem
Parameters:
rsev - the remote system environment variable to remove

removeEnvironmentVariable

public void removeEnvironmentVariable(
String name)
Remove environment variable entry given only its environment variable name

Specified by:
removeEnvironmentVariable in interface IRemoteCmdSubSystem

getEnvironmentVariable

public 
IRemoteSystemEnvVar getEnvironmentVariable(
String name)
Given an environment variable name, find its RemoteSystemEnvVar object. Returns null if not found.

Specified by:
getEnvironmentVariable in interface IRemoteCmdSubSystem

getEnvironmentVariableValue

public 
String getEnvironmentVariableValue(
String name)
Given an environment variable name, find its value. Returns null if not found.

Specified by:
getEnvironmentVariableValue in interface IRemoteCmdSubSystem

getEnvVarsAsStringArray

protected 
String[] getEnvVarsAsStringArray()

isUniqueVariable

protected boolean isUniqueVariable(
List variables,
                                   
String varName)

getUserAndHostEnvVarsAsStringArray

protected 
String[] getUserAndHostEnvVarsAsStringArray()

isWindows

public boolean isWindows()

getCandidateCommands

public 
ICandidateCommand[] getCandidateCommands(
Object context)
Lists the possible commands for the given context

Specified by:
getCandidateCommands in interface IRemoteCmdSubSystem
Parameters:
context - the context for a command
Returns:
the list of possible commands

parsePathEnvironmentVariable

protected 
List parsePathEnvironmentVariable(
String path)

getFileSubSystem

public 
IRemoteFileSubSystem getFileSubSystem()

getInvalidEnvironmentVariableNameCharacters

public 
String getInvalidEnvironmentVariableNameCharacters()
Default implementation of getInvalidEnvironmentVariableNameCharacters. This default implementation just returns "=" (the only invalid character is the = sign.) Subclasses can override this to provide a more comprehensive list.

Specified by:
getInvalidEnvironmentVariableNameCharacters in interface IRemoteCmdSubSystem
See Also:
IRemoteCmdSubSystem.getInvalidEnvironmentVariableNameCharacters()

getCommandSubSystem

public 
IRemoteCmdSubSystem getCommandSubSystem()
Return the associated command subsystem. By default, returns the first command subsystem found for this connection, but can be refined by each subsystem implementation. For command subsystems, returns "this".


internalResolveFilterString

protected 
Object[] internalResolveFilterString(
String filterString,
                                               
IProgressMonitor monitor)
                                        throws 
InvocationTargetException,
                                               
InterruptedException
Actually resolve an absolute filter string. This is called by the run(IProgressMonitor monitor) method, which in turn is called by resolveFilterString.

Overrides:
internalResolveFilterString in class SubSystem
Throws:
InvocationTargetException
InterruptedException
See Also:
SubSystem.internalResolveFilterString(String,IProgressMonitor)

getChildren

public 
Object[] getChildren()
Description copied from class: SubSystem
Return the children of this subsystem, to populate the GUI subtree of this subsystem. By default, this method:
  • Returns the filter pool references of this subsystem, if supportsFilters() is true for our factory.
  • If supportsFilters() is false from our factory, returns null
So, be sure to override this method IF you do not support filters. Lazy Loading: Note that if your subsystem does not support connecting, and you do not support filters, here is a good point to ensure that the bundles which declare your UI adapters get loaded, since the default code which overriders usually place in SubSystem.initializeSubSystem(IProgressMonitor) is not called in that case. Similarly, if your subsystem declares custom images for filters or filter pools, overriding the getChildren() call here to first load your filter adapters and THEN super.getChildren() is a good idea.

Specified by:
getChildren in interface ISubSystem
Overrides:
getChildren in class SubSystem

hasChildren

public boolean hasChildren()
Description copied from class: SubSystem
CHILD CLASSES MAY OVERRIDE THIS. By default it returns true iff we support filters and there are filter pool references.

Specified by:
hasChildren in interface ISubSystem
Overrides:
hasChildren in class SubSystem

getDefaultShell

public 
IRemoteCommandShell getDefaultShell()
                                    throws 
Exception
Get the default running command shell for this command subsystem. If no such shell exists or is running, a new one is launched.

Specified by:
getDefaultShell in interface IRemoteCmdSubSystem
Returns:
the default running command shell
Throws:
Exception

getShells

public 
IRemoteCommandShell[] getShells()
Get all command shells and transient commands that have been run or are running for this command subsystem.

Specified by:
getShells in interface IRemoteCmdSubSystem
Returns:
the list of running command shells and commands

canRunShell

public boolean canRunShell()
Determine whether the command subsystem can run a shell

Specified by:
canRunShell in interface IRemoteCmdSubSystem
Returns:
whether a shell can be run or not

canRunCommand

public boolean canRunCommand()
Determine whether the command subsystem can run a command

Specified by:
canRunCommand in interface IRemoteCmdSubSystem
Returns:
whether a command can be run or not

getObjectWithAbsoluteName

public 
Object getObjectWithAbsoluteName(
String key,
                                        
IProgressMonitor monitor)
                                 throws 
Exception
Return the object within the subsystem that corresponds to the specified unique ID. For remote command, the key is determined by the command ID and the output ID.

Specified by:
getObjectWithAbsoluteName in interface IRemoteObjectResolver
Overrides:
getObjectWithAbsoluteName in class SubSystem
Parameters:
key - the unique id of the remote object. Must not be null.
monitor - the progress monitor
Returns:
the remote object instance, or null if no object is found with the given id.
Throws:
Exception - in case an error occurs contacting the remote system while retrieving the requested remote object. Extenders are encouraged to throw SystemMessageException in order to support good user feedback in case of errors. Since exceptions should only occur while retrieving new remote objects during startup, clients are typically allowed to ignore these exceptions and treat them as if the remote object were simply not there.
See Also:
IRemoteObjectResolver.getObjectWithAbsoluteName(String, IProgressMonitor)

saveShellState

protected void saveShellState(
List cmdShells)

internalRemoveShell

protected void internalRemoveShell(
Object command)
                            throws 
InvocationTargetException,
                                   
InterruptedException
Throws:
InvocationTargetException
InterruptedException

restoreShellState

public 
IRemoteCommandShell[] restoreShellState(
Shell shellWindow)
Description copied from interface: IRemoteCmdSubSystem
Restore all the command shells that were open before disconnecting during the previous session

Specified by:
restoreShellState in interface IRemoteCmdSubSystem
Parameters:
shellWindow - a window used for notification
Returns:
the command shells that were restored

cancelAllShells

public void cancelAllShells()

isPassiveCommunicationsListener

public boolean isPassiveCommunicationsListener()
Description copied from interface: ICommunicationsListener
This method determines if the communications listener is a passive or active listener. Typically a passive listener registers with the communications system and responds to events as they occur. An active listener typically registers with the communications system only for the duration of the task (i.e. user editing a file, or outstanding communications request.) The user will be prompted on a disconnect if there are any active communication listeners registered.

Specified by:
isPassiveCommunicationsListener in interface ICommunicationsListener
Returns:
false if the communications listener is an active listener, true if the communications listener is a passive listener.
See Also:
ICommunicationsListener.isPassiveCommunicationsListener()

communicationsStateChange

public void communicationsStateChange(
CommunicationsEvent e)
Description copied from interface: ICommunicationsListener
This method is invoked whenever the communications state is invoked immediately before and after the state of the communications changes. The state field in CommunicationsEvent determines which state change is about to or has occurred.

Specified by:
communicationsStateChange in interface ICommunicationsListener

createPropertySet

public 
IPropertySet createPropertySet(
String name)
Description copied from interface: IPropertySetContainer
Creates a new property set of a particular name in this container. If one already exists by this name, it is replaced with a new empty property set. In order to have the property set persisted, the implementing class should also implement IRSEPersistableContainer. The IRSEPersistableContainer.commit() method must then be used to commit any changes into persistent storage.

Specified by:
createPropertySet in interface IPropertySetContainer
Overrides:
createPropertySet in class PropertySetContainer
Parameters:
name - the name of the property set.
Returns:
The property set.

runCommand

public 
Object[] runCommand(
String command,
                           
Object context,
                           boolean interpretOutput)
                    throws 
Exception
Deprecated. use runCommand(String, Object, boolean, IProgressMonitor)

overridden so that for universal we don't need to do in modal thread

Throws:
Exception

runCommand

public 
Object[] runCommand(
String command,
                           
Object context,
                           boolean interpretOutput,
                           
IProgressMonitor monitor)
                    throws 
Exception
overridden so that for universal we don't need to do in modal thread

Specified by:
runCommand in interface IRemoteCmdSubSystem
Parameters:
command - Command to be executed remotely.
context - context of a command (i.e. working directory). Null is valid and means to run the command as a shell command in the default shell.
interpretOutput - whether to interpret the output or not
monitor - the progress monitor
Returns:
Array of objects that are the result of running this command. In a typical use, such as a command run from a shell, there is only one result in the array and that is the IRemoteCommandShell object. In that cause, the lines of output for the shell are contained as children under the IRemoteCommandShell object.
Throws:
Exception

runShell

public 
IRemoteCommandShell runShell(
Object context)
                             throws 
Exception
Deprecated. use runShell(Object, IProgressMonitor)

overridden so that for universal we don't need to do in modal thread

Throws:
Exception

runShell

public 
IRemoteCommandShell runShell(
Object context,
                                    
IProgressMonitor monitor)
                             throws 
Exception
overridden so that for universal we don't need to do in modal thread

Specified by:
runShell in interface IRemoteCmdSubSystem
Parameters:
context - context of a shell (i.e. working directory). Null is valid and means to use the default context.
monitor - the progress monitor
Returns:
An object that represents the command and it's output.
Throws:
Exception

runCommand

public 
Object[] runCommand(
String command,
                           
Object context)
                    throws 
Exception
Deprecated. use runCommand(String, Object, IProgressMonitor)

Execute a remote command. This is only applicable if the subsystem factory reports true for supportsCommands().

Parameters:
command - Command to be executed remotely.
context - context of a command (i.e. working directory). null is valid and means to use the default context.
Returns:
Array of objects that are the result of running this command. Typically, these are messages logged by the command.
Throws:
Exception

runCommand

public 
Object[] runCommand(
String command,
                           
Object context,
                           
IProgressMonitor monitor)
                    throws 
Exception
Execute a remote command. This is only applicable if the subsystem factory reports true for supportsCommands().

Specified by:
runCommand in interface IRemoteCmdSubSystem
Parameters:
command - Command to be executed remotely.
context - context of a command (i.e. working directory). null is valid and means to use the default context.
monitor - the progress monitor
Returns:
Array of objects that are the result of running this command. Typically, these are messages logged by the command.
Throws:
Exception

sendCommandToShell

public void sendCommandToShell(
String input,
                               
Object commandObject,
                               
IProgressMonitor monitor)
                        throws 
Exception
Send a command as input to a running command shell.

Specified by:
sendCommandToShell in interface IRemoteCmdSubSystem
Parameters:
input - the command to invoke in the shell.
commandObject - the shell or command to send the invocation to.
monitor - the progress monitor
Throws:
Exception

cancelShell

public void cancelShell(
Object commandObject)
                 throws 
Exception
Cancel a shell or running command.

Parameters:
commandObject - the shell or command to cancel.
Throws:
Exception

cancelShell

public void cancelShell(
Object commandObject,
                        
IProgressMonitor monitor)
                 throws 
Exception
Cancel a shell or running command.

Specified by:
cancelShell in interface IRemoteCmdSubSystem
Parameters:
commandObject - the shell or command to cancel.
monitor - the progress monitor
Throws:
Exception

removeShell

public void removeShell(
Object commandObject)
                 throws 
Exception
Remove and Cancel a shell or running command.

Specified by:
removeShell in interface IRemoteCmdSubSystem
Parameters:
commandObject - the shell or command to cancel.
Throws:
Exception

internalRunCommand

protected 
Object[] internalRunCommand(
String cmd,
                                      
Object context,
                                      
IProgressMonitor monitor)
                               throws 
InvocationTargetException,
                                      
InterruptedException,
                                      
SystemMessageException
Runs a remote command. This method must be overridden by implementers of command subsystems.

Parameters:
cmd - The command to execute.
context - The IServiceCommandShell that provides the context in which to run this command.
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
Returns:
an array of 1 object, the IServiceCommandShell, which can be queried for output.
Throws:
InterruptedException - if the user cancels the operation
SystemMessageException - if the command results in an error on the target system
InvocationTargetException - if something else bad happens

internalRunCommand

protected 
Object[] internalRunCommand(
String cmd,
                                      
Object context,
                                      boolean interpretOutput,
                                      
IProgressMonitor monitor)
                               throws 
InvocationTargetException,
                                      
InterruptedException,
                                      
SystemMessageException
Runs a remote command and interprets any resulting output. This method must be overridden by implementers of command subsystems.

Parameters:
cmd - The command to execute.
context - The IServiceCommandShell that provides the context in which to run this command.
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
Returns:
an array of 1 object, the IServiceCommandShell, which can be queried for output.
Throws:
InterruptedException - if the user cancels the operation
SystemMessageException - if the command results in an error on the target system
InvocationTargetException - if something else bad happens

internalRunShell

protected 
IRemoteCommandShell internalRunShell(
Object context,
                                               
IProgressMonitor monitor)
                                        throws 
InvocationTargetException,
                                               
InterruptedException,
                                               
SystemMessageException
Establishes a new shell. This causes the shell to start and establish its initial environment. This method must be overridden by implementers of command subsystems.

Parameters:
context - the current directory for this shell. Can be a String containing a path name to be used as the current directory or an IRemoteFile representing a directory. If null or "null", the home directory is used.
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
Returns:
the newly established shell.
Throws:
InterruptedException - if the user cancels the operation
SystemMessageException - if the command results in an error on the target system
InvocationTargetException - if something else bad happens

internalCancelShell

protected void internalCancelShell(
Object command,
                                   
IProgressMonitor monitor)
                            throws 
InvocationTargetException,
                                   
InterruptedException
Cancels a running shell. This method must be overridden by implementers of command subsystems.

Parameters:
command - the IServiceCommandShell to cancel.
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
Throws:
InterruptedException - if the user cancels the operation
InvocationTargetException - if something else bad happens

internalSendCommandToShell

protected void internalSendCommandToShell(
String cmd,
                                          
Object command,
                                          
IProgressMonitor monitor)
                                   throws 
InvocationTargetException,
                                          
InterruptedException
Sends a command to a shell for execution. This method must be overridden by implementers of command subsystems.

Parameters:
cmd - the command to execute.
command - the IServiceCommandShell that provides the context in which to execute the command.
monitor - a monitor for progress and cancellation, the caller is expected to call monitor.done()
Throws:
InterruptedException - if the user cancels the operation
InvocationTargetException - if something else bad happens

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire