blocker.js
function Blocker(config, logger) {

        //DB must define an add, remove and contains function!
        if(!(config.db && config.db.add && config.db.remove && config.db.contains)){
            throw "db must define an add, remove and contains function";
        };

        _config = config;
        _logger = logger;
    }
function Blocker(config, logger) {

        //DB must define an add, remove and contains function!
        if(!(config.db && config.db.add && config.db.remove && config.db.contains)){
            throw "db must define an add, remove and contains function";
        };

        _config = config;
        _logger = logger;
    }
function Blocker ( config , logger ) { //DB must define an add, remove and contains function! if ( ! ( config . db && config . db . add && config . db . remove && config . db . contains ) ) { throw "db must define an add, remove and contains function" ; } ; _config = config ; _logger = logger ; }
The Blocker class realizes an IP blocklist that allows other modules to block attackers.
@param config must contain at least an object named db that must have an add, remove and contains function.
Furthermore it allow the user to specifiy a blockTime. If blockTime is not set, entries will never be removed
from Blocklist.
@constructor
The Blocker class realizes an IP blocklist that allows other modules to block attackers .