/**
     * Lists history records.
     *
     */
    public function indexAction()
    {   
        $queueOptions = $this->container->getParameter('jobqueue.adapter.options');
        $uiOptions = $this->container->getParameter('jobqueue.ui.options');

        $historyAdapterClass = $queueOptions['history_adapter_class'];
        $historyAdapter = new $historyAdapterClass($this->container->getParameter('jobqueue.adapter.options'), 
        $this->container->get('doctrine')->getEntityManager());
        $query = array();
        $pageParam = 'hpage';
        $query['page'] = $this->getRequest()->query->get($pageParam) ?: 1;
        $query['reverse'] = $this->getRequest()->query->get('reverse') ?: null;
        $query['job'] = $this->getRequest()->query->get('job') ?: null;
        $offset = ($uiOptions['pagination']['limit'] * $query['page']) - $uiOptions['pagination']['limit'];
        $history = new History($historyAdapter, $uiOptions['pagination']['limit'], $offset, $query['reverse'], $query['job']);
        $pagination = $this->getPagination($query, $uiOptions['pagination'], $history->getTotal(), $pageParam);
                
        return $this->render('NineThousandJobqueueBundle:History:index.html.twig', array(
            'history'           => $history,
            'pagination'        => $pagination,
        ));
    }