From c20874ec9dae79ca71794f114df4170d3ecd8292 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Wed, 24 Feb 2016 11:30:58 +0100 Subject: [PATCH] Merge graylog2-plugin-interfaces into graylog2-server This also includes a relicensing of the respective source files from MIT license to GPL-3. --- graylog2-plugin-interfaces/.gitignore | 5 - graylog2-plugin-interfaces/LICENSE | 7 - graylog2-plugin-interfaces/pom.xml | 135 ------------------ .../graylog2/plugin/AbstractDescriptor.java | 55 ------- .../org/graylog2/plugin/Capabilities.java | 38 ----- .../java/org/graylog2/plugin/DocsHelper.java | 49 ------- .../org/graylog2/plugin/EmptyMessages.java | 35 ----- .../plugin/InstantMillisProvider.java | 53 ------- .../graylog2/plugin/LocalMetricRegistry.java | 29 ---- .../graylog2/plugin/MessageCollection.java | 42 ------ .../java/org/graylog2/plugin/Messages.java | 26 ---- .../java/org/graylog2/plugin/MetricSets.java | 40 ------ .../main/java/org/graylog2/plugin/Plugin.java | 30 ---- .../org/graylog2/plugin/PluginConfigBean.java | 29 ---- .../graylog2/plugin/PluginLoaderConfig.java | 37 ----- .../org/graylog2/plugin/PluginMetaData.java | 44 ------ .../ProcessingPauseLockedException.java | 38 ----- .../java/org/graylog2/plugin/RulesEngine.java | 49 ------- .../graylog2/plugin/SingletonMessages.java | 42 ------ .../java/org/graylog2/plugin/Stoppable.java | 30 ---- .../plugin/alarms/AlertCondition.java | 64 --------- .../alarms/callbacks/AlarmCallback.java | 46 ------ .../AlarmCallbackConfigurationException.java | 44 ------ .../callbacks/AlarmCallbackException.java | 47 ------ .../TransportConfigurationException.java | 44 ------ .../buffers/BufferOutOfCapacityException.java | 44 ------ .../plugin/buffers/BufferWatermark.java | 49 ------- .../graylog2/plugin/buffers/InputBuffer.java | 31 ---- .../buffers/ProcessingDisabledException.java | 34 ----- .../graylog2/plugin/cluster/ClusterId.java | 40 ------ .../configuration/ConfigurationException.java | 48 ------- .../configuration/fields/BooleanField.java | 50 ------- .../fields/ConfigurationField.java | 49 ------- .../dashboards/widgets/WidgetStrategy.java | 37 ----- .../plugin/database/EmbeddedPersistable.java | 34 ----- .../graylog2/plugin/database/Persisted.java | 40 ------ .../plugin/database/ValidationException.java | 51 ------- .../database/validators/ValidationResult.java | 54 ------- .../plugin/database/validators/Validator.java | 31 ---- .../events/inputs/IOStateChangedEvent.java | 38 ----- .../plugin/filters/MessageFilter.java | 53 ------- .../indexer/retention/RetentionStrategy.java | 31 ---- .../retention/RetentionStrategyConfig.java | 34 ----- .../indexer/rotation/RotationStrategy.java | 31 ---- .../rotation/RotationStrategyConfig.java | 34 ----- .../InvalidRangeParametersException.java | 39 ----- .../searches/timeranges/TimeRange.java | 53 ------- .../plugin/initializers/Initializer.java | 38 ----- .../InitializerConfigurationException.java | 44 ------ .../org/graylog2/plugin/inputs/Converter.java | 67 --------- .../plugin/inputs/MisfireException.java | 39 ----- .../plugin/inputs/annotations/Codec.java | 44 ------ .../inputs/annotations/ConfigClass.java | 33 ----- .../inputs/annotations/FactoryClass.java | 33 ----- .../graylog2/plugin/inputs/codecs/Codec.java | 56 -------- .../plugin/inputs/codecs/CodecAggregator.java | 53 ------- .../inputs/codecs/MultiMessageCodec.java | 36 ----- .../plugin/inputs/transports/Transport.java | 50 ------- .../plugin/lifecycles/LoadBalancerStatus.java | 33 ----- .../messageprocessors/MessageProcessor.java | 29 ---- .../MessageOutputConfigurationException.java | 44 ------ .../outputs/OutputStreamConfiguration.java | 36 ----- .../org/graylog2/plugin/rest/ApiError.java | 37 ----- .../plugin/rest/PluginRestResource.java | 31 ---- .../plugin/rest/ValidationApiError.java | 43 ------ .../plugin/security/PasswordAlgorithm.java | 31 ---- .../graylog2/plugin/streams/AlertAction.java | 30 ---- .../org/graylog2/plugin/streams/Output.java | 46 ------ .../graylog2/plugin/streams/StreamRule.java | 57 -------- .../system/NodeIdPersistenceException.java | 44 ------ .../java/org/graylog2/plugin/ToolsTest.java | 48 ------- .../plugin/streams/MatchingTypeTest.java | 43 ------ .../src/test/resources/log4j2-test.xml | 13 -- graylog2-server/pom.xml | 21 ++- .../graylog2/plugin/AbstractDescriptor.java | 49 +++++++ .../graylog2/plugin/BaseConfiguration.java | 28 ++-- .../org/graylog2/plugin/Capabilities.java | 32 +++++ .../java/org/graylog2/plugin/DocsHelper.java | 42 ++++++ .../org/graylog2/plugin/EmptyMessages.java | 29 ++++ .../graylog2/plugin/GlobalMetricNames.java | 28 ++-- .../java/org/graylog2/plugin/IOState.java | 28 ++-- .../plugin/InstantMillisProvider.java | 47 ++++++ .../plugin/KafkaJournalConfiguration.java | 28 ++-- .../graylog2/plugin/LocalMetricRegistry.java | 23 +++ .../java/org/graylog2/plugin/Message.java | 28 ++-- .../graylog2/plugin/MessageCollection.java | 36 +++++ .../org/graylog2/plugin/MessageSummary.java | 28 ++-- .../java/org/graylog2/plugin/Messages.java | 20 +++ .../java/org/graylog2/plugin/MetricSets.java | 34 +++++ .../main/java/org/graylog2/plugin/Plugin.java | 24 ++++ .../org/graylog2/plugin/PluginConfigBean.java | 23 +++ .../graylog2/plugin/PluginLoaderConfig.java | 31 ++++ .../org/graylog2/plugin/PluginMetaData.java | 38 +++++ .../org/graylog2/plugin/PluginModule.java | 28 ++-- .../ProcessingPauseLockedException.java | 32 +++++ .../plugin/ResolvableInetSocketAddress.java | 28 ++-- .../java/org/graylog2/plugin/RulesEngine.java | 43 ++++++ .../org/graylog2/plugin/ServerStatus.java | 28 ++-- .../graylog2/plugin/SingletonMessages.java | 36 +++++ .../java/org/graylog2/plugin/Stoppable.java | 24 ++++ .../org/graylog2/plugin/ThrottleState.java | 28 ++-- .../main/java/org/graylog2/plugin/Tools.java | 28 ++-- .../java/org/graylog2/plugin/Version.java | 28 ++-- .../plugin/alarms/AlertCondition.java | 58 ++++++++ .../alarms/callbacks/AlarmCallback.java | 40 ++++++ .../AlarmCallbackConfigurationException.java | 38 +++++ .../callbacks/AlarmCallbackException.java | 41 ++++++ .../TransportConfigurationException.java | 38 +++++ .../org/graylog2/plugin/buffers/Buffer.java | 28 ++-- .../buffers/BufferOutOfCapacityException.java | 38 +++++ .../plugin/buffers/BufferWatermark.java | 43 ++++++ .../graylog2/plugin/buffers/InputBuffer.java | 25 ++++ .../graylog2/plugin/buffers/MessageEvent.java | 28 ++-- .../buffers/ProcessingDisabledException.java | 28 ++++ .../plugin/cluster/ClusterConfigService.java | 28 ++-- .../graylog2/plugin/cluster/ClusterId.java | 34 +++++ .../plugin/configuration/Configuration.java | 28 ++-- .../configuration/ConfigurationException.java | 42 ++++++ .../configuration/ConfigurationRequest.java | 28 ++-- .../fields/AbstractConfigurationField.java | 28 ++-- .../configuration/fields/BooleanField.java | 44 ++++++ .../fields/ConfigurationField.java | 43 ++++++ .../configuration/fields/DropdownField.java | 28 ++-- .../configuration/fields/NumberField.java | 28 ++-- .../configuration/fields/TextField.java | 28 ++-- .../dashboards/widgets/ComputationResult.java | 28 ++-- .../dashboards/widgets/WidgetStrategy.java | 31 ++++ .../plugin/database/EmbeddedPersistable.java | 28 ++++ .../graylog2/plugin/database/Persisted.java | 34 +++++ .../plugin/database/PersistedService.java | 22 --- .../plugin/database/ValidationException.java | 45 ++++++ .../graylog2/plugin/database/users/User.java | 22 --- .../database/validators/ValidationResult.java | 48 +++++++ .../plugin/database/validators/Validator.java | 25 ++++ .../events/inputs/IOStateChangedEvent.java | 32 +++++ .../plugin/filters/MessageFilter.java | 47 ++++++ .../indexer/retention/RetentionStrategy.java | 25 ++++ .../retention/RetentionStrategyConfig.java | 28 ++++ .../indexer/rotation/RotationStrategy.java | 25 ++++ .../rotation/RotationStrategyConfig.java | 28 ++++ .../searches/timeranges/AbsoluteRange.java | 28 ++-- .../InvalidRangeParametersException.java | 33 +++++ .../searches/timeranges/KeywordRange.java | 28 ++-- .../searches/timeranges/RelativeRange.java | 28 ++-- .../searches/timeranges/TimeRange.java | 47 ++++++ .../plugin/initializers/Initializer.java | 32 +++++ .../InitializerConfigurationException.java | 38 +++++ .../plugin/inject/Graylog2Module.java | 28 ++-- .../org/graylog2/plugin/inputs/Converter.java | 61 ++++++++ .../org/graylog2/plugin/inputs/Extractor.java | 28 ++-- .../graylog2/plugin/inputs/MessageInput.java | 28 ++-- .../plugin/inputs/MisfireException.java | 33 +++++ .../plugin/inputs/annotations/Codec.java | 38 +++++ .../inputs/annotations/ConfigClass.java | 27 ++++ .../inputs/annotations/FactoryClass.java | 27 ++++ .../plugin/inputs/codecs/AbstractCodec.java | 28 ++-- .../graylog2/plugin/inputs/codecs/Codec.java | 50 +++++++ .../plugin/inputs/codecs/CodecAggregator.java | 47 ++++++ .../inputs/codecs/MultiMessageCodec.java | 29 ++++ .../transports/AbstractTcpTransport.java | 28 ++-- .../inputs/transports/GeneratorTransport.java | 28 ++-- .../inputs/transports/NettyTransport.java | 28 ++-- .../transports/ThrottleableTransport.java | 28 ++-- .../plugin/inputs/transports/Transport.java | 44 ++++++ .../inputs/transports/util/KeyUtil.java | 28 ++-- .../plugin/inputs/util/ConnectionCounter.java | 28 ++-- .../inputs/util/PacketInformationDumper.java | 22 --- .../plugin/inputs/util/ThroughputCounter.java | 28 ++-- .../plugin/journal/JournalMessages.java | 28 ++-- .../graylog2/plugin/journal/RawMessage.java | 28 ++-- .../graylog2/plugin/lifecycles/Lifecycle.java | 28 ++-- .../plugin/lifecycles/LoadBalancerStatus.java | 27 ++++ .../messageprocessors/MessageProcessor.java | 23 +++ .../plugin/outputs/MessageOutput.java | 28 ++-- .../MessageOutputConfigurationException.java | 38 +++++ .../outputs/OutputStreamConfiguration.java | 30 ++++ .../plugin/periodical/Periodical.java | 28 ++-- .../org/graylog2/plugin/rest/ApiError.java | 31 ++++ .../plugin/rest/PluginRestResource.java | 25 ++++ .../plugin/rest/ValidationApiError.java | 37 +++++ .../plugin/security/PasswordAlgorithm.java | 25 ++++ .../graylog2/plugin/streams/AlertAction.java | 24 ++++ .../org/graylog2/plugin/streams/Output.java | 40 ++++++ .../org/graylog2/plugin/streams/Stream.java | 28 ++-- .../graylog2/plugin/streams/StreamRule.java | 51 +++++++ .../plugin/streams/StreamRuleType.java | 28 ++-- .../org/graylog2/plugin/system/NodeId.java | 28 ++-- .../system/NodeIdPersistenceException.java | 38 +++++ .../utilities/date/NaturalDateParser.java | 28 ++-- .../graylog2/plugin/journal/raw_message.proto | 0 .../plugin/BaseConfigurationTest.java | 28 ++-- .../graylog2/plugin/MessageSummaryTest.java | 29 ++-- .../java/org/graylog2/plugin/MessageTest.java | 28 ++-- .../ResolvableInetSocketAddressTest.java | 28 ++-- .../org/graylog2/plugin/ServerStatusTest.java | 28 ++-- .../java/org/graylog2/plugin/ToolsTest.java | 42 ++++++ .../java/org/graylog2/plugin/VersionTest.java | 28 ++-- .../ConfigurationRequestTest.java | 28 ++-- .../configuration/ConfigurationTest.java | 28 ++-- .../fields/BooleanFieldTest.java | 28 ++-- .../fields/DropdownFieldTest.java | 28 ++-- .../configuration/fields/NumberFieldTest.java | 28 ++-- .../configuration/fields/TextFieldTest.java | 28 ++-- .../graylog2/plugin/inputs/ExtractorTest.java | 29 ++-- .../graylog2/plugin/inputs/IOStateTest.java | 28 ++-- .../inputs/transports/util/KeyUtilTest.java | 28 ++-- .../plugin/journal/RawMessageTest.java | 28 ++-- .../plugin/streams/MatchingTypeTest.java | 37 +++++ .../inputs/transports/util/dir/server.crt | 0 .../plugin/inputs/transports/util/server.crt | 0 .../transports/util/server.key.der.e.pkcs8 | Bin .../transports/util/server.key.der.ue.pkcs8 | Bin .../transports/util/server.key.pem.e.pkcs8 | 0 .../transports/util/server.key.pem.ue.pkcs1 | 0 .../transports/util/server.key.pem.ue.pkcs8 | 0 pom.xml | 6 - 216 files changed, 3133 insertions(+), 4136 deletions(-) delete mode 100644 graylog2-plugin-interfaces/.gitignore delete mode 100644 graylog2-plugin-interfaces/LICENSE delete mode 100644 graylog2-plugin-interfaces/pom.xml delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/AbstractDescriptor.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Capabilities.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/DocsHelper.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/EmptyMessages.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/InstantMillisProvider.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MessageCollection.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Messages.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MetricSets.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Plugin.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginConfigBean.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginMetaData.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/RulesEngine.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/SingletonMessages.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Stoppable.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/cluster/ClusterId.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/Persisted.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/ValidationException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/Validator.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/filters/MessageFilter.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/Initializer.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/Converter.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/MisfireException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ApiError.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/AlertAction.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/Output.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/StreamRule.java delete mode 100644 graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java delete mode 100644 graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ToolsTest.java delete mode 100644 graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java delete mode 100644 graylog2-plugin-interfaces/src/test/resources/log4j2-test.xml create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/AbstractDescriptor.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/BaseConfiguration.java (90%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/Capabilities.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/DocsHelper.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/EmptyMessages.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/GlobalMetricNames.java (61%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/IOState.java (71%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/InstantMillisProvider.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/KafkaJournalConfiguration.java (76%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/Message.java (93%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/MessageCollection.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/MessageSummary.java (69%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/Messages.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/MetricSets.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/Plugin.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/PluginConfigBean.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/PluginMetaData.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/PluginModule.java (85%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/ResolvableInetSocketAddress.java (65%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/RulesEngine.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/ServerStatus.java (84%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/SingletonMessages.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/Stoppable.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/ThrottleState.java (53%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/Tools.java (93%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/Version.java (83%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/buffers/Buffer.java (69%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/buffers/MessageEvent.java (64%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/cluster/ClusterConfigService.java (61%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/cluster/ClusterId.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/configuration/Configuration.java (81%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/configuration/ConfigurationRequest.java (84%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/configuration/fields/AbstractConfigurationField.java (54%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/configuration/fields/DropdownField.java (62%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/configuration/fields/NumberField.java (60%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/configuration/fields/TextField.java (60%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/dashboards/widgets/ComputationResult.java (59%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/database/Persisted.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/database/PersistedService.java (57%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/database/ValidationException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/database/users/User.java (66%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/database/validators/Validator.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/filters/MessageFilter.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/AbsoluteRange.java (73%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/KeywordRange.java (70%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/RelativeRange.java (68%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/initializers/Initializer.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java (92%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/Converter.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/Extractor.java (93%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/MessageInput.java (92%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/MisfireException.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/codecs/AbstractCodec.java (69%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/transports/AbstractTcpTransport.java (91%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/transports/GeneratorTransport.java (69%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/transports/NettyTransport.java (92%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/transports/ThrottleableTransport.java (88%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/transports/util/KeyUtil.java (86%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/util/ConnectionCounter.java (59%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/util/PacketInformationDumper.java (67%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/inputs/util/ThroughputCounter.java (58%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/journal/JournalMessages.java (99%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/journal/RawMessage.java (89%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/lifecycles/Lifecycle.java (51%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/outputs/MessageOutput.java (55%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/periodical/Periodical.java (60%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/rest/ApiError.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/streams/AlertAction.java create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/streams/Output.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/streams/Stream.java (52%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/streams/StreamRule.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/streams/StreamRuleType.java (59%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/system/NodeId.java (69%) create mode 100644 graylog2-server/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java rename {graylog2-plugin-interfaces => graylog2-server}/src/main/java/org/graylog2/plugin/utilities/date/NaturalDateParser.java (67%) rename {graylog2-plugin-interfaces => graylog2-server}/src/main/resources/org/graylog2/plugin/journal/raw_message.proto (100%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/BaseConfigurationTest.java (81%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/MessageSummaryTest.java (73%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/MessageTest.java (92%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/ResolvableInetSocketAddressTest.java (80%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/ServerStatusTest.java (86%) create mode 100644 graylog2-server/src/test/java/org/graylog2/plugin/ToolsTest.java rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/VersionTest.java (87%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/configuration/ConfigurationRequestTest.java (64%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/configuration/ConfigurationTest.java (54%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/configuration/fields/BooleanFieldTest.java (61%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/configuration/fields/DropdownFieldTest.java (69%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/configuration/fields/NumberFieldTest.java (70%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/configuration/fields/TextFieldTest.java (66%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/inputs/ExtractorTest.java (97%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/inputs/IOStateTest.java (63%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/inputs/transports/util/KeyUtilTest.java (78%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/java/org/graylog2/plugin/journal/RawMessageTest.java (51%) create mode 100644 graylog2-server/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java rename {graylog2-plugin-interfaces => graylog2-server}/src/test/resources/org/graylog2/plugin/inputs/transports/util/dir/server.crt (100%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.crt (100%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.e.pkcs8 (100%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.ue.pkcs8 (100%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.e.pkcs8 (100%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs1 (100%) rename {graylog2-plugin-interfaces => graylog2-server}/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs8 (100%) diff --git a/graylog2-plugin-interfaces/.gitignore b/graylog2-plugin-interfaces/.gitignore deleted file mode 100644 index 274f0fd706a8..000000000000 --- a/graylog2-plugin-interfaces/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -target -release.properties -.classpath -.project -.settings diff --git a/graylog2-plugin-interfaces/LICENSE b/graylog2-plugin-interfaces/LICENSE deleted file mode 100644 index f95d06c67622..000000000000 --- a/graylog2-plugin-interfaces/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2012-2015 TORCH GmbH, 2015-2016 Graylog, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/graylog2-plugin-interfaces/pom.xml b/graylog2-plugin-interfaces/pom.xml deleted file mode 100644 index b08c180911f8..000000000000 --- a/graylog2-plugin-interfaces/pom.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - 4.0.0 - - 3.1.0 - - - graylog2-plugin - jar - - - org.graylog2 - graylog2-parent - 2.0.0-alpha.4-SNAPSHOT - - - graylog2-plugin - Graylog interfaces for plugin development - - - - MIT license - http://www.opensource.org/licenses/mit-license.php - repo - - - - - - com.google.guava - guava - - - com.google.inject.extensions - guice-assistedinject - - - joda-time - joda-time - - - com.github.zafarkhaja - java-semver - - - io.dropwizard.metrics - metrics-core - - - com.lmax - disruptor - - - com.google.inject - guice - - - com.google.inject.extensions - guice-multibindings - - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.core - jackson-databind - - - - javax.ws.rs - javax.ws.rs-api - - - - com.google.protobuf - protobuf-java - - - - io.netty - netty - - - - org.glassfish.jersey.core - jersey-common - - - - org.kie - kie-api - - - - commons-io - commons-io - - - - com.eaio.uuid - uuid - - - - com.github.joschi - jadconfig - - - - javax.validation - validation-api - - - com.joestelmach - natty - - - com.google.auto.value - auto-value - - - - - - - com.mycila - license-maven-plugin - -
com/mycila/maven/plugin/license/templates/MIT.txt
-
-
-
-
-
diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/AbstractDescriptor.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/AbstractDescriptor.java deleted file mode 100644 index c47d8f39a6eb..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/AbstractDescriptor.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -/** - * @author Dennis Oelkers - */ -public abstract class AbstractDescriptor { - private final String name; - private final boolean exclusive; - private final String linkToDocs; - - // required for guice, but isn't called. - protected AbstractDescriptor() { - throw new IllegalStateException("This class should not be instantiated directly, this is a bug."); - } - - protected AbstractDescriptor(String name, boolean exclusive, String linkToDocs) { - this.name = name; - this.exclusive = exclusive; - this.linkToDocs = linkToDocs; - } - - public String getName() { - return name; - } - - public boolean isExclusive() { - return exclusive; - } - - public String getLinkToDocs() { - return linkToDocs; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Capabilities.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Capabilities.java deleted file mode 100644 index e61e01e2c59c..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Capabilities.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import com.google.common.collect.Sets; - -import java.util.Set; - -public class Capabilities { - public static Set toStringSet(Set capabilities) { - final Set stringSet = Sets.newHashSetWithExpectedSize(capabilities.size()); - for (ServerStatus.Capability capability : capabilities) { - stringSet.add(capability.toString()); - } - - return stringSet; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/DocsHelper.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/DocsHelper.java deleted file mode 100644 index 772cf12e79dd..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/DocsHelper.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.graylog2.plugin; - -public enum DocsHelper { - PAGE_SENDING_JSONPATH("sending_data.html#json-path-from-http-api-input"), - PAGE_ES_CONFIGURATION("configuring_es.html"), - PAGE_LDAP_TROUBLESHOOTING("users_roles.html#troubleshooting"); - - private static final String DOCS_URL = "http://docs.graylog.org/en/"; - - private final String path; - - DocsHelper(String path) { - this.path = path; - } - - @Override - public String toString() { - final String version = Version.CURRENT_CLASSPATH.major + "." + Version.CURRENT_CLASSPATH.minor; - - return DOCS_URL + version + "/pages/" + path; - } - - public String toLink(String title) { - return "" + title + ""; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/EmptyMessages.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/EmptyMessages.java deleted file mode 100644 index f57512cfb4f3..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/EmptyMessages.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import java.util.Collections; -import java.util.Iterator; - -public class EmptyMessages implements Messages { - private static final EmptyMessages EMPTY_MESSAGES = new EmptyMessages(); - - @Override - public Iterator iterator() { - return Collections.emptyIterator(); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/InstantMillisProvider.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/InstantMillisProvider.java deleted file mode 100644 index c96b23dc273f..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/InstantMillisProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import org.joda.time.DateTime; -import org.joda.time.DateTimeUtils; -import org.joda.time.Period; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class InstantMillisProvider implements DateTimeUtils.MillisProvider { - private static final Logger log = LoggerFactory.getLogger(InstantMillisProvider.class); - private DateTime currentTick; - - public InstantMillisProvider(DateTime instant) { - setTimeTo(instant); - } - - public void setTimeTo(DateTime instant) { - log.debug("Setting clock to {}", instant); - currentTick = instant; - } - - @Override - public long getMillis() { - return currentTick.getMillis(); - } - - public void tick(Period period) { - currentTick = currentTick.plus(period); - log.debug("Ticking clock by {} to {}", period, currentTick); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java deleted file mode 100644 index d8aa61101206..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import com.codahale.metrics.MetricRegistry; - -// TODO this is a stupid workaround to have both a Singleton MetricRegistry and be able to inject new instances for local usage. -public class LocalMetricRegistry extends MetricRegistry { -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MessageCollection.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MessageCollection.java deleted file mode 100644 index 117afb878847..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MessageCollection.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterators; - -import java.util.Iterator; - -public class MessageCollection implements Messages { - - private final ImmutableList messages; - - public MessageCollection(Iterable other) { - messages = ImmutableList.copyOf(other); - } - - @Override - public Iterator iterator() { - return Iterators.filter(messages.iterator(), e -> !e.getFilterOut()); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Messages.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Messages.java deleted file mode 100644 index db031f78bd4b..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Messages.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -public interface Messages extends Iterable { -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MetricSets.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MetricSets.java deleted file mode 100644 index 2e79f2e70e4a..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MetricSets.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import com.codahale.metrics.Metric; -import com.codahale.metrics.MetricSet; -import com.google.common.collect.ImmutableMap; - -import java.util.Map; - -public class MetricSets { - public static MetricSet of(final Map gauges) { - return new MetricSet(){ - @Override - public Map getMetrics() { - return ImmutableMap.copyOf(gauges); - } - }; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Plugin.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Plugin.java deleted file mode 100644 index ec57910ae873..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Plugin.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import java.util.Collection; - -public interface Plugin { - PluginMetaData metadata(); - Collection modules(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginConfigBean.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginConfigBean.java deleted file mode 100644 index 83e258257ee8..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginConfigBean.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -/** - * @author Dennis Oelkers - */ -public interface PluginConfigBean { -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java deleted file mode 100644 index 504d96b1b88d..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import com.github.joschi.jadconfig.Parameter; - -/** - * @author Dennis Oelkers - */ -public class PluginLoaderConfig { - @Parameter(value = "plugin_dir") - private String pluginDir = "plugin"; - - public String getPluginDir() { - return pluginDir; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginMetaData.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginMetaData.java deleted file mode 100644 index a581f195de08..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginMetaData.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import java.net.URI; -import java.util.Set; - -public interface PluginMetaData { - String getUniqueId(); - - String getName(); - - String getAuthor(); - - URI getURL(); - - Version getVersion(); - - String getDescription(); - - Version getRequiredVersion(); - - Set getRequiredCapabilities(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java deleted file mode 100644 index 29d4ec98fccc..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -/** - * @author Lennart Koopmann - */ -public class ProcessingPauseLockedException extends Exception { - - public ProcessingPauseLockedException() { - super(); - } - - public ProcessingPauseLockedException(String msg) { - super(msg); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/RulesEngine.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/RulesEngine.java deleted file mode 100644 index ebbd47762e78..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/RulesEngine.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import java.io.Closeable; - -public interface RulesEngine { - - public interface RulesSession extends Closeable { - - int evaluate(Message message, boolean retractFacts); - - Object insertFact(Object fact); - - boolean deleteFact(Object fact); - } - - boolean addRule(String ruleSource); - - boolean addRulesFromFile(String rulesFile); - - int evaluateInSharedSession(Message message); - - RulesSession createPrivateSession(); - - Object insertFact(Object fact); - - boolean deleteFact(Object fact); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/SingletonMessages.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/SingletonMessages.java deleted file mode 100644 index 3e16b094163b..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/SingletonMessages.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import com.google.common.collect.Iterators; - -import java.util.Iterator; - -public class SingletonMessages implements Messages { - - private final Message message; - - public SingletonMessages(Message message) { - this.message = message; - } - - @Override - public Iterator iterator() { - return Iterators.singletonIterator(message); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Stoppable.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Stoppable.java deleted file mode 100644 index afd9e6a9d648..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Stoppable.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -/** - * @author Dennis Oelkers - */ -public interface Stoppable { - public void stop(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java deleted file mode 100644 index d4f03bc7ab4a..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.alarms; - -import org.graylog2.plugin.MessageSummary; -import org.graylog2.plugin.streams.Stream; -import org.joda.time.DateTime; - -import java.util.List; -import java.util.Map; - -public interface AlertCondition { - String getDescription(); - - String getId(); - - DateTime getCreatedAt(); - - String getCreatorUserId(); - - Stream getStream(); - - Map getParameters(); - - Integer getBacklog(); - - int getGrace(); - - String getTypeString(); - - interface CheckResult { - boolean isTriggered(); - String getResultDescription(); - AlertCondition getTriggeredCondition(); - DateTime getTriggeredAt(); - - /** - * The limited list of messages that matched the alert in the corresponding stream. - * - * @return list of message summaries - */ - List getMatchingMessages(); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java deleted file mode 100644 index a4366dea407b..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.alarms.callbacks; - -import org.graylog2.plugin.alarms.AlertCondition; -import org.graylog2.plugin.configuration.Configuration; -import org.graylog2.plugin.configuration.ConfigurationException; -import org.graylog2.plugin.configuration.ConfigurationRequest; -import org.graylog2.plugin.streams.Stream; - -import java.util.Map; - -/** - * - * @author Lennart Koopmann - */ -public interface AlarmCallback { - - public void initialize(Configuration config) throws AlarmCallbackConfigurationException; - public void call(Stream stream, AlertCondition.CheckResult result) throws AlarmCallbackException; - - public ConfigurationRequest getRequestedConfiguration(); - public String getName(); - public Map getAttributes(); - public void checkConfiguration() throws ConfigurationException; -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java deleted file mode 100644 index 1cbc55d607bb..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.alarms.callbacks; - -/** - * - * @author Lennart Koopmann - */ -public class AlarmCallbackConfigurationException extends Exception { - - /** - * Re-generate if you modify the class structure. - */ - private static final long serialVersionUID = 1762085797851052304L; - - public AlarmCallbackConfigurationException() { - super(); - } - - public AlarmCallbackConfigurationException(String msg) { - super(msg); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java deleted file mode 100644 index bfade77736cd..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.alarms.callbacks; - -/** - * - * @author Lennart Koopmann - */ -public class AlarmCallbackException extends Exception { - - /** - * Re-generate if you modify the class structure. - */ - private static final long serialVersionUID = 8249565372019139524L; - - public AlarmCallbackException() { - super(); - } - - public AlarmCallbackException(String msg) { - super(msg); - } - - public AlarmCallbackException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java deleted file mode 100644 index 5a34560a411c..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.alarms.transports; - -/** - * - * @author Lennart Koopmann - */ -public class TransportConfigurationException extends Exception { - - /** - * - */ - private static final long serialVersionUID = -851955448143684632L; - - public TransportConfigurationException() { - super(); - } - - public TransportConfigurationException(String msg) { - super(msg); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java deleted file mode 100644 index 01070e7d7bd3..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.buffers; - -/** - * - * @author Lennart Koopmann - */ -public class BufferOutOfCapacityException extends Exception { - - /** - * Re-generate if you modify the class structure. - */ - private static final long serialVersionUID = -2497994875518554556L; - - public BufferOutOfCapacityException() { - super(); - } - - public BufferOutOfCapacityException(String msg) { - super(msg); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java deleted file mode 100644 index e1f83139de67..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.buffers; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; - -/** - * @author Lennart Koopmann - */ -public class BufferWatermark { - - private final int bufferSize; - private final AtomicLong watermark; - - public BufferWatermark(int bufferSize, AtomicLong watermark) { - this.bufferSize = bufferSize; - this.watermark = watermark; - } - - public long getUtilization() { - return watermark.get(); - } - - public float getUtilizationPercentage() { - return (float) getUtilization()/bufferSize*100; - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java deleted file mode 100644 index 7e8d920103d0..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.buffers; - -import org.graylog2.plugin.journal.RawMessage; - -public interface InputBuffer { - void insert(RawMessage message); - - long getUsage(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java deleted file mode 100644 index 82cd810f05af..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.buffers; - -/** - * @author Lennart Koopmann - */ -public class ProcessingDisabledException extends Exception { - - public ProcessingDisabledException() { - super(); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/cluster/ClusterId.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/cluster/ClusterId.java deleted file mode 100644 index f59d4d357b3f..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/cluster/ClusterId.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.cluster; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.auto.value.AutoValue; - -@JsonAutoDetect -@AutoValue -public abstract class ClusterId { - @JsonProperty - public abstract String clusterId(); - - @JsonCreator - public static ClusterId create(@JsonProperty("cluster_id") String clusterId) { - return new AutoValue_ClusterId(clusterId); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java deleted file mode 100644 index 63a3a96db87f..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.configuration; - -/** - * - * @author Lennart Koopmann - */ -public class ConfigurationException extends Exception { - - /** - * Re-generate if you modify the class structure. - */ - private static final long serialVersionUID = 8745066310811183675L; - - public ConfigurationException() { - super(); - } - - public ConfigurationException(String msg) { - super(msg); - } - - public ConfigurationException(String msg, Throwable e) { - super(msg, e); - } - -} \ No newline at end of file diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java deleted file mode 100644 index 7d9c415c70ef..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.configuration.fields; - -/** - * @author Lennart Koopmann - */ -public class BooleanField extends AbstractConfigurationField { - - public static final String FIELD_TYPE = "boolean"; - - private boolean defaultValue; - - public BooleanField(String name, String humanName, boolean defaultValue, String description) { - super(FIELD_TYPE, name, humanName, description, Optional.OPTIONAL); - this.defaultValue = defaultValue; - } - - @Override - public Object getDefaultValue() { - return this.defaultValue; - } - - @Override - public void setDefaultValue(Object defaultValue) { - if (defaultValue instanceof Boolean) { - this.defaultValue = (boolean) defaultValue; - } - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java deleted file mode 100644 index dca815eee858..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.configuration.fields; - -import java.util.List; -import java.util.Map; - -/** - * @author Lennart Koopmann - */ -public interface ConfigurationField { - - public enum Optional { - OPTIONAL, - NOT_OPTIONAL - } - - public String getFieldType(); - - public String getName(); - public String getHumanName(); - public String getDescription(); - public Object getDefaultValue(); - public void setDefaultValue(Object defaultValue); - public Optional isOptional(); - public List getAttributes(); - public Map> getAdditionalInformation(); - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java deleted file mode 100644 index 55541fde307e..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.dashboards.widgets; - -import org.graylog2.plugin.indexer.searches.timeranges.TimeRange; - -import java.util.Map; - -public interface WidgetStrategy { - interface Factory { - T create(Map config, - TimeRange timeRange, - String widgetId); - } - - ComputationResult compute(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java deleted file mode 100644 index d6de0365979c..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.database; - -import java.util.Map; - -/** - * @author Lennart Koopmann - */ -public interface EmbeddedPersistable { - - public Map getPersistedFields(); - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/Persisted.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/Persisted.java deleted file mode 100644 index 66b5881dc01a..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/Persisted.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.database; - -import org.graylog2.plugin.database.validators.Validator; - -import java.util.Map; - -/** - * @author Dennis Oelkers - */ -public interface Persisted { - String getId(); - - Map getFields(); - Map getValidations(); - Map getEmbeddedValidations(String key); - - Map asMap(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/ValidationException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/ValidationException.java deleted file mode 100644 index 001622fc711c..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/ValidationException.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.database; - -import com.google.common.collect.ImmutableMap; -import org.graylog2.plugin.database.validators.ValidationResult; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public class ValidationException extends Exception { - private final Map> errors; - - public ValidationException(Map> errors) { - this.errors = ImmutableMap.copyOf(errors); - } - - public ValidationException(final String message) { - this("_", message); - } - - public ValidationException(final String field, final String message) { - super(message); - this.errors = ImmutableMap.of(field, Collections.singletonList(new ValidationResult.ValidationFailed(message))); - } - - public Map> getErrors() { - return errors; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java deleted file mode 100644 index 8566007031cb..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.database.validators; - -/** - * @author Dennis Oelkers - */ -public abstract class ValidationResult { - public abstract boolean passed(); - - public static class ValidationPassed extends ValidationResult { - @Override - public boolean passed() { - return true; - } - } - - public static class ValidationFailed extends ValidationResult { - private final String error; - - public ValidationFailed(String errors) { - this.error = errors; - } - - public String getError() { - return error; - } - - @Override - public boolean passed() { - return false; - } - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/Validator.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/Validator.java deleted file mode 100644 index dc0092b9d3a7..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/validators/Validator.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.database.validators; - -/** - * @author Lennart Koopmann - */ -public interface Validator { - - public ValidationResult validate(Object value); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java deleted file mode 100644 index 32b967ad1a3c..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.events.inputs; - -import com.google.auto.value.AutoValue; -import org.graylog2.plugin.IOState; -import org.graylog2.plugin.Stoppable; - -@AutoValue -public abstract class IOStateChangedEvent { - public abstract IOState.Type oldState(); - public abstract IOState.Type newState(); - public abstract IOState changedState(); - - public static IOStateChangedEvent create(IOState.Type oldState, IOState.Type newState, IOState changedEvent) { - return new AutoValue_IOStateChangedEvent<>(oldState, newState, changedEvent); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/filters/MessageFilter.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/filters/MessageFilter.java deleted file mode 100644 index 4d9b1375882e..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/filters/MessageFilter.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.filters; - -import org.graylog2.plugin.Message; - -/** - * - * @author Lennart Koopmann - */ -public interface MessageFilter { - - /** - * Process a Message - * - * @return true if this message should not further be handled (for example for blacklisting purposes) - */ - public boolean filter(Message msg); - - /** - * @return The name of this filter. Should not include whitespaces or special characters. - */ - public String getName(); - - /** - * For determining the runtime order of the filter, specify a priority. - * Lower priorty values are run earlier, if two filters have the same priority, their name will be compared to - * guarantee a repeatable order. - * - * @return the priority - */ - int getPriority(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java deleted file mode 100644 index 452c21bc922e..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.indexer.retention; - -public interface RetentionStrategy { - void retain(); - - Class configurationClass(); - - RetentionStrategyConfig defaultConfiguration(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java deleted file mode 100644 index 384c5add63ec..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.indexer.retention; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = RetentionStrategyConfig.TYPE_FIELD, visible = true) -public interface RetentionStrategyConfig { - String TYPE_FIELD = "type"; - - @JsonProperty(TYPE_FIELD) - String type(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java deleted file mode 100644 index 5d5b253a68cc..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.indexer.rotation; - -public interface RotationStrategy { - void rotate(); - - Class configurationClass(); - - RotationStrategyConfig defaultConfiguration(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java deleted file mode 100644 index 57f04750006d..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.indexer.rotation; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = RotationStrategyConfig.TYPE_FIELD, visible = true) -public interface RotationStrategyConfig { - String TYPE_FIELD = "type"; - - @JsonProperty(TYPE_FIELD) - String type(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java deleted file mode 100644 index 590bd4c12347..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.indexer.searches.timeranges; - -/** - * @author Lennart Koopmann - */ -public class InvalidRangeParametersException extends Exception { - - public InvalidRangeParametersException() { - super(); - } - - public InvalidRangeParametersException(String msg) { - super(msg); - } - -} - diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java deleted file mode 100644 index f0d22ba5b5d1..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.indexer.searches.timeranges; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.joda.time.DateTime; - -import java.util.Map; - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(name = AbsoluteRange.ABSOLUTE, value = AbsoluteRange.class), - @JsonSubTypes.Type(name = RelativeRange.RELATIVE, value = RelativeRange.class), - @JsonSubTypes.Type(name = KeywordRange.KEYWORD, value = KeywordRange.class) -}) -public abstract class TimeRange { - - @JsonProperty - public abstract String type(); - - @JsonIgnore - public abstract DateTime getFrom(); - - @JsonIgnore - public abstract DateTime getTo(); - - @JsonIgnore - public abstract Map getPersistedConfig(); - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/Initializer.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/Initializer.java deleted file mode 100644 index 89e069434efc..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/Initializer.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.initializers; - -import java.util.Map; - -/** - * - * @author Lennart Koopmann - */ -public interface Initializer { - - void initialize(Map config) throws InitializerConfigurationException; - public Map getRequestedConfiguration(); - public String getName(); - boolean masterOnly(); - -} \ No newline at end of file diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java deleted file mode 100644 index 43eb739eb484..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.initializers; - -/** - * - * @author Lennart Koopmann - */ -public class InitializerConfigurationException extends Exception { - - /** - * Re-generate if you modify the class structure. - */ - private static final long serialVersionUID = 2515731988548808134L; - - public InitializerConfigurationException() { - super(); - } - - public InitializerConfigurationException(String msg) { - super(msg); - } - -} \ No newline at end of file diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/Converter.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/Converter.java deleted file mode 100644 index 378698f47ad7..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/Converter.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs; - -import java.util.Locale; -import java.util.Map; - -/** - * @author Lennart Koopmann - */ -public abstract class Converter { - - public enum Type { - NUMERIC, - DATE, - HASH, - SPLIT_AND_COUNT, - SYSLOG_PRI_LEVEL, - SYSLOG_PRI_FACILITY, - TOKENIZER, - IP_ANONYMIZER, - CSV, - LOWERCASE, - UPPERCASE, - FLEXDATE - } - - private final Type type; - private final Map config; - - public Converter(Type type, Map config) { - this.type = type; - this.config = config; - } - - public String getType() { - return this.type.toString().toLowerCase(Locale.ENGLISH); - } - - public Map getConfig() { - return config; - } - - public abstract Object convert(String value); - public abstract boolean buildsMultipleFields(); - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/MisfireException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/MisfireException.java deleted file mode 100644 index bcd4c1feb4d5..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/MisfireException.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs; - -public class MisfireException extends Exception { - - public MisfireException(String msg) { - super(msg); - } - - public MisfireException(Throwable e) { - super(e); - } - - public MisfireException(String msg, Throwable e) { - super(msg, e); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java deleted file mode 100644 index 4f5bb3c678d3..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -public @interface Codec { - /** - * Internal name used for identifying the codec. - * @return - */ - String name(); - - /** - * Human readable name. - * @return - */ - String displayName(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java deleted file mode 100644 index d585b1821206..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface ConfigClass { -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java deleted file mode 100644 index 24610e84cd3c..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -public @interface FactoryClass { -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java deleted file mode 100644 index f7f8893ebc4f..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs.codecs; - -import org.graylog2.plugin.Message; -import org.graylog2.plugin.configuration.Configuration; -import org.graylog2.plugin.configuration.ConfigurationRequest; -import org.graylog2.plugin.journal.RawMessage; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -public interface Codec { - @Nullable - Message decode(@Nonnull RawMessage rawMessage); - - @Nullable - CodecAggregator getAggregator(); - - String getName(); - - @Nonnull - Configuration getConfiguration(); - - public interface Factory { - C create(Configuration configuration); - Config getConfig(); - } - - public interface Config { - public static final String CK_OVERRIDE_SOURCE = "override_source"; - - ConfigurationRequest getRequestedConfiguration(); - void overrideDefaultValues(@Nonnull ConfigurationRequest cr); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java deleted file mode 100644 index 112e3b887ff7..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs.codecs; - -import org.jboss.netty.buffer.ChannelBuffer; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -public interface CodecAggregator { - - @Nonnull - public Result addChunk(ChannelBuffer buf); - - public class Result { - private final ChannelBuffer message; - private final boolean valid; - - public Result(ChannelBuffer message, boolean valid) { - this.message = message; - this.valid = valid; - } - - @Nullable - public ChannelBuffer getMessage() { - return message; - } - - public boolean isValid() { - return valid; - } - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java deleted file mode 100644 index 5f5c4c1d51cc..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.graylog2.plugin.inputs.codecs; - -import org.graylog2.plugin.Message; -import org.graylog2.plugin.journal.RawMessage; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collection; - -public interface MultiMessageCodec extends Codec { - @Nullable - Collection decodeMessages(@Nonnull RawMessage rawMessage); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java deleted file mode 100644 index 0d68126f2b8f..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.inputs.transports; - -import com.codahale.metrics.MetricSet; -import org.graylog2.plugin.configuration.Configuration; -import org.graylog2.plugin.configuration.ConfigurationRequest; -import org.graylog2.plugin.inputs.MessageInput; -import org.graylog2.plugin.inputs.MisfireException; -import org.graylog2.plugin.inputs.codecs.CodecAggregator; - -public interface Transport { - - void setMessageAggregator(CodecAggregator aggregator); - - void launch(MessageInput input) throws MisfireException; - - void stop(); - - MetricSet getMetricSet(); - - public interface Config { - ConfigurationRequest getRequestedConfiguration(); - } - - interface Factory { - T create(Configuration configuration); - Config getConfig(); - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java deleted file mode 100644 index 27d1aea4d32f..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.lifecycles; - -/** - * @author Lennart Koopmann - */ -public enum LoadBalancerStatus { - - DEAD, - ALIVE - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java deleted file mode 100644 index ba60d9b486e1..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.messageprocessors; - -import org.graylog2.plugin.Messages; - -public interface MessageProcessor { - Messages process(Messages messages); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java deleted file mode 100644 index 6e0dd4d73129..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.outputs; - -/** - * - * @author Lennart Koopmann - */ -public class MessageOutputConfigurationException extends Exception { - - /** - * Re-generate if you modify the class structure. - */ - private static final long serialVersionUID = -4252325712098060658L; - - public MessageOutputConfigurationException() { - super(); - } - - public MessageOutputConfigurationException(String msg) { - super(msg); - } - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java deleted file mode 100644 index 9d4db40f8ea0..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.outputs; - -import java.util.Map; -import java.util.Set; - -/** - * @author Lennart Koopmann - */ -public interface OutputStreamConfiguration { - - public void add(String streamId, Set> config); - public Set> get(String streamId); - -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ApiError.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ApiError.java deleted file mode 100644 index 53f2fd2fc847..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ApiError.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.rest; - -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -/** - * @author Dennis Oelkers - */ -@JsonTypeInfo(use= JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.PROPERTY, property="type") -public class ApiError { - public final String message; - - public ApiError(String message) { - this.message = message; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java deleted file mode 100644 index c555d09b47c4..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.rest; - -/** - * Marker interface for JAX-RS resources in plugins. - * - * @see org.graylog2.plugin.PluginModule#addRestResource(Class) - */ -public interface PluginRestResource { -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java deleted file mode 100644 index 648bc7928443..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.rest; - -import org.graylog2.plugin.database.validators.ValidationResult; - -import java.util.List; -import java.util.Map; - -/** - * @author Dennis Oelkers - */ -public class ValidationApiError extends ApiError { - private final Map> validationErrors; - public ValidationApiError(String message, Map> validationErrors) { - super(message); - this.validationErrors = validationErrors; - } - - public Map> getValidationErrors() { - return validationErrors; - } -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java deleted file mode 100644 index 5d6aef4ecdcd..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.security; - -public interface PasswordAlgorithm { - boolean supports(String hashedPassword); - - String hash(String password); - - boolean matches(String hashedPassword, String otherPassword); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/AlertAction.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/AlertAction.java deleted file mode 100644 index 5396028818e6..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/AlertAction.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.streams; - -/** - * @author Dennis Oelkers - */ -public interface AlertAction { - public void handle(Stream stream); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/Output.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/Output.java deleted file mode 100644 index 0f80d3ed999c..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/Output.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.streams; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import org.graylog2.plugin.database.Persisted; - -import java.util.Date; -import java.util.Map; - -@JsonAutoDetect -public interface Output { - String getId(); - - String getTitle(); - - String getType(); - - String getCreatorUserId(); - - Map getConfiguration(); - - Date getCreatedAt(); - - String getContentPack(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/StreamRule.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/StreamRule.java deleted file mode 100644 index e6bfb8e28299..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/StreamRule.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.streams; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import org.graylog2.plugin.database.Persisted; - -import java.util.Map; - -@JsonAutoDetect -public interface StreamRule extends Persisted { - public String getId(); - - public StreamRuleType getType(); - - public String getField(); - - public String getValue(); - - public Boolean getInverted(); - - public String getStreamId(); - - public String getContentPack(); - - public void setType(StreamRuleType type); - - public void setField(String field); - - public void setValue(String value); - - public void setInverted(Boolean inverted); - - public void setContentPack(String contentPack); - - public Map asMap(); -} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java b/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java deleted file mode 100644 index 6780fe2a0297..000000000000 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.system; - -/** - * Created by dennis on 11/12/14. - */ -public class NodeIdPersistenceException extends RuntimeException { - public NodeIdPersistenceException() { - super(); - } - - public NodeIdPersistenceException(String message) { - super(message); - } - - public NodeIdPersistenceException(String message, Throwable cause) { - super(message, cause); - } - - public NodeIdPersistenceException(Throwable cause) { - super(cause); - } -} diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ToolsTest.java b/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ToolsTest.java deleted file mode 100644 index 787a3773c6c6..000000000000 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ToolsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin; - -import org.junit.Test; - -import java.net.URI; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; - -public class ToolsTest { - - @Test - public void testGetUriWithPort() throws Exception { - final URI uriWithPort = new URI("http://example.com:12345"); - final URI uriWithoutPort = new URI("http://example.com"); - - assertEquals(Tools.getUriWithPort(uriWithPort, 1).getPort(), 12345); - assertEquals(Tools.getUriWithPort(uriWithoutPort, 1).getPort(), 1); - } - - @Test - public void testGetUriWithScheme() throws Exception { - assertEquals(Tools.getUriWithScheme(new URI("http://example.com"), "gopher").getScheme(), "gopher"); - assertNull(Tools.getUriWithScheme(new URI("http://example.com"), null).getScheme()); - } -} diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java b/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java deleted file mode 100644 index eb18baec3ca2..000000000000 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.graylog2.plugin.streams; - -import org.junit.Test; - -import static org.junit.Assert.*; - -public class MatchingTypeTest { - - @Test - public void testValueOfOrDefault() throws Exception { - assertEquals(Stream.MatchingType.valueOfOrDefault("AND"), Stream.MatchingType.AND); - assertEquals(Stream.MatchingType.valueOfOrDefault("OR"), Stream.MatchingType.OR); - assertEquals(Stream.MatchingType.valueOfOrDefault(null), Stream.MatchingType.DEFAULT); - assertEquals(Stream.MatchingType.valueOfOrDefault(""), Stream.MatchingType.DEFAULT); - } - - @Test(expected = IllegalArgumentException.class) - public void testValueOfOrDefaultThrowsExceptionForUnknownEnumName() { - Stream.MatchingType.valueOfOrDefault("FOO"); - } -} \ No newline at end of file diff --git a/graylog2-plugin-interfaces/src/test/resources/log4j2-test.xml b/graylog2-plugin-interfaces/src/test/resources/log4j2-test.xml deleted file mode 100644 index a27af731fa20..000000000000 --- a/graylog2-plugin-interfaces/src/test/resources/log4j2-test.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/graylog2-server/pom.xml b/graylog2-server/pom.xml index 21ee3cde3873..e6058d3d6344 100644 --- a/graylog2-server/pom.xml +++ b/graylog2-server/pom.xml @@ -48,10 +48,6 @@ - - org.graylog2 - graylog2-plugin - io.airlift airline @@ -179,6 +175,10 @@ commons-email + + org.glassfish.jersey.core + jersey-common + org.glassfish.jersey.core jersey-server @@ -408,6 +408,19 @@ com.jayway.jsonpath json-path + + + com.github.zafarkhaja + java-semver + + + com.google.protobuf + protobuf-java + + + javax.validation + validation-api + diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/AbstractDescriptor.java b/graylog2-server/src/main/java/org/graylog2/plugin/AbstractDescriptor.java new file mode 100644 index 000000000000..cb070bb9a516 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/AbstractDescriptor.java @@ -0,0 +1,49 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +/** + * @author Dennis Oelkers + */ +public abstract class AbstractDescriptor { + private final String name; + private final boolean exclusive; + private final String linkToDocs; + + // required for guice, but isn't called. + protected AbstractDescriptor() { + throw new IllegalStateException("This class should not be instantiated directly, this is a bug."); + } + + protected AbstractDescriptor(String name, boolean exclusive, String linkToDocs) { + this.name = name; + this.exclusive = exclusive; + this.linkToDocs = linkToDocs; + } + + public String getName() { + return name; + } + + public boolean isExclusive() { + return exclusive; + } + + public String getLinkToDocs() { + return linkToDocs; + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/BaseConfiguration.java b/graylog2-server/src/main/java/org/graylog2/plugin/BaseConfiguration.java similarity index 90% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/BaseConfiguration.java rename to graylog2-server/src/main/java/org/graylog2/plugin/BaseConfiguration.java index 5448fb859485..1cf9472222dd 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/BaseConfiguration.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/BaseConfiguration.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/Capabilities.java b/graylog2-server/src/main/java/org/graylog2/plugin/Capabilities.java new file mode 100644 index 000000000000..946b01b6b3d4 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Capabilities.java @@ -0,0 +1,32 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import com.google.common.collect.Sets; + +import java.util.Set; + +public class Capabilities { + public static Set toStringSet(Set capabilities) { + final Set stringSet = Sets.newHashSetWithExpectedSize(capabilities.size()); + for (ServerStatus.Capability capability : capabilities) { + stringSet.add(capability.toString()); + } + + return stringSet; + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/DocsHelper.java b/graylog2-server/src/main/java/org/graylog2/plugin/DocsHelper.java new file mode 100644 index 000000000000..46a02546e2e3 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/DocsHelper.java @@ -0,0 +1,42 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +public enum DocsHelper { + PAGE_SENDING_JSONPATH("sending_data.html#json-path-from-http-api-input"), + PAGE_ES_CONFIGURATION("configuring_es.html"), + PAGE_LDAP_TROUBLESHOOTING("users_roles.html#troubleshooting"); + + private static final String DOCS_URL = "http://docs.graylog.org/en/"; + + private final String path; + + DocsHelper(String path) { + this.path = path; + } + + @Override + public String toString() { + final String version = Version.CURRENT_CLASSPATH.major + "." + Version.CURRENT_CLASSPATH.minor; + + return DOCS_URL + version + "/pages/" + path; + } + + public String toLink(String title) { + return "" + title + ""; + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/EmptyMessages.java b/graylog2-server/src/main/java/org/graylog2/plugin/EmptyMessages.java new file mode 100644 index 000000000000..e32e5436c953 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/EmptyMessages.java @@ -0,0 +1,29 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import java.util.Collections; +import java.util.Iterator; + +public class EmptyMessages implements Messages { + private static final EmptyMessages EMPTY_MESSAGES = new EmptyMessages(); + + @Override + public Iterator iterator() { + return Collections.emptyIterator(); + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/GlobalMetricNames.java b/graylog2-server/src/main/java/org/graylog2/plugin/GlobalMetricNames.java similarity index 61% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/GlobalMetricNames.java rename to graylog2-server/src/main/java/org/graylog2/plugin/GlobalMetricNames.java index 8684f4b5f0b7..9658f13bf7ea 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/GlobalMetricNames.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/GlobalMetricNames.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/IOState.java b/graylog2-server/src/main/java/org/graylog2/plugin/IOState.java similarity index 71% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/IOState.java rename to graylog2-server/src/main/java/org/graylog2/plugin/IOState.java index c1c12346a9f7..561c3114d569 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/IOState.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/IOState.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/InstantMillisProvider.java b/graylog2-server/src/main/java/org/graylog2/plugin/InstantMillisProvider.java new file mode 100644 index 000000000000..1eebc99e96d8 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/InstantMillisProvider.java @@ -0,0 +1,47 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeUtils; +import org.joda.time.Period; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class InstantMillisProvider implements DateTimeUtils.MillisProvider { + private static final Logger log = LoggerFactory.getLogger(InstantMillisProvider.class); + private DateTime currentTick; + + public InstantMillisProvider(DateTime instant) { + setTimeTo(instant); + } + + public void setTimeTo(DateTime instant) { + log.debug("Setting clock to {}", instant); + currentTick = instant; + } + + @Override + public long getMillis() { + return currentTick.getMillis(); + } + + public void tick(Period period) { + currentTick = currentTick.plus(period); + log.debug("Ticking clock by {} to {}", period, currentTick); + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/KafkaJournalConfiguration.java b/graylog2-server/src/main/java/org/graylog2/plugin/KafkaJournalConfiguration.java similarity index 76% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/KafkaJournalConfiguration.java rename to graylog2-server/src/main/java/org/graylog2/plugin/KafkaJournalConfiguration.java index e4a796a0a952..4f023d07ca56 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/KafkaJournalConfiguration.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/KafkaJournalConfiguration.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java b/graylog2-server/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java new file mode 100644 index 000000000000..f15c1212758d --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/LocalMetricRegistry.java @@ -0,0 +1,23 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import com.codahale.metrics.MetricRegistry; + +// TODO this is a stupid workaround to have both a Singleton MetricRegistry and be able to inject new instances for local usage. +public class LocalMetricRegistry extends MetricRegistry { +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Message.java b/graylog2-server/src/main/java/org/graylog2/plugin/Message.java similarity index 93% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Message.java rename to graylog2-server/src/main/java/org/graylog2/plugin/Message.java index 114d1f3e7e29..fe2de8667635 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Message.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Message.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/MessageCollection.java b/graylog2-server/src/main/java/org/graylog2/plugin/MessageCollection.java new file mode 100644 index 000000000000..c11735f50cad --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/MessageCollection.java @@ -0,0 +1,36 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterators; + +import java.util.Iterator; + +public class MessageCollection implements Messages { + + private final ImmutableList messages; + + public MessageCollection(Iterable other) { + messages = ImmutableList.copyOf(other); + } + + @Override + public Iterator iterator() { + return Iterators.filter(messages.iterator(), e -> !e.getFilterOut()); + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MessageSummary.java b/graylog2-server/src/main/java/org/graylog2/plugin/MessageSummary.java similarity index 69% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MessageSummary.java rename to graylog2-server/src/main/java/org/graylog2/plugin/MessageSummary.java index e651c83d9579..3b1b8a932766 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/MessageSummary.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/MessageSummary.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/Messages.java b/graylog2-server/src/main/java/org/graylog2/plugin/Messages.java new file mode 100644 index 000000000000..6761ba0471ec --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Messages.java @@ -0,0 +1,20 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +public interface Messages extends Iterable { +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/MetricSets.java b/graylog2-server/src/main/java/org/graylog2/plugin/MetricSets.java new file mode 100644 index 000000000000..604e44ba3310 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/MetricSets.java @@ -0,0 +1,34 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import com.codahale.metrics.Metric; +import com.codahale.metrics.MetricSet; +import com.google.common.collect.ImmutableMap; + +import java.util.Map; + +public class MetricSets { + public static MetricSet of(final Map gauges) { + return new MetricSet(){ + @Override + public Map getMetrics() { + return ImmutableMap.copyOf(gauges); + } + }; + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/Plugin.java b/graylog2-server/src/main/java/org/graylog2/plugin/Plugin.java new file mode 100644 index 000000000000..d0247c4763e4 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Plugin.java @@ -0,0 +1,24 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import java.util.Collection; + +public interface Plugin { + PluginMetaData metadata(); + Collection modules(); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/PluginConfigBean.java b/graylog2-server/src/main/java/org/graylog2/plugin/PluginConfigBean.java new file mode 100644 index 000000000000..330c36d99034 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/PluginConfigBean.java @@ -0,0 +1,23 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +/** + * @author Dennis Oelkers + */ +public interface PluginConfigBean { +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java b/graylog2-server/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java new file mode 100644 index 000000000000..5a2a16624bae --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/PluginLoaderConfig.java @@ -0,0 +1,31 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import com.github.joschi.jadconfig.Parameter; + +/** + * @author Dennis Oelkers + */ +public class PluginLoaderConfig { + @Parameter(value = "plugin_dir") + private String pluginDir = "plugin"; + + public String getPluginDir() { + return pluginDir; + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/PluginMetaData.java b/graylog2-server/src/main/java/org/graylog2/plugin/PluginMetaData.java new file mode 100644 index 000000000000..7879505f5a80 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/PluginMetaData.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import java.net.URI; +import java.util.Set; + +public interface PluginMetaData { + String getUniqueId(); + + String getName(); + + String getAuthor(); + + URI getURL(); + + Version getVersion(); + + String getDescription(); + + Version getRequiredVersion(); + + Set getRequiredCapabilities(); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginModule.java b/graylog2-server/src/main/java/org/graylog2/plugin/PluginModule.java similarity index 85% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginModule.java rename to graylog2-server/src/main/java/org/graylog2/plugin/PluginModule.java index 14fec2cd17c8..fa917dfb625a 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/PluginModule.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/PluginModule.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java b/graylog2-server/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java new file mode 100644 index 000000000000..6a22128249dc --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/ProcessingPauseLockedException.java @@ -0,0 +1,32 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +/** + * @author Lennart Koopmann + */ +public class ProcessingPauseLockedException extends Exception { + + public ProcessingPauseLockedException() { + super(); + } + + public ProcessingPauseLockedException(String msg) { + super(msg); + } + +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ResolvableInetSocketAddress.java b/graylog2-server/src/main/java/org/graylog2/plugin/ResolvableInetSocketAddress.java similarity index 65% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ResolvableInetSocketAddress.java rename to graylog2-server/src/main/java/org/graylog2/plugin/ResolvableInetSocketAddress.java index 977e5cdea19b..4a9a7e1472a3 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ResolvableInetSocketAddress.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/ResolvableInetSocketAddress.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/RulesEngine.java b/graylog2-server/src/main/java/org/graylog2/plugin/RulesEngine.java new file mode 100644 index 000000000000..bad9f2c9e8aa --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/RulesEngine.java @@ -0,0 +1,43 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import java.io.Closeable; + +public interface RulesEngine { + + public interface RulesSession extends Closeable { + + int evaluate(Message message, boolean retractFacts); + + Object insertFact(Object fact); + + boolean deleteFact(Object fact); + } + + boolean addRule(String ruleSource); + + boolean addRulesFromFile(String rulesFile); + + int evaluateInSharedSession(Message message); + + RulesSession createPrivateSession(); + + Object insertFact(Object fact); + + boolean deleteFact(Object fact); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ServerStatus.java b/graylog2-server/src/main/java/org/graylog2/plugin/ServerStatus.java similarity index 84% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ServerStatus.java rename to graylog2-server/src/main/java/org/graylog2/plugin/ServerStatus.java index 470d2de2950c..86dc78818957 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ServerStatus.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/ServerStatus.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/SingletonMessages.java b/graylog2-server/src/main/java/org/graylog2/plugin/SingletonMessages.java new file mode 100644 index 000000000000..6fd173757490 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/SingletonMessages.java @@ -0,0 +1,36 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import com.google.common.collect.Iterators; + +import java.util.Iterator; + +public class SingletonMessages implements Messages { + + private final Message message; + + public SingletonMessages(Message message) { + this.message = message; + } + + @Override + public Iterator iterator() { + return Iterators.singletonIterator(message); + } + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/Stoppable.java b/graylog2-server/src/main/java/org/graylog2/plugin/Stoppable.java new file mode 100644 index 000000000000..88eb98b31b04 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Stoppable.java @@ -0,0 +1,24 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +/** + * @author Dennis Oelkers + */ +public interface Stoppable { + public void stop(); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ThrottleState.java b/graylog2-server/src/main/java/org/graylog2/plugin/ThrottleState.java similarity index 53% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ThrottleState.java rename to graylog2-server/src/main/java/org/graylog2/plugin/ThrottleState.java index 0981ecb9f9f9..a33cb283c831 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/ThrottleState.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/ThrottleState.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Tools.java b/graylog2-server/src/main/java/org/graylog2/plugin/Tools.java similarity index 93% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Tools.java rename to graylog2-server/src/main/java/org/graylog2/plugin/Tools.java index 237e11357d69..d1c802914ef2 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Tools.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Tools.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Version.java b/graylog2-server/src/main/java/org/graylog2/plugin/Version.java similarity index 83% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Version.java rename to graylog2-server/src/main/java/org/graylog2/plugin/Version.java index 618d8045778f..3adc8c68f5a4 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/Version.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/Version.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java new file mode 100644 index 000000000000..c34809240bbe --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/AlertCondition.java @@ -0,0 +1,58 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.alarms; + +import org.graylog2.plugin.MessageSummary; +import org.graylog2.plugin.streams.Stream; +import org.joda.time.DateTime; + +import java.util.List; +import java.util.Map; + +public interface AlertCondition { + String getDescription(); + + String getId(); + + DateTime getCreatedAt(); + + String getCreatorUserId(); + + Stream getStream(); + + Map getParameters(); + + Integer getBacklog(); + + int getGrace(); + + String getTypeString(); + + interface CheckResult { + boolean isTriggered(); + String getResultDescription(); + AlertCondition getTriggeredCondition(); + DateTime getTriggeredAt(); + + /** + * The limited list of messages that matched the alert in the corresponding stream. + * + * @return list of message summaries + */ + List getMatchingMessages(); + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java new file mode 100644 index 000000000000..ae317d6c0407 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallback.java @@ -0,0 +1,40 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.alarms.callbacks; + +import org.graylog2.plugin.alarms.AlertCondition; +import org.graylog2.plugin.configuration.Configuration; +import org.graylog2.plugin.configuration.ConfigurationException; +import org.graylog2.plugin.configuration.ConfigurationRequest; +import org.graylog2.plugin.streams.Stream; + +import java.util.Map; + +/** + * + * @author Lennart Koopmann + */ +public interface AlarmCallback { + + public void initialize(Configuration config) throws AlarmCallbackConfigurationException; + public void call(Stream stream, AlertCondition.CheckResult result) throws AlarmCallbackException; + + public ConfigurationRequest getRequestedConfiguration(); + public String getName(); + public Map getAttributes(); + public void checkConfiguration() throws ConfigurationException; +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java new file mode 100644 index 000000000000..90378eb43f2f --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackConfigurationException.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.alarms.callbacks; + +/** + * + * @author Lennart Koopmann + */ +public class AlarmCallbackConfigurationException extends Exception { + + /** + * Re-generate if you modify the class structure. + */ + private static final long serialVersionUID = 1762085797851052304L; + + public AlarmCallbackConfigurationException() { + super(); + } + + public AlarmCallbackConfigurationException(String msg) { + super(msg); + } + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java new file mode 100644 index 000000000000..49183fffc1fb --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/callbacks/AlarmCallbackException.java @@ -0,0 +1,41 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.alarms.callbacks; + +/** + * + * @author Lennart Koopmann + */ +public class AlarmCallbackException extends Exception { + + /** + * Re-generate if you modify the class structure. + */ + private static final long serialVersionUID = 8249565372019139524L; + + public AlarmCallbackException() { + super(); + } + + public AlarmCallbackException(String msg) { + super(msg); + } + + public AlarmCallbackException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java new file mode 100644 index 000000000000..8c587d2cf3ae --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/alarms/transports/TransportConfigurationException.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.alarms.transports; + +/** + * + * @author Lennart Koopmann + */ +public class TransportConfigurationException extends Exception { + + /** + * + */ + private static final long serialVersionUID = -851955448143684632L; + + public TransportConfigurationException() { + super(); + } + + public TransportConfigurationException(String msg) { + super(msg); + } + +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/Buffer.java b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/Buffer.java similarity index 69% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/Buffer.java rename to graylog2-server/src/main/java/org/graylog2/plugin/buffers/Buffer.java index 12bdac11e84d..96e5d75451dd 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/Buffer.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/Buffer.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.buffers; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java new file mode 100644 index 000000000000..0ac5ac8d4dd2 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferOutOfCapacityException.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.buffers; + +/** + * + * @author Lennart Koopmann + */ +public class BufferOutOfCapacityException extends Exception { + + /** + * Re-generate if you modify the class structure. + */ + private static final long serialVersionUID = -2497994875518554556L; + + public BufferOutOfCapacityException() { + super(); + } + + public BufferOutOfCapacityException(String msg) { + super(msg); + } + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java new file mode 100644 index 000000000000..4ca1f435f7d5 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/BufferWatermark.java @@ -0,0 +1,43 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.buffers; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; + +/** + * @author Lennart Koopmann + */ +public class BufferWatermark { + + private final int bufferSize; + private final AtomicLong watermark; + + public BufferWatermark(int bufferSize, AtomicLong watermark) { + this.bufferSize = bufferSize; + this.watermark = watermark; + } + + public long getUtilization() { + return watermark.get(); + } + + public float getUtilizationPercentage() { + return (float) getUtilization()/bufferSize*100; + } + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java new file mode 100644 index 000000000000..ca0a5a6eaa5b --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/InputBuffer.java @@ -0,0 +1,25 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.buffers; + +import org.graylog2.plugin.journal.RawMessage; + +public interface InputBuffer { + void insert(RawMessage message); + + long getUsage(); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/MessageEvent.java b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/MessageEvent.java similarity index 64% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/MessageEvent.java rename to graylog2-server/src/main/java/org/graylog2/plugin/buffers/MessageEvent.java index 4e1a69010e56..e920c00b3bd0 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/buffers/MessageEvent.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/MessageEvent.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.buffers; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java new file mode 100644 index 000000000000..660af4bd502b --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/buffers/ProcessingDisabledException.java @@ -0,0 +1,28 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.buffers; + +/** + * @author Lennart Koopmann + */ +public class ProcessingDisabledException extends Exception { + + public ProcessingDisabledException() { + super(); + } + +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/cluster/ClusterConfigService.java b/graylog2-server/src/main/java/org/graylog2/plugin/cluster/ClusterConfigService.java similarity index 61% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/cluster/ClusterConfigService.java rename to graylog2-server/src/main/java/org/graylog2/plugin/cluster/ClusterConfigService.java index 395a5dc05c5a..03fa7dfee9f0 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/cluster/ClusterConfigService.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/cluster/ClusterConfigService.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.cluster; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/cluster/ClusterId.java b/graylog2-server/src/main/java/org/graylog2/plugin/cluster/ClusterId.java new file mode 100644 index 000000000000..e2373529a43e --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/cluster/ClusterId.java @@ -0,0 +1,34 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.cluster; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.auto.value.AutoValue; + +@JsonAutoDetect +@AutoValue +public abstract class ClusterId { + @JsonProperty + public abstract String clusterId(); + + @JsonCreator + public static ClusterId create(@JsonProperty("cluster_id") String clusterId) { + return new AutoValue_ClusterId(clusterId); + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/Configuration.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/Configuration.java similarity index 81% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/Configuration.java rename to graylog2-server/src/main/java/org/graylog2/plugin/configuration/Configuration.java index 10653cb9faac..adfd2cc21970 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/Configuration.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/Configuration.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java new file mode 100644 index 000000000000..5e5d697a3a02 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/ConfigurationException.java @@ -0,0 +1,42 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.configuration; + +/** + * + * @author Lennart Koopmann + */ +public class ConfigurationException extends Exception { + + /** + * Re-generate if you modify the class structure. + */ + private static final long serialVersionUID = 8745066310811183675L; + + public ConfigurationException() { + super(); + } + + public ConfigurationException(String msg) { + super(msg); + } + + public ConfigurationException(String msg, Throwable e) { + super(msg, e); + } + +} \ No newline at end of file diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/ConfigurationRequest.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/ConfigurationRequest.java similarity index 84% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/ConfigurationRequest.java rename to graylog2-server/src/main/java/org/graylog2/plugin/configuration/ConfigurationRequest.java index 9f414cb9b7a5..cbb59211c44b 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/ConfigurationRequest.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/ConfigurationRequest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/AbstractConfigurationField.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/AbstractConfigurationField.java similarity index 54% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/AbstractConfigurationField.java rename to graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/AbstractConfigurationField.java index 64a3ce27ad3c..e4139fdc346b 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/AbstractConfigurationField.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/AbstractConfigurationField.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java new file mode 100644 index 000000000000..32528277f175 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/BooleanField.java @@ -0,0 +1,44 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.configuration.fields; + +/** + * @author Lennart Koopmann + */ +public class BooleanField extends AbstractConfigurationField { + + public static final String FIELD_TYPE = "boolean"; + + private boolean defaultValue; + + public BooleanField(String name, String humanName, boolean defaultValue, String description) { + super(FIELD_TYPE, name, humanName, description, Optional.OPTIONAL); + this.defaultValue = defaultValue; + } + + @Override + public Object getDefaultValue() { + return this.defaultValue; + } + + @Override + public void setDefaultValue(Object defaultValue) { + if (defaultValue instanceof Boolean) { + this.defaultValue = (boolean) defaultValue; + } + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java new file mode 100644 index 000000000000..15a8f1013126 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/ConfigurationField.java @@ -0,0 +1,43 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.configuration.fields; + +import java.util.List; +import java.util.Map; + +/** + * @author Lennart Koopmann + */ +public interface ConfigurationField { + + public enum Optional { + OPTIONAL, + NOT_OPTIONAL + } + + public String getFieldType(); + + public String getName(); + public String getHumanName(); + public String getDescription(); + public Object getDefaultValue(); + public void setDefaultValue(Object defaultValue); + public Optional isOptional(); + public List getAttributes(); + public Map> getAdditionalInformation(); + +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/DropdownField.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/DropdownField.java similarity index 62% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/DropdownField.java rename to graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/DropdownField.java index acfe6d4b90c2..1625141675b3 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/DropdownField.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/DropdownField.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/NumberField.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/NumberField.java similarity index 60% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/NumberField.java rename to graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/NumberField.java index e459fc95c232..edefc8ee34b2 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/NumberField.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/NumberField.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/TextField.java b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/TextField.java similarity index 60% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/TextField.java rename to graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/TextField.java index ddb76fe30936..0f151f27e89a 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/configuration/fields/TextField.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/configuration/fields/TextField.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/dashboards/widgets/ComputationResult.java b/graylog2-server/src/main/java/org/graylog2/plugin/dashboards/widgets/ComputationResult.java similarity index 59% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/dashboards/widgets/ComputationResult.java rename to graylog2-server/src/main/java/org/graylog2/plugin/dashboards/widgets/ComputationResult.java index a618cba30b91..f9d9e1aab0a8 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/dashboards/widgets/ComputationResult.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/dashboards/widgets/ComputationResult.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.dashboards.widgets; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java b/graylog2-server/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java new file mode 100644 index 000000000000..911557c4fc49 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/dashboards/widgets/WidgetStrategy.java @@ -0,0 +1,31 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.dashboards.widgets; + +import org.graylog2.plugin.indexer.searches.timeranges.TimeRange; + +import java.util.Map; + +public interface WidgetStrategy { + interface Factory { + T create(Map config, + TimeRange timeRange, + String widgetId); + } + + ComputationResult compute(); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java b/graylog2-server/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java new file mode 100644 index 000000000000..6c5737875c05 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/database/EmbeddedPersistable.java @@ -0,0 +1,28 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.database; + +import java.util.Map; + +/** + * @author Lennart Koopmann + */ +public interface EmbeddedPersistable { + + public Map getPersistedFields(); + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/database/Persisted.java b/graylog2-server/src/main/java/org/graylog2/plugin/database/Persisted.java new file mode 100644 index 000000000000..af683cd38d90 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/database/Persisted.java @@ -0,0 +1,34 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.database; + +import org.graylog2.plugin.database.validators.Validator; + +import java.util.Map; + +/** + * @author Dennis Oelkers + */ +public interface Persisted { + String getId(); + + Map getFields(); + Map getValidations(); + Map getEmbeddedValidations(String key); + + Map asMap(); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/PersistedService.java b/graylog2-server/src/main/java/org/graylog2/plugin/database/PersistedService.java similarity index 57% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/PersistedService.java rename to graylog2-server/src/main/java/org/graylog2/plugin/database/PersistedService.java index 4d2d5a5ee05c..53b796a8291b 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/PersistedService.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/database/PersistedService.java @@ -1,25 +1,3 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ /** * This file is part of Graylog. * diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/database/ValidationException.java b/graylog2-server/src/main/java/org/graylog2/plugin/database/ValidationException.java new file mode 100644 index 000000000000..b96bda9b344d --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/database/ValidationException.java @@ -0,0 +1,45 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.database; + +import com.google.common.collect.ImmutableMap; +import org.graylog2.plugin.database.validators.ValidationResult; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class ValidationException extends Exception { + private final Map> errors; + + public ValidationException(Map> errors) { + this.errors = ImmutableMap.copyOf(errors); + } + + public ValidationException(final String message) { + this("_", message); + } + + public ValidationException(final String field, final String message) { + super(message); + this.errors = ImmutableMap.of(field, Collections.singletonList(new ValidationResult.ValidationFailed(message))); + } + + public Map> getErrors() { + return errors; + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/users/User.java b/graylog2-server/src/main/java/org/graylog2/plugin/database/users/User.java similarity index 66% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/users/User.java rename to graylog2-server/src/main/java/org/graylog2/plugin/database/users/User.java index df86cba1e46e..b2c30dfe25af 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/database/users/User.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/database/users/User.java @@ -1,25 +1,3 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ /** * This file is part of Graylog. * diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java b/graylog2-server/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java new file mode 100644 index 000000000000..09caec14f852 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/database/validators/ValidationResult.java @@ -0,0 +1,48 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.database.validators; + +/** + * @author Dennis Oelkers + */ +public abstract class ValidationResult { + public abstract boolean passed(); + + public static class ValidationPassed extends ValidationResult { + @Override + public boolean passed() { + return true; + } + } + + public static class ValidationFailed extends ValidationResult { + private final String error; + + public ValidationFailed(String errors) { + this.error = errors; + } + + public String getError() { + return error; + } + + @Override + public boolean passed() { + return false; + } + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/database/validators/Validator.java b/graylog2-server/src/main/java/org/graylog2/plugin/database/validators/Validator.java new file mode 100644 index 000000000000..7edf3eb622d3 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/database/validators/Validator.java @@ -0,0 +1,25 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.database.validators; + +/** + * @author Lennart Koopmann + */ +public interface Validator { + + public ValidationResult validate(Object value); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java b/graylog2-server/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java new file mode 100644 index 000000000000..70f7fd2b92e2 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/events/inputs/IOStateChangedEvent.java @@ -0,0 +1,32 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.events.inputs; + +import com.google.auto.value.AutoValue; +import org.graylog2.plugin.IOState; +import org.graylog2.plugin.Stoppable; + +@AutoValue +public abstract class IOStateChangedEvent { + public abstract IOState.Type oldState(); + public abstract IOState.Type newState(); + public abstract IOState changedState(); + + public static IOStateChangedEvent create(IOState.Type oldState, IOState.Type newState, IOState changedEvent) { + return new AutoValue_IOStateChangedEvent<>(oldState, newState, changedEvent); + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/filters/MessageFilter.java b/graylog2-server/src/main/java/org/graylog2/plugin/filters/MessageFilter.java new file mode 100644 index 000000000000..80cc9dedd36f --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/filters/MessageFilter.java @@ -0,0 +1,47 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.filters; + +import org.graylog2.plugin.Message; + +/** + * + * @author Lennart Koopmann + */ +public interface MessageFilter { + + /** + * Process a Message + * + * @return true if this message should not further be handled (for example for blacklisting purposes) + */ + public boolean filter(Message msg); + + /** + * @return The name of this filter. Should not include whitespaces or special characters. + */ + public String getName(); + + /** + * For determining the runtime order of the filter, specify a priority. + * Lower priorty values are run earlier, if two filters have the same priority, their name will be compared to + * guarantee a repeatable order. + * + * @return the priority + */ + int getPriority(); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java new file mode 100644 index 000000000000..5c446386c59e --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategy.java @@ -0,0 +1,25 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.indexer.retention; + +public interface RetentionStrategy { + void retain(); + + Class configurationClass(); + + RetentionStrategyConfig defaultConfiguration(); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java new file mode 100644 index 000000000000..4ab8a03207bd --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/retention/RetentionStrategyConfig.java @@ -0,0 +1,28 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.indexer.retention; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = RetentionStrategyConfig.TYPE_FIELD, visible = true) +public interface RetentionStrategyConfig { + String TYPE_FIELD = "type"; + + @JsonProperty(TYPE_FIELD) + String type(); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java new file mode 100644 index 000000000000..51e9baa38031 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategy.java @@ -0,0 +1,25 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.indexer.rotation; + +public interface RotationStrategy { + void rotate(); + + Class configurationClass(); + + RotationStrategyConfig defaultConfiguration(); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java new file mode 100644 index 000000000000..32ee76c97537 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/rotation/RotationStrategyConfig.java @@ -0,0 +1,28 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.indexer.rotation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = RotationStrategyConfig.TYPE_FIELD, visible = true) +public interface RotationStrategyConfig { + String TYPE_FIELD = "type"; + + @JsonProperty(TYPE_FIELD) + String type(); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/AbsoluteRange.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/AbsoluteRange.java similarity index 73% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/AbsoluteRange.java rename to graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/AbsoluteRange.java index e9667b12e8e7..8b2a62087f68 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/AbsoluteRange.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/AbsoluteRange.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.indexer.searches.timeranges; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java new file mode 100644 index 000000000000..65e8ae54a599 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/InvalidRangeParametersException.java @@ -0,0 +1,33 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.indexer.searches.timeranges; + +/** + * @author Lennart Koopmann + */ +public class InvalidRangeParametersException extends Exception { + + public InvalidRangeParametersException() { + super(); + } + + public InvalidRangeParametersException(String msg) { + super(msg); + } + +} + diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/KeywordRange.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/KeywordRange.java similarity index 70% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/KeywordRange.java rename to graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/KeywordRange.java index 4e7fb42f2b37..320c6bc64cf5 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/KeywordRange.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/KeywordRange.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.indexer.searches.timeranges; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/RelativeRange.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/RelativeRange.java similarity index 68% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/RelativeRange.java rename to graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/RelativeRange.java index 26f365c035d9..83a96673910c 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/RelativeRange.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/RelativeRange.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.indexer.searches.timeranges; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java new file mode 100644 index 000000000000..c9e271f43b6a --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/indexer/searches/timeranges/TimeRange.java @@ -0,0 +1,47 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.indexer.searches.timeranges; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.joda.time.DateTime; + +import java.util.Map; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(name = AbsoluteRange.ABSOLUTE, value = AbsoluteRange.class), + @JsonSubTypes.Type(name = RelativeRange.RELATIVE, value = RelativeRange.class), + @JsonSubTypes.Type(name = KeywordRange.KEYWORD, value = KeywordRange.class) +}) +public abstract class TimeRange { + + @JsonProperty + public abstract String type(); + + @JsonIgnore + public abstract DateTime getFrom(); + + @JsonIgnore + public abstract DateTime getTo(); + + @JsonIgnore + public abstract Map getPersistedConfig(); + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/initializers/Initializer.java b/graylog2-server/src/main/java/org/graylog2/plugin/initializers/Initializer.java new file mode 100644 index 000000000000..1e883dcc7a65 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/initializers/Initializer.java @@ -0,0 +1,32 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.initializers; + +import java.util.Map; + +/** + * + * @author Lennart Koopmann + */ +public interface Initializer { + + void initialize(Map config) throws InitializerConfigurationException; + public Map getRequestedConfiguration(); + public String getName(); + boolean masterOnly(); + +} \ No newline at end of file diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java b/graylog2-server/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java new file mode 100644 index 000000000000..6aa6c6ddbad4 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/initializers/InitializerConfigurationException.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.initializers; + +/** + * + * @author Lennart Koopmann + */ +public class InitializerConfigurationException extends Exception { + + /** + * Re-generate if you modify the class structure. + */ + private static final long serialVersionUID = 2515731988548808134L; + + public InitializerConfigurationException() { + super(); + } + + public InitializerConfigurationException(String msg) { + super(msg); + } + +} \ No newline at end of file diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java b/graylog2-server/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java similarity index 92% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java index 9564ce81b3bd..889ec8e70806 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inject; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/Converter.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/Converter.java new file mode 100644 index 000000000000..ae4337619c4e --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/Converter.java @@ -0,0 +1,61 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs; + +import java.util.Locale; +import java.util.Map; + +/** + * @author Lennart Koopmann + */ +public abstract class Converter { + + public enum Type { + NUMERIC, + DATE, + HASH, + SPLIT_AND_COUNT, + SYSLOG_PRI_LEVEL, + SYSLOG_PRI_FACILITY, + TOKENIZER, + IP_ANONYMIZER, + CSV, + LOWERCASE, + UPPERCASE, + FLEXDATE + } + + private final Type type; + private final Map config; + + public Converter(Type type, Map config) { + this.type = type; + this.config = config; + } + + public String getType() { + return this.type.toString().toLowerCase(Locale.ENGLISH); + } + + public Map getConfig() { + return config; + } + + public abstract Object convert(String value); + public abstract boolean buildsMultipleFields(); + +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/Extractor.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/Extractor.java similarity index 93% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/Extractor.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/Extractor.java index d07972f76e54..19c173eef069 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/Extractor.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/Extractor.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/MessageInput.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/MessageInput.java similarity index 92% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/MessageInput.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/MessageInput.java index 67d3ae8636fc..711e87c7ca14 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/MessageInput.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/MessageInput.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/MisfireException.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/MisfireException.java new file mode 100644 index 000000000000..7ec3446e21d6 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/MisfireException.java @@ -0,0 +1,33 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs; + +public class MisfireException extends Exception { + + public MisfireException(String msg) { + super(msg); + } + + public MisfireException(Throwable e) { + super(e); + } + + public MisfireException(String msg, Throwable e) { + super(msg, e); + } + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java new file mode 100644 index 000000000000..3a0f336e61da --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/Codec.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Codec { + /** + * Internal name used for identifying the codec. + * @return + */ + String name(); + + /** + * Human readable name. + * @return + */ + String displayName(); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java new file mode 100644 index 000000000000..93f11a76fccb --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/ConfigClass.java @@ -0,0 +1,27 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface ConfigClass { +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java new file mode 100644 index 000000000000..60859c601f51 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/annotations/FactoryClass.java @@ -0,0 +1,27 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface FactoryClass { +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/AbstractCodec.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/AbstractCodec.java similarity index 69% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/AbstractCodec.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/AbstractCodec.java index 4835883ae4a6..48a3b6681e72 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/codecs/AbstractCodec.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/AbstractCodec.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.codecs; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java new file mode 100644 index 000000000000..0a6f7e9e7276 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/Codec.java @@ -0,0 +1,50 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs.codecs; + +import org.graylog2.plugin.Message; +import org.graylog2.plugin.configuration.Configuration; +import org.graylog2.plugin.configuration.ConfigurationRequest; +import org.graylog2.plugin.journal.RawMessage; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +public interface Codec { + @Nullable + Message decode(@Nonnull RawMessage rawMessage); + + @Nullable + CodecAggregator getAggregator(); + + String getName(); + + @Nonnull + Configuration getConfiguration(); + + public interface Factory { + C create(Configuration configuration); + Config getConfig(); + } + + public interface Config { + public static final String CK_OVERRIDE_SOURCE = "override_source"; + + ConfigurationRequest getRequestedConfiguration(); + void overrideDefaultValues(@Nonnull ConfigurationRequest cr); + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java new file mode 100644 index 000000000000..74c6d5d501dc --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/CodecAggregator.java @@ -0,0 +1,47 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs.codecs; + +import org.jboss.netty.buffer.ChannelBuffer; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +public interface CodecAggregator { + + @Nonnull + public Result addChunk(ChannelBuffer buf); + + public class Result { + private final ChannelBuffer message; + private final boolean valid; + + public Result(ChannelBuffer message, boolean valid) { + this.message = message; + this.valid = valid; + } + + @Nullable + public ChannelBuffer getMessage() { + return message; + } + + public boolean isValid() { + return valid; + } + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java new file mode 100644 index 000000000000..f13c335e5cff --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/codecs/MultiMessageCodec.java @@ -0,0 +1,29 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs.codecs; + +import org.graylog2.plugin.Message; +import org.graylog2.plugin.journal.RawMessage; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.Collection; + +public interface MultiMessageCodec extends Codec { + @Nullable + Collection decodeMessages(@Nonnull RawMessage rawMessage); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/AbstractTcpTransport.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/AbstractTcpTransport.java similarity index 91% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/AbstractTcpTransport.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/AbstractTcpTransport.java index 51b82ec677df..258868cb12ec 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/AbstractTcpTransport.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/AbstractTcpTransport.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.transports; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/GeneratorTransport.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/GeneratorTransport.java similarity index 69% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/GeneratorTransport.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/GeneratorTransport.java index e26039894774..181bf4b93475 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/GeneratorTransport.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/GeneratorTransport.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.transports; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/NettyTransport.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/NettyTransport.java similarity index 92% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/NettyTransport.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/NettyTransport.java index 0cb662eaa18a..8bce6bbb0746 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/NettyTransport.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/NettyTransport.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.transports; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/ThrottleableTransport.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/ThrottleableTransport.java similarity index 88% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/ThrottleableTransport.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/ThrottleableTransport.java index c35afbaa0407..d92862b979f2 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/ThrottleableTransport.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/ThrottleableTransport.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.transports; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java new file mode 100644 index 000000000000..342de496268d --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/Transport.java @@ -0,0 +1,44 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.inputs.transports; + +import com.codahale.metrics.MetricSet; +import org.graylog2.plugin.configuration.Configuration; +import org.graylog2.plugin.configuration.ConfigurationRequest; +import org.graylog2.plugin.inputs.MessageInput; +import org.graylog2.plugin.inputs.MisfireException; +import org.graylog2.plugin.inputs.codecs.CodecAggregator; + +public interface Transport { + + void setMessageAggregator(CodecAggregator aggregator); + + void launch(MessageInput input) throws MisfireException; + + void stop(); + + MetricSet getMetricSet(); + + public interface Config { + ConfigurationRequest getRequestedConfiguration(); + } + + interface Factory { + T create(Configuration configuration); + Config getConfig(); + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/util/KeyUtil.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/util/KeyUtil.java similarity index 86% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/util/KeyUtil.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/util/KeyUtil.java index e2bfd512fedd..73f3a8d338ca 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/transports/util/KeyUtil.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/transports/util/KeyUtil.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.transports.util; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/ConnectionCounter.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/ConnectionCounter.java similarity index 59% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/ConnectionCounter.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/ConnectionCounter.java index e44ad45980f5..eaf4d0af80ee 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/ConnectionCounter.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/ConnectionCounter.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.util; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/PacketInformationDumper.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/PacketInformationDumper.java similarity index 67% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/PacketInformationDumper.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/PacketInformationDumper.java index d883d0016ab3..d219fa2ba377 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/PacketInformationDumper.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/PacketInformationDumper.java @@ -1,25 +1,3 @@ -/** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ /** * This file is part of Graylog. * diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/ThroughputCounter.java b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/ThroughputCounter.java similarity index 58% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/ThroughputCounter.java rename to graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/ThroughputCounter.java index 946ce2bf21d8..6529520acbf1 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/inputs/util/ThroughputCounter.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/inputs/util/ThroughputCounter.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.util; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/journal/JournalMessages.java b/graylog2-server/src/main/java/org/graylog2/plugin/journal/JournalMessages.java similarity index 99% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/journal/JournalMessages.java rename to graylog2-server/src/main/java/org/graylog2/plugin/journal/JournalMessages.java index d424e097451f..afe8202fec2a 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/journal/JournalMessages.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/journal/JournalMessages.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: raw_message.proto diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/journal/RawMessage.java b/graylog2-server/src/main/java/org/graylog2/plugin/journal/RawMessage.java similarity index 89% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/journal/RawMessage.java rename to graylog2-server/src/main/java/org/graylog2/plugin/journal/RawMessage.java index 172ca5572c7d..7b1e524d248e 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/journal/RawMessage.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/journal/RawMessage.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.journal; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/lifecycles/Lifecycle.java b/graylog2-server/src/main/java/org/graylog2/plugin/lifecycles/Lifecycle.java similarity index 51% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/lifecycles/Lifecycle.java rename to graylog2-server/src/main/java/org/graylog2/plugin/lifecycles/Lifecycle.java index b2bfcef1876c..ad72007175d0 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/lifecycles/Lifecycle.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/lifecycles/Lifecycle.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.lifecycles; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java b/graylog2-server/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java new file mode 100644 index 000000000000..e97046325b06 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/lifecycles/LoadBalancerStatus.java @@ -0,0 +1,27 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.lifecycles; + +/** + * @author Lennart Koopmann + */ +public enum LoadBalancerStatus { + + DEAD, + ALIVE + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java b/graylog2-server/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java new file mode 100644 index 000000000000..883f0a4e32cf --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/messageprocessors/MessageProcessor.java @@ -0,0 +1,23 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.messageprocessors; + +import org.graylog2.plugin.Messages; + +public interface MessageProcessor { + Messages process(Messages messages); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/MessageOutput.java b/graylog2-server/src/main/java/org/graylog2/plugin/outputs/MessageOutput.java similarity index 55% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/MessageOutput.java rename to graylog2-server/src/main/java/org/graylog2/plugin/outputs/MessageOutput.java index a10b53dfdb47..a448dc47bb5a 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/outputs/MessageOutput.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/outputs/MessageOutput.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.outputs; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java b/graylog2-server/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java new file mode 100644 index 000000000000..cd72de150a42 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/outputs/MessageOutputConfigurationException.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.outputs; + +/** + * + * @author Lennart Koopmann + */ +public class MessageOutputConfigurationException extends Exception { + + /** + * Re-generate if you modify the class structure. + */ + private static final long serialVersionUID = -4252325712098060658L; + + public MessageOutputConfigurationException() { + super(); + } + + public MessageOutputConfigurationException(String msg) { + super(msg); + } + +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java b/graylog2-server/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java new file mode 100644 index 000000000000..3cef6cac3aed --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/outputs/OutputStreamConfiguration.java @@ -0,0 +1,30 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.outputs; + +import java.util.Map; +import java.util.Set; + +/** + * @author Lennart Koopmann + */ +public interface OutputStreamConfiguration { + + public void add(String streamId, Set> config); + public Set> get(String streamId); + +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/periodical/Periodical.java b/graylog2-server/src/main/java/org/graylog2/plugin/periodical/Periodical.java similarity index 60% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/periodical/Periodical.java rename to graylog2-server/src/main/java/org/graylog2/plugin/periodical/Periodical.java index bef9fc87aa4f..dd82c8713c25 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/periodical/Periodical.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/periodical/Periodical.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.periodical; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/rest/ApiError.java b/graylog2-server/src/main/java/org/graylog2/plugin/rest/ApiError.java new file mode 100644 index 000000000000..6d84c52ef02f --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/rest/ApiError.java @@ -0,0 +1,31 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.rest; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + * @author Dennis Oelkers + */ +@JsonTypeInfo(use= JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.PROPERTY, property="type") +public class ApiError { + public final String message; + + public ApiError(String message) { + this.message = message; + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java b/graylog2-server/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java new file mode 100644 index 000000000000..83b5571348f3 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/rest/PluginRestResource.java @@ -0,0 +1,25 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.rest; + +/** + * Marker interface for JAX-RS resources in plugins. + * + * @see org.graylog2.plugin.PluginModule#addRestResource(Class) + */ +public interface PluginRestResource { +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java b/graylog2-server/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java new file mode 100644 index 000000000000..fa69e4ff0402 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/rest/ValidationApiError.java @@ -0,0 +1,37 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.rest; + +import org.graylog2.plugin.database.validators.ValidationResult; + +import java.util.List; +import java.util.Map; + +/** + * @author Dennis Oelkers + */ +public class ValidationApiError extends ApiError { + private final Map> validationErrors; + public ValidationApiError(String message, Map> validationErrors) { + super(message); + this.validationErrors = validationErrors; + } + + public Map> getValidationErrors() { + return validationErrors; + } +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java b/graylog2-server/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java new file mode 100644 index 000000000000..0724c5f4cfe4 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/security/PasswordAlgorithm.java @@ -0,0 +1,25 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.security; + +public interface PasswordAlgorithm { + boolean supports(String hashedPassword); + + String hash(String password); + + boolean matches(String hashedPassword, String otherPassword); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/streams/AlertAction.java b/graylog2-server/src/main/java/org/graylog2/plugin/streams/AlertAction.java new file mode 100644 index 000000000000..021fa47be83a --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/streams/AlertAction.java @@ -0,0 +1,24 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.streams; + +/** + * @author Dennis Oelkers + */ +public interface AlertAction { + public void handle(Stream stream); +} diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/streams/Output.java b/graylog2-server/src/main/java/org/graylog2/plugin/streams/Output.java new file mode 100644 index 000000000000..a8ac6c5982cf --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/streams/Output.java @@ -0,0 +1,40 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.streams; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import org.graylog2.plugin.database.Persisted; + +import java.util.Date; +import java.util.Map; + +@JsonAutoDetect +public interface Output { + String getId(); + + String getTitle(); + + String getType(); + + String getCreatorUserId(); + + Map getConfiguration(); + + Date getCreatedAt(); + + String getContentPack(); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/Stream.java b/graylog2-server/src/main/java/org/graylog2/plugin/streams/Stream.java similarity index 52% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/Stream.java rename to graylog2-server/src/main/java/org/graylog2/plugin/streams/Stream.java index f848dded86fa..e5319ad202c7 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/Stream.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/streams/Stream.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.streams; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/streams/StreamRule.java b/graylog2-server/src/main/java/org/graylog2/plugin/streams/StreamRule.java new file mode 100644 index 000000000000..474e06846f56 --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/streams/StreamRule.java @@ -0,0 +1,51 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.streams; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import org.graylog2.plugin.database.Persisted; + +import java.util.Map; + +@JsonAutoDetect +public interface StreamRule extends Persisted { + public String getId(); + + public StreamRuleType getType(); + + public String getField(); + + public String getValue(); + + public Boolean getInverted(); + + public String getStreamId(); + + public String getContentPack(); + + public void setType(StreamRuleType type); + + public void setField(String field); + + public void setValue(String value); + + public void setInverted(Boolean inverted); + + public void setContentPack(String contentPack); + + public Map asMap(); +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/StreamRuleType.java b/graylog2-server/src/main/java/org/graylog2/plugin/streams/StreamRuleType.java similarity index 59% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/StreamRuleType.java rename to graylog2-server/src/main/java/org/graylog2/plugin/streams/StreamRuleType.java index abdc2ddf10f9..86cdcf334e34 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/streams/StreamRuleType.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/streams/StreamRuleType.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.streams; diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/system/NodeId.java b/graylog2-server/src/main/java/org/graylog2/plugin/system/NodeId.java similarity index 69% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/system/NodeId.java rename to graylog2-server/src/main/java/org/graylog2/plugin/system/NodeId.java index 21a520703515..a94dce2db66c 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/system/NodeId.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/system/NodeId.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.system; diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java b/graylog2-server/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java new file mode 100644 index 000000000000..1d59510f1e7e --- /dev/null +++ b/graylog2-server/src/main/java/org/graylog2/plugin/system/NodeIdPersistenceException.java @@ -0,0 +1,38 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.system; + +/** + * Created by dennis on 11/12/14. + */ +public class NodeIdPersistenceException extends RuntimeException { + public NodeIdPersistenceException() { + super(); + } + + public NodeIdPersistenceException(String message) { + super(message); + } + + public NodeIdPersistenceException(String message, Throwable cause) { + super(message, cause); + } + + public NodeIdPersistenceException(Throwable cause) { + super(cause); + } +} diff --git a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/utilities/date/NaturalDateParser.java b/graylog2-server/src/main/java/org/graylog2/plugin/utilities/date/NaturalDateParser.java similarity index 67% rename from graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/utilities/date/NaturalDateParser.java rename to graylog2-server/src/main/java/org/graylog2/plugin/utilities/date/NaturalDateParser.java index b976b91b28fb..b30059a5a515 100644 --- a/graylog2-plugin-interfaces/src/main/java/org/graylog2/plugin/utilities/date/NaturalDateParser.java +++ b/graylog2-server/src/main/java/org/graylog2/plugin/utilities/date/NaturalDateParser.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.utilities.date; diff --git a/graylog2-plugin-interfaces/src/main/resources/org/graylog2/plugin/journal/raw_message.proto b/graylog2-server/src/main/resources/org/graylog2/plugin/journal/raw_message.proto similarity index 100% rename from graylog2-plugin-interfaces/src/main/resources/org/graylog2/plugin/journal/raw_message.proto rename to graylog2-server/src/main/resources/org/graylog2/plugin/journal/raw_message.proto diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/BaseConfigurationTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/BaseConfigurationTest.java similarity index 81% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/BaseConfigurationTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/BaseConfigurationTest.java index 9fda3800dfac..f7d08305c82b 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/BaseConfigurationTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/BaseConfigurationTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/MessageSummaryTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java similarity index 73% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/MessageSummaryTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java index de41f7fa9aae..be57bc94b7c5 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/MessageSummaryTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/MessageSummaryTest.java @@ -1,26 +1,19 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ - package org.graylog2.plugin; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/MessageTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/MessageTest.java similarity index 92% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/MessageTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/MessageTest.java index 1453892ee74c..206db725f3d1 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/MessageTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/MessageTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ResolvableInetSocketAddressTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/ResolvableInetSocketAddressTest.java similarity index 80% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ResolvableInetSocketAddressTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/ResolvableInetSocketAddressTest.java index 2a7e29f48749..a2ee4d71c24c 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ResolvableInetSocketAddressTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/ResolvableInetSocketAddressTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ServerStatusTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/ServerStatusTest.java similarity index 86% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ServerStatusTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/ServerStatusTest.java index f41cb8343c74..2592a46d2909 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/ServerStatusTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/ServerStatusTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-server/src/test/java/org/graylog2/plugin/ToolsTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/ToolsTest.java new file mode 100644 index 000000000000..e577c5a9a6cb --- /dev/null +++ b/graylog2-server/src/test/java/org/graylog2/plugin/ToolsTest.java @@ -0,0 +1,42 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin; + +import org.junit.Test; + +import java.net.URI; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +public class ToolsTest { + + @Test + public void testGetUriWithPort() throws Exception { + final URI uriWithPort = new URI("http://example.com:12345"); + final URI uriWithoutPort = new URI("http://example.com"); + + assertEquals(Tools.getUriWithPort(uriWithPort, 1).getPort(), 12345); + assertEquals(Tools.getUriWithPort(uriWithoutPort, 1).getPort(), 1); + } + + @Test + public void testGetUriWithScheme() throws Exception { + assertEquals(Tools.getUriWithScheme(new URI("http://example.com"), "gopher").getScheme(), "gopher"); + assertNull(Tools.getUriWithScheme(new URI("http://example.com"), null).getScheme()); + } +} diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/VersionTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/VersionTest.java similarity index 87% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/VersionTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/VersionTest.java index 45df32e1ced4..6c2fc53ed6c4 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/VersionTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/VersionTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/ConfigurationRequestTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/ConfigurationRequestTest.java similarity index 64% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/ConfigurationRequestTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/configuration/ConfigurationRequestTest.java index f6e6df700187..2eeeca4469f9 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/ConfigurationRequestTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/ConfigurationRequestTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/ConfigurationTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/ConfigurationTest.java similarity index 54% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/ConfigurationTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/configuration/ConfigurationTest.java index ed135f5eb266..9880af5562ed 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/ConfigurationTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/ConfigurationTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/BooleanFieldTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/BooleanFieldTest.java similarity index 61% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/BooleanFieldTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/BooleanFieldTest.java index 17025c941f46..9e05efe4dcb7 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/BooleanFieldTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/BooleanFieldTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/DropdownFieldTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/DropdownFieldTest.java similarity index 69% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/DropdownFieldTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/DropdownFieldTest.java index 9e71fad0dfc2..57092a0cc115 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/DropdownFieldTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/DropdownFieldTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/NumberFieldTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/NumberFieldTest.java similarity index 70% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/NumberFieldTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/NumberFieldTest.java index cc4a42bd3475..4827ebcfeb20 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/NumberFieldTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/NumberFieldTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/TextFieldTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/TextFieldTest.java similarity index 66% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/TextFieldTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/TextFieldTest.java index 77f7bf95eb08..9f3b695575a8 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/configuration/fields/TextFieldTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/configuration/fields/TextFieldTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.configuration.fields; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/ExtractorTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/inputs/ExtractorTest.java similarity index 97% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/ExtractorTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/inputs/ExtractorTest.java index bbcd33b8eac8..213a67eb72da 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/ExtractorTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/inputs/ExtractorTest.java @@ -1,26 +1,19 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ - package org.graylog2.plugin.inputs; import com.codahale.metrics.MetricRegistry; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/IOStateTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/inputs/IOStateTest.java similarity index 63% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/IOStateTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/inputs/IOStateTest.java index a1a67555c0ad..f7915b512a00 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/IOStateTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/inputs/IOStateTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/transports/util/KeyUtilTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/inputs/transports/util/KeyUtilTest.java similarity index 78% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/transports/util/KeyUtilTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/inputs/transports/util/KeyUtilTest.java index dafb7c7b0556..e024ab4969be 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/inputs/transports/util/KeyUtilTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/inputs/transports/util/KeyUtilTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.inputs.transports.util; diff --git a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/journal/RawMessageTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/journal/RawMessageTest.java similarity index 51% rename from graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/journal/RawMessageTest.java rename to graylog2-server/src/test/java/org/graylog2/plugin/journal/RawMessageTest.java index 33ae3006b2a5..47f8954ec1a9 100644 --- a/graylog2-plugin-interfaces/src/test/java/org/graylog2/plugin/journal/RawMessageTest.java +++ b/graylog2-server/src/test/java/org/graylog2/plugin/journal/RawMessageTest.java @@ -1,24 +1,18 @@ /** - * The MIT License - * Copyright (c) 2012 Graylog, Inc. + * This file is part of Graylog. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . */ package org.graylog2.plugin.journal; diff --git a/graylog2-server/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java b/graylog2-server/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java new file mode 100644 index 000000000000..ce3249accfc1 --- /dev/null +++ b/graylog2-server/src/test/java/org/graylog2/plugin/streams/MatchingTypeTest.java @@ -0,0 +1,37 @@ +/** + * This file is part of Graylog. + * + * Graylog is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Graylog is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Graylog. If not, see . + */ +package org.graylog2.plugin.streams; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class MatchingTypeTest { + + @Test + public void testValueOfOrDefault() throws Exception { + assertEquals(Stream.MatchingType.valueOfOrDefault("AND"), Stream.MatchingType.AND); + assertEquals(Stream.MatchingType.valueOfOrDefault("OR"), Stream.MatchingType.OR); + assertEquals(Stream.MatchingType.valueOfOrDefault(null), Stream.MatchingType.DEFAULT); + assertEquals(Stream.MatchingType.valueOfOrDefault(""), Stream.MatchingType.DEFAULT); + } + + @Test(expected = IllegalArgumentException.class) + public void testValueOfOrDefaultThrowsExceptionForUnknownEnumName() { + Stream.MatchingType.valueOfOrDefault("FOO"); + } +} \ No newline at end of file diff --git a/graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/dir/server.crt b/graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/dir/server.crt similarity index 100% rename from graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/dir/server.crt rename to graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/dir/server.crt diff --git a/graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.crt b/graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.crt similarity index 100% rename from graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.crt rename to graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.crt diff --git a/graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.e.pkcs8 b/graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.e.pkcs8 similarity index 100% rename from graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.e.pkcs8 rename to graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.e.pkcs8 diff --git a/graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.ue.pkcs8 b/graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.ue.pkcs8 similarity index 100% rename from graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.ue.pkcs8 rename to graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.der.ue.pkcs8 diff --git a/graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.e.pkcs8 b/graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.e.pkcs8 similarity index 100% rename from graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.e.pkcs8 rename to graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.e.pkcs8 diff --git a/graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs1 b/graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs1 similarity index 100% rename from graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs1 rename to graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs1 diff --git a/graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs8 b/graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs8 similarity index 100% rename from graylog2-plugin-interfaces/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs8 rename to graylog2-server/src/test/resources/org/graylog2/plugin/inputs/transports/util/server.key.pem.ue.pkcs8 diff --git a/pom.xml b/pom.xml index cbd64382d643..a4040ecf1223 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,6 @@ - graylog2-plugin-interfaces graylog2-server integration-tests @@ -156,11 +155,6 @@ --> - - org.graylog2 - graylog2-plugin - ${project.version} - org.graylog2 graylog2-server