RSE
Release 1.0

org.eclipse.rse.services.clientserver.processes
Class HostProcessFilterImpl

java.lang.Object
  extended byorg.eclipse.rse.services.clientserver.processes.HostProcessFilterImpl
All Implemented Interfaces:
Cloneable, IHostProcessFilter, ISystemProcessRemoteConstants

public class HostProcessFilterImpl
extends Object
implements IHostProcessFilter, Cloneable, ISystemProcessRemoteConstants

A class representing a remote process filter string. This is a name pattern for returning lists of remote processes when used as input to the UniversalProcessMiner class. Valid generic names are names with one or two asterisks anywhere in the name, as in: ABC* or *ABC or A*C *ABC* or *A*C or A*C* To get the actual filter string back from objects of this class, just call toString().


Field Summary
protected  boolean _resolveVariables
           
static String ALL
           
protected  boolean anystatus
           
protected  String gid
           
protected  long maxVM
           
protected  long minVM
           
protected  String name
           
protected  String pid
           
protected  String ppid
           
protected  HashMap states
           
protected  String status
           
protected  String username
           
protected static char WILDCARD
           
 
Fields inherited from interface org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants
ALL_STATES, ALL_STATES_STR, PROCESS_ATTRIBUTES_COUNT, PROCESS_ATTRIBUTES_INDEX_EXENAME, PROCESS_ATTRIBUTES_INDEX_GID, PROCESS_ATTRIBUTES_INDEX_PID, PROCESS_ATTRIBUTES_INDEX_PPID, PROCESS_ATTRIBUTES_INDEX_STATUS, PROCESS_ATTRIBUTES_INDEX_TGID, PROCESS_ATTRIBUTES_INDEX_TRACERPID, PROCESS_ATTRIBUTES_INDEX_UID, PROCESS_ATTRIBUTES_INDEX_USERNAME, PROCESS_ATTRIBUTES_INDEX_VMRSS, PROCESS_ATTRIBUTES_INDEX_VMSIZE, PROCESS_MINER_ERROR_NO_HANDLER, PROCESS_MINER_SUCCESS, PROCESS_SIGNAL_TYPE_DEFAULT, STATE_ACTIVE, STATE_ACTIVE_INDEX, STATE_ENDING_INDEX, STATE_IDLE, STATE_IDLE_INDEX, STATE_NONEXISTENT, STATE_NONEXISTENT_INDEX, STATE_PAGING, STATE_PAGING_INDEX, STATE_RUNNING, STATE_RUNNING_INDEX, STATE_SLEEPING, STATE_SLEEPING_INDEX, STATE_STARTING_INDEX, STATE_TRACED, STATE_TRACED_INDEX, STATE_WAITING, STATE_WAITING_INDEX, STATE_ZOMBIE, STATE_ZOMBIE_INDEX, STATE_ZOS_ASYNCHRONOUSTHREAD, STATE_ZOS_ASYNCHRONOUSTHREAD_INDEX, STATE_ZOS_CANCELLED, STATE_ZOS_CANCELLED_INDEX, STATE_ZOS_COMSYSKERNELWAIT, STATE_ZOS_COMSYSKERNELWAIT_INDEX, STATE_ZOS_DETACHED, STATE_ZOS_DETACHED_INDEX, STATE_ZOS_ENDING_INDEX, STATE_ZOS_FILESYSKERNELWAIT, STATE_ZOS_FILESYSKERNELWAIT_INDEX, STATE_ZOS_FORKING, STATE_ZOS_FORKING_INDEX, STATE_ZOS_INITIALPROCESSTHREAD, STATE_ZOS_INITIALPROCESSTHREAD_INDEX, STATE_ZOS_MEDIUMWEIGHTTHREAD, STATE_ZOS_MEDIUMWEIGHTTHREAD_INDEX, STATE_ZOS_MSGQRECEIVEWAIT, STATE_ZOS_MSGQRECEIVEWAIT_INDEX, STATE_ZOS_MSGQSENDWAIT, STATE_ZOS_MSGQSENDWAIT_INDEX, STATE_ZOS_MULTITHREAD, STATE_ZOS_MULTITHREAD_INDEX, STATE_ZOS_MVSPAUSEWAIT, STATE_ZOS_MVSPAUSEWAIT_INDEX, STATE_ZOS_MVSWAIT, STATE_ZOS_MVSWAIT_INDEX, STATE_ZOS_OTHERKERNELWAIT, STATE_ZOS_OTHERKERNELWAIT_INDEX, STATE_ZOS_PTHREADCREATED, STATE_ZOS_PTHREADCREATED_INDEX, STATE_ZOS_PTHREADCREATEDTASKS, STATE_ZOS_PTHREADCREATEDTASKS_INDEX, STATE_ZOS_PTRACEKERNELWAIT, STATE_ZOS_PTRACEKERNELWAIT_INDEX, STATE_ZOS_QUIESCEFROZEN, STATE_ZOS_QUIESCEFROZEN_INDEX, STATE_ZOS_RUNNING, STATE_ZOS_RUNNING_INDEX, STATE_ZOS_SEMAPHOREWAIT, STATE_ZOS_SEMAPHOREWAIT_INDEX, STATE_ZOS_SINGLE, STATE_ZOS_SINGLE_INDEX, STATE_ZOS_SLEEPING, STATE_ZOS_SLEEPING_INDEX, STATE_ZOS_STARTING_INDEX, STATE_ZOS_STOPPED, STATE_ZOS_STOPPED_INDEX, STATE_ZOS_SWAPPEDOUT, STATE_ZOS_SWAPPEDOUT_INDEX, STATE_ZOS_WAITINGFORCHILD, STATE_ZOS_WAITINGFORCHILD_INDEX, STATE_ZOS_ZOMBIE, STATE_ZOS_ZOMBIE_INDEX
 
