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.services.clientserver.processes
Class HostProcessFilterImpl


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

public class HostProcessFilterImpl
extends Object
implements IHostProcessFilter, Cloneable

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().

Clients may instantiate or subclass this class. When subclassing, clients need to ensure that the subclass is always capable of performing a deep clone operation with the clone() method, so if they add fields of complex type, these need to be dealt with by overriding clone().


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
           
 
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.
  Object clone ()
          Return an identical (deep) copy of this filter.
 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)
          Check whether this filter requires that the given state is set.
  String getUsername ()
          Return the username part of this filter string.
protected  void init ()
           
protected  void initInput ( String input)
           
protected  void initStates ()
           
 boolean satisfiesState ( String stateString)
          Check whether a given process state String matches this filter.
 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)
          Change this filter such that it requires the given state to be set.
 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
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)

getName

public 
String getName()
Description copied from interface: IHostProcessFilter
Return the process name part of this filter string.

Specified by:
getName in interface IHostProcessFilter

getUsername

public 
String getUsername()
Description copied from interface: IHostProcessFilter
Return the username part of this filter string.

Specified by:
getUsername in interface IHostProcessFilter

getGid

public 
String getGid()
Description copied from interface: IHostProcessFilter
Return the process group id (gid) part of this filter string.

Specified by:
getGid in interface IHostProcessFilter

getPpid

public 
String getPpid()
Description copied from interface: IHostProcessFilter
Return the process parent id (ppid) part of this filter string.

Specified by:
getPpid in interface IHostProcessFilter

getPid

public 
String getPid()
Description copied from interface: IHostProcessFilter
Return the process id (pid) part of this filter string.

Specified by:
getPid in interface IHostProcessFilter

getAnyStatus

public boolean getAnyStatus()
Description copied from interface: IHostProcessFilter
Returns true when all process states are selected. The individual state queries will return false in this case.

Specified by:
getAnyStatus in interface IHostProcessFilter

getMinVM

public 
String getMinVM()
Description copied from interface: IHostProcessFilter
Returns the minimum VM size for processes allowed by this filter

Specified by:
getMinVM in interface IHostProcessFilter

getMaxVM

public 
String getMaxVM()
Description copied from interface: IHostProcessFilter
Returns the maximum VM size for processes allowed by this filter

Specified by:
getMaxVM in interface IHostProcessFilter

setName

public void setName(
String obj)
Description copied from interface: IHostProcessFilter
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)
Description copied from interface: IHostProcessFilter
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)
Description copied from interface: IHostProcessFilter
Set the process group id (gid) part of this filter string.

Specified by:
setGid in interface IHostProcessFilter

setPpid

public void setPpid(
String obj)
Description copied from interface: IHostProcessFilter
Set the process parent id part of this filter string.

Specified by:
setPpid in interface IHostProcessFilter

setPid

public void setPid(
String obj)
Description copied from interface: IHostProcessFilter
Set the process id part of this filter string.

Specified by:
setPid in interface IHostProcessFilter

setAnyStatus

public void setAnyStatus()
Description copied from interface: IHostProcessFilter
Select all/any process states

Specified by:
setAnyStatus in interface IHostProcessFilter

setMinVM

public void setMinVM(
String strMinVM)
Description copied from interface: IHostProcessFilter
Sets the minimum VM size for processes allowed by this filter

Specified by:
setMinVM in interface IHostProcessFilter

setMaxVM

public void setMaxVM(
String strMaxVM)
Description copied from interface: IHostProcessFilter
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.

Overrides:
toString in class Object

toStateString

protected 
String toStateString()

allows

public boolean allows(
String status)
Description copied from interface: IHostProcessFilter
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)
Description copied from interface: IHostProcessFilter
Check whether this filter requires that the given state is set.

Specified by:
getSpecificState in interface IHostProcessFilter
Parameters:
stateCode - state code to check. One of the String constants in ISystemProcessRemoteConstants.ALL_STATES_STR.

setSpecificState

public void setSpecificState(
String stateCode)
Description copied from interface: IHostProcessFilter
Change this filter such that it requires the given state to be set.

Specified by:
setSpecificState in interface IHostProcessFilter
Parameters:
stateCode - state code to check. One of the String constants in ISystemProcessRemoteConstants.ALL_STATES_STR.

satisfiesState

public boolean satisfiesState(
String stateString)
Description copied from interface: IHostProcessFilter
Check whether a given process state String matches this filter.

Specified by:
satisfiesState in interface IHostProcessFilter
Parameters:
stateString - A state String, holding a list of state constants from ISystemProcessRemoteConstants.ALL_STATES_STR, separated by comma (",").

clone

public 
Object clone()
Return an identical (deep) copy of this filter. Subclasses must ensure that such a deep copy operation is always possible, so their state must always be cloneable. Which should always be possible to achieve, since this Object also needs to be serializable.

Overrides:
clone in class Object

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