Table of Contents

Class: Stream sam/Stream.py

Holds all the data about a Stream.

Purpose: Holds all the data produced by parsing a STREAMSLOG file about a particular stream.

Used By: StreamsLogInput

Uses: CustomError

Attributes: None

SRS Refs: 3.2.1.5, 5.2.3

Author: mayadm

Date: 24/7/02

Methods   
__init__
__maybeResolve
canDisableItems
getId
getName
isAggregate
isSelected
setResolve
setSelected
  __init__ 
__init__ (
        self,
        streamid=None,
        destad=None,
        destport=None,
        sourcead=None,
        sourceport=None,
        is_agg=0,
        )

Purpose: Creates a new instance of the Stream class, given the id number, destination address, destination port, source address and source port (all default to be None), and whether the stream is an aggregate (default to no (0) if not given).

Used by: StreamsLogInput

Uses: CustomError

Input: streamid : integer or None, destad : string or None, destport : integer or None, sourcead : string or None, sourceport : integer or None, is_agg : 0 or 1

Output: New instance of the class Stream

Preconditions: None

Postconditions: The created class will be a valid Stream object.

SRS Refs: 3.2.1.5

Author: mayadm

Date: 24/7/02

Exceptions   
CustomError, "Error - destport must be Integer or None"
CustomError, "Error - is_agg input must be integer"
CustomError, "Error - sourceport must be Integer or None"
  __maybeResolve 
__maybeResolve ( self,  address )

Purpose: Attempts to resolve an ip address if the flag self.resolve is set to true. Returns the ip address as it was otherwise, or on failure.

Used by: Stream

Uses: None

Input: address : String

Output: name : String

Preconditions: None

Postconditions: None

SRS Refs: 5.2.3

Author: lljy

Date: 28/10/02

  canDisableItems 
canDisableItems ( self )

Purpose: Needed by Selector class to tell it if this Stream can cause other items to be disabled. Returns 1 if the Stream object is an aggregate, 0 if not. This is an interface needed by Selector.

Used by: Selector

Uses: None

Input: None

Output: canDisableItems : 0 or 1

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.5

Author: mayadm

Date: 24/7/02

  getId 
getId ( self )

Purpose: Returns the Stream's id number.

Used by: Selector

Uses: None

Input: None

Output: getId : integer

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.5

Author: mayadm

Date: 24/7/02

  getName 
getName ( self )

Purpose: Returns the name of the Stream to be displayed to the user in an understandable form.

Used by: Selector

Uses: None

Input: None

Output: getName : string

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.5

Author: mayadm

Date: 24/7/02

  isAggregate 
isAggregate ( self )

Purpose: Returns 1 if the Stream object is an aggregate, 0 otherwise.

Used by: Model

Uses: None

Input: None

Output: isAggregate : 0 or 1

Preconditions: None

Postconditions: None

SRS Refs: 3.2.1.5

Author: mayadm

Date: 24/7/02

  isSelected 
isSelected ( self )

Purpose: Returns whether the stream is selected (1) or not selected (0) on screen. This is an interface needed by Selector.

Used by: Selector

Uses: None

Input: None

Output: isSelected : integer (0 or 1)

Preconditions: None

Postconditions: None

SRS Refs: 5.2.3

Author: mayadm

Date: 28/10/02

  setResolve 
setResolve ( self,  sel )

Purpose: Sets whether the stream is set to resolve its name to a domain name (sel = 1) or to leave its name as an IP address (sel = 0).

Used by: MainWindow

Uses: None

Input: sel : integer (0 or 1)

Output: None

Preconditions: None

Postconditions: None

SRS Refs: 5.2.3

Author: mayadm

Date: 28/10/02

  setSelected 
setSelected ( self,  sel )

Purpose: Sets whether the stream is selected (1) or not selected (0) on screen. This is an interface needed by Selector.

Used by: Selector

Uses: None

Input: sel : integer (0 or 1)

Output: None

Preconditions: None

Postconditions: None

SRS Refs: 5.2.3

Author: mayadm

Date: 28/10/02


Table of Contents

This document was automatically generated on Wed Oct 30 23:04:21 2002 by HappyDoc version 2.0