Package Halberd :: Module crew :: Class BaseScanner
[hide private]
[frames] | no frames]

Class BaseScanner

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        BaseScanner
Known Subclasses:

Base class for load balancer scanning threads.

Instance Methods [hide private]
 
__init__(self, state, scantask)
Initializes the scanning thread.
source code
int
remaining(self, end=None)
Seconds left until a given point in time.
source code
bool
hasExpired(self)
Expiration predicate.
source code
float
setTimeout(self, secs)
Compute an expiration time.
source code
 
run(self)
Perform the scan.
source code
 
process(self)
Perform a scanning task.
source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
float timeout
Time (in seconds since the UNIX Epoch) when the scan will be stopped.
Properties [hide private]

Inherited from threading.Thread: daemon, ident, name

Inherited from object: __class__

Method Details [hide private]

__init__(self, state, scantask)
(Constructor)

source code 

Initializes the scanning thread.

Parameters:
  • state (instanceof(ScanState)) - Container to store the results of the scan (shared among scanning threads).
  • scantask (instanceof(ScanTask)) - Object providing information needed to perform the scan.
Overrides: object.__init__

remaining(self, end=None)

source code 

Seconds left until a given point in time.

Parameters:
  • end (float) - Ending time.
Returns: int
Remaining time until self.timeout

hasExpired(self)

source code 

Expiration predicate.

Returns: bool
True if the timeout has expired, False otherwise.

setTimeout(self, secs)

source code 

Compute an expiration time.

Parameters:
  • secs (int) - Amount of seconds to spend scanning the target.
Returns: float
The moment in time when the task expires.

run(self)

source code 

Perform the scan.

Overrides: threading.Thread.run

process(self)

source code 

Perform a scanning task.

This method should be overriden to do actual work.