objects.logic.entity.filter.customFilter.customFilter Class Reference

The Custom filter inherits from the baseFilter object. More...

Inherits objects::logic::entity::filter::baseFilter::baseFilter.

List of all members.

Public Member Functions

def __init__
def shouldDisplayEntity
 returns True if the supplied networkEntity should be displayed or not.
def getSafeFilterList
 Returns a copy of the filtering Dictionary.
def addToFilter
 Add a new Tuple to the filter.
def removeFromFilter
 Removed a Filter Tuple from the Dictionary.

Public Attributes

 customfilterList
 filterDict
 lck


Detailed Description

The Custom filter inherits from the baseFilter object.

In addition to basic filtering capabilities, this class will contain a Dictionary of of very specific filtering criteria. For Example Filter if: IP == XYZ, ProcessName == xxx.exe, Country==USA, etc.

Definition at line 26 of file customFilter.py.


Member Function Documentation

def objects.logic.entity.filter.customFilter.customFilter.__init__ (   self  ) 

Reimplemented from objects.logic.entity.filter.baseFilter.baseFilter.

Definition at line 27 of file customFilter.py.

00027                       :
00028         baseFilter.__init__(self)
00029         
00030         self.customfilterList = []
00031         self.filterDict = filterDictionary()
00032         
00033         self.lck = RLock()
00034     
    ## returns True if the supplied networkEntity should be displayed or not.

def objects.logic.entity.filter.customFilter.customFilter.addToFilter (   self,
  filterTuple 
)

Add a new Tuple to the filter.

Parameters:
filterTuple Tuple (networkedEntity attributeName-->Value)

Definition at line 76 of file customFilter.py.

00076                                       :        
00077         self.lck.acquire(1)
00078         try:            
00079             self.customfilterList.append(filterTuple)
00080         finally:
00081             self.lck.release()
00082     
00083     
00084     

def objects.logic.entity.filter.customFilter.customFilter.getSafeFilterList (   self  ) 

Returns a copy of the filtering Dictionary.

Returns:
Dictionary

Definition at line 60 of file customFilter.py.

00060                                :
00061         copyList = []
00062         
00063         self.lck.acquire(1)
00064         try:            
00065             copyList = copy.deepcopy(self.customfilterList)
00066         finally:
00067             self.lck.release()
00068             
00069         return copyList
00070     
00071     
00072     
00073     
    ## Add a new Tuple to the filter

def objects.logic.entity.filter.customFilter.customFilter.removeFromFilter (   self,
  filterTuple 
)

Removed a Filter Tuple from the Dictionary.

Parameters:
filterTuple Tuple (networkedEntity attributeName-->Value)

Definition at line 87 of file customFilter.py.

00087                                            :
00088         self.lck.acquire(1)
00089         try:            
00090             self.customfilterList.remove(filterTuple)
00091         finally:
00092             self.lck.release()
            self.lck.release()

def objects.logic.entity.filter.customFilter.customFilter.shouldDisplayEntity (   self,
  networkEntity 
)

returns True if the supplied networkEntity should be displayed or not.

After calling its base class method, it will check against its Filter Dictionary for additional criteria.

Parameters:
networkEntity networkEntity Object

Reimplemented from objects.logic.entity.filter.baseFilter.baseFilter.

Definition at line 39 of file customFilter.py.

00039                                                 :
00040         if baseFilter.shouldDisplayEntity(self, networkEntity) == False:
00041             return False
00042         else:
00043             # now deal with local filters
00044             self.lck.acquire(1)
00045             try:
00046                 if len(self.customfilterList) == 0: return True
00047                 
00048                 for filterCat, filterVal in self.customfilterList:
00049                     attr, type = self.filterDict.filter[filterCat]
00050                     if networkEntity[attr] == filterVal:
00051                         return False
00052             finally:
00053                 self.lck.release()
00054                 
00055             return True 
00056     
00057     
    ## Returns a copy of the filtering Dictionary


Member Data Documentation

Definition at line 30 of file customFilter.py.

Definition at line 31 of file customFilter.py.

Definition at line 33 of file customFilter.py.


The documentation for this class was generated from the following file:

Generated on Mon Mar 30 00:26:42 2009 for EyeSpy by  doxygen 1.5.8