iCMS.pollerd
Class GenericData

java.lang.Object
  extended by MyEventManager
      extended by iCMS.pollerd.GenericData
All Implemented Interfaces:
MonitoredItem
Direct Known Subclasses:
ApplicationData, CmsData, LocationData, NodeData, NodeGroupData, NodeTypeData, ProbeData

public class GenericData
extends MyEventManager
implements MonitoredItem

This class is a data holder for general data

Revision Changes :

Version:
2.0.4
Author:
Chris Lukassen
 

Field Summary
protected  String allocatedMibs
           
protected  boolean canStart
           
protected  boolean canStop
           
protected  Hashtable children
           
protected  Vector descr
           
protected  String host
           
protected  Vector info
           
protected  Vector mibDirs
           
protected  Vector mibs
           
protected  String name
           
protected  GenericData parent
           
protected  ProbeData probe
           
protected  boolean propagate
           
protected  AdvancedSnmpManager snmpMan
           
protected  int status
           
protected  String token
           
protected  String type
           
 
Constructor Summary
GenericData(GenericData parent)
          default constructor
 
Method Summary
 void addChild(GenericData child)
          add a child to this item
 void addDescription(String descr)
          adds a descriptive line for this items description
 void addMib(String mib)
          adds a mib to this item
 void addMibDir(String mibDir)
          adds a mibdir to this item
protected  void allocateAndAddMib(String newMib)
          sets this item's allocated mibs and forward it to it's childeren it takes in account allocatedMibs (eg /usr/lib/mibs) and expands it with its newMib when found in a dir (setMibDir)
 boolean canStart()
          can this item be started ?
 boolean canStop()
          can this item be stopped ?
 Object clone(GenericData parent)
          create an exact copy of this item, with all settings included
 GenericData getChild(String name)
          get a child from this item
 Hashtable getChildren()
          get this item's children
 Vector getDescription()
          get this item's description as lines of Strings
 String getHost()
          get this item's host name
 Vector getMibDirs()
          gets the mib dirs of this item
 String getMibDirsAsString()
          gets the mib dirs of this item as a string
 Vector getMibs()
          gets the mibs of this item
 String getName()
          get this item's name
 ProbeData getProbe()
          returns this items probe, if available
 boolean getPropagate()
          get this item's propagate status
 int getStatus()
          get this item's status
 String getType()
          get this item's type (handy when overloaded) returns "generic" for this class but other names for subclasses
 void initMonitoring(AdvancedSnmpManager snmpMan)
          initializes the monitoring process it is wise to call setMibDirs, setMib and setAllocatedMibs before calling init, as from here they propagate down to the children
 void list(PrintStream out, boolean stat, String root)
          list out the all info of this item and its children including stat if stat is true
 void myEventOccurred(MyEvent evt)
          Event Handling
 void print(PrintStream out, boolean all, String root)
          print out the all info of this item
 void removeAllChildren()
          remove all of this items children
 Object removeChild(String name)
          remove one of this items children
 void setAllocatedMibs(String alreadyAllocatedMibs)
          sets this item's allocated mibs and forward it to it's childeren it takes in account alreadyAllocatedMibs (eg /usr/lib/mibs) and expands it with its mibs (addMib, setMibs) when found in a dir (setMibDir)
 void setChildren(Hashtable children)
          set all of this items children
 void setDescription(Vector descr)
          sets all descriptive lines of Strings for this item
 void setHost(String host)
          sets this item's host name
 void setInfo(Vector info)
          sets all informational items for this item
 void setItemToken(String name)
          sets this item's token e.g /x/y/z
 void setMibDirs(Vector dirs)
          sets this item's mibdirs
 void setMibs(Vector mibs)
          sets the mibs of this item
 void setName(String name)
          sets the name of this item
 void setParent(GenericData parent)
          sets the parent of this item
 void setProbe(ProbeData newProbe)
          sets the probe for this item
 void setPropagate(boolean prop)
          sets this item's propagation property.
 void setPropagate(String prop)
          sets this item's propagation property.
 void setStatus(int status)
          sets this item's status
 int start()
          start item
 void startMonitoring()
          starts the monitoring process
 int stop()
          stop item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface iCMS.pollerd.MonitoredItem
addMyEventListener, removeMyEventListener
 

Field Detail

children

protected Hashtable children

name

protected String name

token

protected String token

host

protected String host

type

protected String type

propagate

protected boolean propagate

status

protected int status

probe

protected ProbeData probe

mibs

protected Vector mibs

allocatedMibs

protected String allocatedMibs

