use of org.graylog2.plugin.PluginMetaData in project graylog2-server by Graylog2.
the class CmdLineTool method loadPlugins.
protected Set<Plugin> loadPlugins(Path pluginPath, ChainingClassLoader chainingClassLoader) {
final Set<Plugin> plugins = new HashSet<>();
final PluginLoader pluginLoader = new PluginLoader(pluginPath.toFile(), chainingClassLoader, coreConfigInjector);
for (Plugin plugin : pluginLoader.loadPlugins()) {
final PluginMetaData metadata = plugin.metadata();
if (capabilities().containsAll(metadata.getRequiredCapabilities())) {
if (version.sameOrHigher(metadata.getRequiredVersion())) {
LOG.info("Loaded plugin: {}", plugin);
plugins.add(plugin);
} else {
LOG.error("Plugin \"" + metadata.getName() + "\" requires version " + metadata.getRequiredVersion() + " - not loading!");
}
} else {
LOG.debug("Skipping plugin \"{}\" because some capabilities are missing ({}).", metadata.getName(), Sets.difference(plugin.metadata().getRequiredCapabilities(), capabilities()));
}
}
return plugins;
}
use of org.graylog2.plugin.PluginMetaData in project graylog2-server by Graylog2.
the class EventDefinitionFacadeTest method setUp.
@Before
@SuppressForbidden("Using Executors.newSingleThreadExecutor() is okay in tests")
public void setUp() throws Exception {
objectMapper.registerSubtypes(AggregationEventProcessorConfig.class, PersistToStreamsStorageHandler.Config.class, TemplateFieldValueProvider.Config.class, AggregationEventProcessorConfigEntity.class);
stateService = mock(DBEventProcessorStateService.class);
jobDefinitionService = mock(DBJobDefinitionService.class);
jobTriggerService = mock(DBJobTriggerService.class);
jobSchedulerClock = mock(JobSchedulerClock.class);
eventDefinitionService = new DBEventDefinitionService(mongodb.mongoConnection(), mapperProvider, stateService, entityOwnershipService);
eventDefinitionHandler = new EventDefinitionHandler(eventDefinitionService, jobDefinitionService, jobTriggerService, jobSchedulerClock);
Set<PluginMetaData> pluginMetaData = new HashSet<>();
facade = new EventDefinitionFacade(objectMapper, eventDefinitionHandler, pluginMetaData, jobDefinitionService, eventDefinitionService, userService);
}
Aggregations