Constructor Summary
HostProcessFilterImpl()
          Constructor to use when there is no existing filter string.
HostProcessFilterImpl(boolean resolveVariables)
          Constructor to use when there is no existing filter string.
HostProcessFilterImpl(String input)
          Constructor to use when filter string already exists.
HostProcessFilterImpl(String input, boolean resolveVariables)
          Constructor to use when filter string already exists.
 
Method Summary
 boolean allows(String status)
          Returns whether this filter allows a process with the status line status to pass through.
 boolean getAnyStatus()
          Returns true when all process states are selected.
 String getGid()
          Return the process group id (gid) part of this filter string.
 String getMaxVM()
          Returns the maximum VM size for processes allowed by this filter
 String getMinVM()
          Returns the minimum VM size for processes allowed by this filter
 String getName()
          Return the process name part of this filter string.
 String getPid()
          Return the process id (pid) part of this filter string.
 String getPpid()
          Return the process parent id (ppid) part of this filter string.
 boolean getSpecificState(String stateCode)
           
 HashMap getStates()
           
 String getUsername()
          Return the username part of this filter string.
protected  void init()
           
protected  void initInput(String input)
           
protected  void initStates()
           
 boolean satisfiesState(String state)
           
 void setAnyStatus()
          Select all/any process states
 void setGid(String obj)
          Set the process group id (gid) part of this filter string.
 void setMaxVM(String strMaxVM)
          Sets the maximum VM size for processes allowed by this filter
 void setMinVM(String strMinVM)
          Sets the minimum VM size for processes allowed by this filter
 void setName(String obj)
          Set the name part of this filter string.
 void setPid(String obj)
          Set the process id part of this filter string.
 void setPpid(String obj)
          Set the process parent id part of this filter string.
 void setSpecificState(String stateCode)
           
 void setUsername(String obj)
          Set the user id (uid) part of this filter string.
protected  String toStateString()
           
 String toString()
          Convert this filter into a filter string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final String ALL
See Also:
Constant Field Values

WILDCARD

protected static final char WILDCARD
See Also:
Constant Field Values

name

protected String name

username

protected String username

gid

protected String gid

ppid

protected String ppid

pid

protected String pid

minVM

protected long minVM

maxVM

protected long maxVM

anystatus

protected boolean anystatus

status

protected String status

states

protected HashMap states

_resolveVariables

