def read_all_state(self):
    LOG.debug('read_all_state')
    st = {}
    apn_qid_list = set()
    ul_qid_list = TrafficClass.read_all_classes(self._uplink)
    dl_qid_list = TrafficClass.read_all_classes(self._downlink)
    for (d, qid_list) in ((FlowMatch.UPLINK, ul_qid_list), (FlowMatch.DOWNLINK, dl_qid_list)):
        for qid_tuple in qid_list:
            (qid, pqid) = qid_tuple
            if ((qid < self._start_idx) or (qid > (self._max_idx - 1))):
                LOG.debug('qid %d out of range: (%d - %d)', qid, self._start_idx, self._max_idx)
                continue
            apn_qid = (pqid if (pqid != self._max_idx) else 0)
            st[qid] = {'direction': d, 'ambr_qid': apn_qid}
            if (apn_qid != 0):
                apn_qid_list.add(apn_qid)
    self._id_manager.restore_state(st)
    return (st, apn_qid_list)
def read_all_state(self):
    LOG.debug('read_all_state')
    st = {}
    apn_qid_list = set()
    ul_qid_list = TrafficClass.read_all_classes(self._uplink)
    dl_qid_list = TrafficClass.read_all_classes(self._downlink)
    for (d, qid_list) in ((FlowMatch.UPLINK, ul_qid_list), (FlowMatch.DOWNLINK, dl_qid_list)):
        for qid_tuple in qid_list:
            (qid, pqid) = qid_tuple
            if ((qid < self._start_idx) or (qid > (self._max_idx - 1))):
                LOG.debug('qid %d out of range: (%d - %d)', qid, self._start_idx, self._max_idx)
                continue
            apn_qid = (pqid if (pqid != self._max_idx) else 0)
            st[qid] = {'direction': d, 'ambr_qid': apn_qid}
            if (apn_qid != 0):
                apn_qid_list.add(apn_qid)
    self._id_manager.restore_state(st)
    return (st, apn_qid_list)