def get_all_deployed_listeners(self, expand_subcollections=False):
        LOG.debug('getting all deployed listeners on BIG-IPs')
        deployed_virtual_dict = {}
        for bigip in self.get_all_bigips():
            folders = self.system_helper.get_folders(bigip)
            for folder in folders:
                tenant_id = folder[len(self.service_adapter.prefix):]
                if str(folder).startswith(self.service_adapter.prefix):
                    resource = resource_helper.BigIPResourceHelper(
                        resource_helper.ResourceType.virtual)
                    deployed_listeners = resource.get_resources(
                        bigip, folder, expand_subcollections)
                    if deployed_listeners:
                        for virtual in deployed_listeners:
                            virtual_id = \
                                virtual.name[len(self.service_adapter.prefix):]
                            l7_policy = ''
                            if hasattr(virtual, 'policiesReference') and \
                                    'items' in virtual.policiesReference:
                                l7_policy = \
                                    virtual.policiesReference['items'][0]
                                l7_policy = l7_policy['fullPath']
                            if virtual_id in deployed_virtual_dict:
                                deployed_virtual_dict[virtual_id][
                                    'hostnames'].append(bigip.hostname)
                            else:
                                deployed_virtual_dict[virtual_id] = {
                                    'id': virtual_id,
                                    'tenant_id': tenant_id,
                                    'hostnames': [bigip.hostname],
                                    'l7_policy': l7_policy
                                }
        return deployed_virtual_dict