protected boolean _resolveVariables
Constructor Detail

HostProcessFilterImpl

public HostProcessFilterImpl()
Constructor to use when there is no existing filter string.


HostProcessFilterImpl

public HostProcessFilterImpl(boolean resolveVariables)
Constructor to use when there is no existing filter string.


HostProcessFilterImpl

public HostProcessFilterImpl(String input)
Constructor to use when filter string already exists.


HostProcessFilterImpl

public HostProcessFilterImpl(String input,
                             boolean resolveVariables)
Constructor to use when filter string already exists.

Method Detail

initStates

protected void initStates()

init

protected void init()

initInput

protected void initInput(String input)

getStates

public HashMap getStates()
Specified by:
getStates in interface IHostProcessFilter

getName

public String getName()
Return the process name part of this filter string.

Specified by:
getName in interface IHostProcessFilter

getUsername

public String getUsername()
Return the username part of this filter string.

Specified by:
getUsername in interface IHostProcessFilter

getGid

public String getGid()
Return the process group id (gid) part of this filter string.

Specified by:
getGid in interface IHostProcessFilter

getPpid

public String getPpid()
Return the process parent id (ppid) part of this filter string.

Specified by:
getPpid in interface IHostProcessFilter

getPid

public String getPid()
Return the process id (pid) part of this filter string.

Specified by:
getPid in interface IHostProcessFilter

getAnyStatus

public boolean getAnyStatus()
Returns true when all process states are selected. The individal state queries will return false in this case.

Specified by:
getAnyStatus in interface IHostProcessFilter

getMinVM

public String getMinVM()
Returns the minimum VM size for processes allowed by this filter

Specified by:
getMinVM in interface IHostProcessFilter

getMaxVM

public String getMaxVM()
Returns the maximum VM size for processes allowed by this filter

Specified by:
getMaxVM in interface IHostProcessFilter

setName

public void setName(String obj)
Set the name part of this filter string. This can be simple or generic, where generic is a name containing one or two asterisks anywhere in the name.

Specified by:
setName in interface IHostProcessFilter

setUsername

public void setUsername(String obj)
Set the user id (uid) part of this filter string. This can be simple or generic, where generic is a uid containing one or two asterisks anywhere in the name.

Specified by:
setUsername in interface IHostProcessFilter

setGid

public void setGid(String obj)
Set the process group id (gid) part of this filter string.

Specified by:
setGid in interface IHostProcessFilter

setPpid

public void setPpid(String obj)
Set the process parent id part of this filter string.

Specified by:
setPpid in interface IHostProcessFilter

setPid

public void setPid(String obj)
Set the process id part of this filter string.

Specified by:
setPid in interface IHostProcessFilter

setAnyStatus

public void setAnyStatus()
Select all/any process states

Specified by:
setAnyStatus in interface IHostProcessFilter

setMinVM

public void setMinVM(String strMinVM)
Sets the minimum VM size for processes allowed by this filter

Specified by:
setMinVM in interface IHostProcessFilter

setMaxVM

public void setMaxVM(String strMaxVM)
Sets the maximum VM size for processes allowed by this filter

Specified by:
setMaxVM in interface IHostProcessFilter

toString

public String toString()
Convert this filter into a filter string.


toStateString

protected String toStateString()

allows

public boolean allows(String status)
Returns whether this filter allows a process with the status line status to pass through. The status line contains some of the contents of the status file contained in the processes numbered directory in the /proc filesystem. For example, the status line of process 12345 is the contents of the file /proc/12345/stat. The status line must be structured as follows: "pid|name|status|tgid|ppid|tracerpid|uid|username|gid|vmSize|vmRSS"

Specified by:
allows in interface IHostProcessFilter

getSpecificState

public boolean getSpecificState(String stateCode)
Specified by:
getSpecificState in interface IHostProcessFilter

setSpecificState

public void setSpecificState(String stateCode)
Specified by:
setSpecificState in interface IHostProcessFilter

satisfiesState

public boolean satisfiesState(String state)
Specified by:
satisfiesState in interface IHostProcessFilter

RSE
Release 1.0

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