def __init__(self, ct_logs, db, cert_db, temp_db_factory, monitor_state_dir, agent=None, state_keeper_class=None):
    'Initialize from a CtLogs proto.'
    threading.Thread.__init__(self)
    self.__monitors = []
    self.__db = db
    if (not agent):
        agent = twisted_client.Agent(reactor)
    if (not state_keeper_class):
        state_keeper_class = state.StateKeeper
    for log in ct_logs.ctlog:
        if ((not log.log_server) or (not log.log_id) or (not log.public_key_info)):
            raise RuntimeError(('Cannot start monitor: log proto has missing or empty fields: %s' % log))
        temp_db = temp_db_factory.create_storage(log.log_server)
        client = log_client.AsyncLogClient(agent, log.log_server, temp_db)
        hasher = merkle.TreeHasher()
        verifier = verify.LogVerifier(log.public_key_info, merkle.MerkleVerifier(hasher))
        log_id_urlsafe = log.log_id.replace('/', '_').replace('+', '-')
        state_keeper = state_keeper_class(((monitor_state_dir + '/') + log_id_urlsafe))
        log_key = db.get_log_id(log.log_server)
        self.__monitors.append(monitor.Monitor(client, verifier, hasher, db, cert_db, log_key, state_keeper))
    self.__last_update_start_time = 0
    self.__stopped = False
    self.__called_later = None
Initialize from a CtLogs proto.
def __init__(self, ct_logs, db, cert_db, temp_db_factory, monitor_state_dir, agent=None, state_keeper_class=None):
    
    threading.Thread.__init__(self)
    self.__monitors = []
    self.__db = db
    if (not agent):
        agent = twisted_client.Agent(reactor)
    if (not state_keeper_class):
        state_keeper_class = state.StateKeeper
    for log in ct_logs.ctlog:
        if ((not log.log_server) or (not log.log_id) or (not log.public_key_info)):
            raise RuntimeError(('Cannot start monitor: log proto has missing or empty fields: %s' % log))
        temp_db = temp_db_factory.create_storage(log.log_server)
        client = log_client.AsyncLogClient(agent, log.log_server, temp_db)
        hasher = merkle.TreeHasher()
        verifier = verify.LogVerifier(log.public_key_info, merkle.MerkleVerifier(hasher))
        log_id_urlsafe = log.log_id.replace('/', '_').replace('+', '-')
        state_keeper = state_keeper_class(((monitor_state_dir + '/') + log_id_urlsafe))
        log_key = db.get_log_id(log.log_server)
        self.__monitors.append(monitor.Monitor(client, verifier, hasher, db, cert_db, log_key, state_keeper))
    self.__last_update_start_time = 0
    self.__stopped = False
    self.__called_later = None