value) throws ProcessorException;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/processors/UnstackException.java:
--------------------------------------------------------------------------------
1 | package loghub.processors;
2 |
3 | import loghub.Processor;
4 | import loghub.events.Event;
5 |
6 | public class UnstackException extends Processor {
7 |
8 | @Override
9 | public boolean process(Event event) {
10 | event.popException();
11 | return true;
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/processors/UnwrapEvent.java:
--------------------------------------------------------------------------------
1 | package loghub.processors;
2 |
3 | public class UnwrapEvent extends Identity {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/processors/WrapEvent.java:
--------------------------------------------------------------------------------
1 | package loghub.processors;
2 |
3 | import loghub.VariablePath;
4 |
5 | public class WrapEvent extends Identity {
6 |
7 | public WrapEvent(VariablePath collectionPath) {
8 | this.setPathArray(collectionPath);
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/receivers/Blocking.java:
--------------------------------------------------------------------------------
1 | package loghub.receivers;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Inherited;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.Target;
7 |
8 | import static java.lang.annotation.ElementType.TYPE;
9 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
10 |
11 | /**
12 | * An annotation that's used to indicate that the receiver should block if
13 | * the destination queue is full, instead of dropping the event. It's too be used for
14 | * receiver that read from an already buffered source like Kafka or a followed file.
15 | *
16 | * When just given, it defaults to block. But it can also be given a value that will reverse it's comportement
17 | *
18 | * @author Fabrice Bacchella
19 | *
20 | */
21 | @Documented
22 | @Retention(RUNTIME)
23 | @Target(TYPE)
24 | @Inherited
25 | public @interface Blocking {
26 | boolean value() default true;
27 | }
28 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/receivers/SelfDecoder.java:
--------------------------------------------------------------------------------
1 | package loghub.receivers;
2 |
3 | import java.lang.annotation.Inherited;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.TYPE;
8 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
9 |
10 | @Retention(RUNTIME)
11 | @Target(TYPE)
12 | @Inherited
13 | public @interface SelfDecoder {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/receivers/TcpLinesStream.java:
--------------------------------------------------------------------------------
1 | package loghub.receivers;
2 |
3 | import loghub.BuilderClass;
4 | import loghub.Helpers;
5 | import loghub.decoders.StringCodec;
6 |
7 | @BuilderClass(TcpLinesStream.Builder.class)
8 | public class TcpLinesStream extends AbstractNettyStream {
9 |
10 | public static class Builder extends AbstractNettyStream.Builder {
11 | public Builder() {
12 | super();
13 | // A ready to use TcpLinesStream: single line text message.
14 | StringCodec.Builder sbuilder = new StringCodec.Builder();
15 | setDecoder(sbuilder.build());
16 | }
17 | @Override
18 | public TcpLinesStream build() {
19 | return new TcpLinesStream(this);
20 | }
21 | }
22 | public static Builder getBuilder() {
23 | return new Builder();
24 | }
25 |
26 | private TcpLinesStream(Builder builder) {
27 | super(builder);
28 | }
29 |
30 | @Override
31 | protected String getThreadPrefix(Builder builder) {
32 | return "LineReceiver";
33 | }
34 |
35 | @Override
36 | public String getReceiverName() {
37 | return "LineReceiver/" + Helpers.ListenString(getListen()) + "/" + getPort();
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/security/ssl/ClientAuthentication.java:
--------------------------------------------------------------------------------
1 | package loghub.security.ssl;
2 |
3 | import javax.net.ssl.SSLEngine;
4 |
5 | public enum ClientAuthentication {
6 | REQUIRED {
7 | @Override
8 | public void configureEngine(SSLEngine engine) {
9 | engine.setNeedClientAuth(true);
10 | }
11 | },
12 | WANTED {
13 | @Override
14 | public void configureEngine(SSLEngine engine) {
15 | engine.setWantClientAuth(true);
16 | }
17 | },
18 | NOTNEEDED {
19 | @Override
20 | public void configureEngine(SSLEngine engine) {
21 | engine.setNeedClientAuth(false);
22 | engine.setWantClientAuth(false);
23 | }
24 | },
25 | NONE {
26 | @Override
27 | public void configureEngine(SSLEngine engine) {
28 | // No TLS configured
29 | }
30 | };
31 | public abstract void configureEngine(SSLEngine engine);
32 | }
33 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/senders/AsyncSender.java:
--------------------------------------------------------------------------------
1 | package loghub.senders;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Inherited;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.Target;
7 |
8 | import static java.lang.annotation.ElementType.TYPE;
9 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
10 |
11 | @Documented
12 | @Retention(RUNTIME)
13 | @Target(TYPE)
14 | @Inherited
15 | public @interface AsyncSender {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/senders/SelfEncoder.java:
--------------------------------------------------------------------------------
1 | package loghub.senders;
2 |
3 | import java.lang.annotation.Inherited;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.Target;
6 |
7 | import static java.lang.annotation.ElementType.TYPE;
8 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
9 |
10 | @Retention(RUNTIME)
11 | @Target(TYPE)
12 | @Inherited
13 | public @interface SelfEncoder {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/senders/SendException.java:
--------------------------------------------------------------------------------
1 | package loghub.senders;
2 |
3 | public class SendException extends Exception {
4 |
5 | public SendException(Throwable cause) {
6 | super(cause);
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/loghub-core/src/main/java/loghub/sources/Source.java:
--------------------------------------------------------------------------------
1 | package loghub.sources;
2 |
3 | import java.util.Map;
4 |
5 | import loghub.configuration.Properties;
6 |
7 | public interface Source extends Map