mibDirs

protected Vector mibDirs

info

protected Vector info

descr

protected Vector descr

canStop

protected boolean canStop

canStart

protected boolean canStart

parent

protected GenericData parent

snmpMan

protected AdvancedSnmpManager snmpMan
Constructor Detail

GenericData

public GenericData(GenericData parent)
default constructor

Method Detail

setMibs

public void setMibs(Vector mibs)
sets the mibs of this item


setParent

public void setParent(GenericData parent)
sets the parent of this item


setName

public void setName(String name)
sets the name of this item


setInfo

public void setInfo(Vector info)
sets all informational items for this item


setDescription

public void setDescription(Vector descr)
sets all descriptive lines of Strings for this item

Specified by:
setDescription in interface MonitoredItem

addMib

public void addMib(String mib)
adds a mib to this item


addMibDir

public void addMibDir(String mibDir)
adds a mibdir to this item


addDescription

public void addDescription(String descr)
adds a descriptive line for this items description

Specified by:
addDescription in interface MonitoredItem

setItemToken

public void setItemToken(String name)
sets this item's token e.g /x/y/z

Specified by:
setItemToken in interface MonitoredItem

setAllocatedMibs

public void setAllocatedMibs(String alreadyAllocatedMibs)
sets this item's allocated mibs and forward it to it's childeren it takes in account alreadyAllocatedMibs (eg /usr/lib/mibs) and expands it with its mibs (addMib, setMibs) when found in a dir (setMibDir)


allocateAndAddMib

protected void allocateAndAddMib(String newMib)
sets this item's allocated mibs and forward it to it's childeren it takes in account allocatedMibs (eg /usr/lib/mibs) and expands it with its newMib when found in a dir (setMibDir)


setMibDirs

public void setMibDirs(Vector dirs)
sets this item's mibdirs


setPropagate

public void setPropagate(boolean prop)
sets this item's propagation property. If set to false, it's parent will ignore it's status


setPropagate

public void setPropagate(String prop)
sets this item's propagation property. If set to false, it's parent will ignore it's status
Upper or lower case spelling of "TRUE" sets it to true, else false


setHost

public void setHost(String host)
sets this item's host name


setStatus

public void setStatus(int status)
sets this item's status


setProbe

public void setProbe(ProbeData newProbe)
sets the probe for this item


addChild

public void addChild(GenericData child)
add a child to this item


getMibDirsAsString

public String getMibDirsAsString()
gets the mib dirs of this item as a string


getMibDirs

public Vector getMibDirs()
gets the mib dirs of this item


getMibs

public Vector getMibs()
gets the mibs of this item


getChild

public GenericData getChild(String name)
get a child from this item


getPropagate

public boolean getPropagate()
get this item's propagate status


getChildren

public Hashtable getChildren()
get this item's children


stop

public int stop()
stop item


start

public int start()
start item


canStart

public boolean canStart()
can this item be started ?


canStop

public boolean canStop()
can this item be stopped ?


getHost

public String getHost()
get this item's host name


getStatus

public int getStatus()
get this item's status

Specified by:
getStatus in interface MonitoredItem

getType

public String getType()
get this item's type (handy when overloaded) returns "generic" for this class but other names for subclasses


getName

public String getName()
get this item's name

Specified by:
getName in interface MonitoredItem

getDescription

public Vector getDescription()
get this item's description as lines of Strings

Specified by:
getDescription in interface MonitoredItem

setChildren

public void setChildren(Hashtable children)
set all of this items children


removeAllChildren

public void removeAllChildren()
remove all of this items children


removeChild

public Object removeChild(String name)
remove one of this items children


startMonitoring

public void startMonitoring()
starts the monitoring process

Specified by:
startMonitoring in interface MonitoredItem

clone

public Object clone(GenericData parent)
create an exact copy of this item, with all settings included


initMonitoring

public void initMonitoring(AdvancedSnmpManager snmpMan)
initializes the monitoring process

it is wise to call setMibDirs, setMib and setAllocatedMibs before calling init, as from here they propagate down to the children

Specified by:
initMonitoring in interface MonitoredItem

getProbe

public ProbeData getProbe()
returns this items probe, if available

Specified by:
getProbe in interface MonitoredItem

print

public void print(PrintStream out,
                  boolean all,
                  String root)
print out the all info of this item


list

public void list(PrintStream out,
                 boolean stat,
                 String root)
list out the all info of this item and its children including stat if stat is true


myEventOccurred

public void myEventOccurred(MyEvent evt)
Event Handling