We need a Livestatus factory

This commit is contained in:
Thomas Gelf 2013-10-22 20:21:03 +00:00
parent e57b75b354
commit 5d3fbd1cdf
1 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@ use Zend_Config;
use Icinga\Util\ConfigAwareFactory;
use Icinga\Exception\ConfigurationError;
use Icinga\Data\Db\Connection as DbConnection;
use Icinga\Protocol\Livestatus\Connection as LivestatusConnection;
use Icinga\Protocol\Statusdat\Reader as StatusdatReader;
class ResourceFactory implements ConfigAwareFactory
@ -39,6 +40,9 @@ class ResourceFactory implements ConfigAwareFactory
case 'statusdat':
$resource = new StatusdatReader($config);
break;
case 'livestatus':
$resource = new LivestatusConnection($config->socket);
break;
default:
throw new ConfigurationError('Unsupported resource type "' . $config->type . '"');