diff options
Diffstat (limited to 'vespa-feed-client/src/main')
6 files changed, 116 insertions, 0 deletions
diff --git a/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClient.java b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClient.java new file mode 100644 index 00000000000..af652401044 --- /dev/null +++ b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClient.java @@ -0,0 +1,18 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.feed.client; + +import java.util.concurrent.Future; + +/** + * @author bjorncs + */ +public interface FeedClient { + Future<Result> put(String documentId, String documentJson, OperationParameters params, ResultCallback callback); + Future<Result> remove(String documentId, OperationParameters params, ResultCallback callback); + Future<Result> update(String documentId, String documentJson, OperationParameters params, ResultCallback callback); + + interface ResultCallback { + void completed(Result result); + void failed(FeedException e); + } +} diff --git a/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClientBuilder.java b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClientBuilder.java new file mode 100644 index 00000000000..338c97b04ad --- /dev/null +++ b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClientBuilder.java @@ -0,0 +1,14 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.feed.client; + +/** + * @author bjorncs + */ +public class FeedClientBuilder { + + public static FeedClientBuilder create() { return new FeedClientBuilder(); } + + private FeedClientBuilder() {} + + public FeedClient build() { return new FeedClientImpl(this); } +} diff --git a/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClientImpl.java b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClientImpl.java new file mode 100644 index 00000000000..bfe845aee66 --- /dev/null +++ b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedClientImpl.java @@ -0,0 +1,29 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.feed.client; + +import java.util.concurrent.Future; + +/** + * @author bjorncs + */ +class FeedClientImpl implements FeedClient { + + FeedClientImpl(FeedClientBuilder builder) { + + } + + @Override + public Future<Result> put(String documentId, String documentJson, OperationParameters params, ResultCallback callback) { + return null; + } + + @Override + public Future<Result> remove(String documentId, OperationParameters params, ResultCallback callback) { + return null; + } + + @Override + public Future<Result> update(String documentId, String documentJson, OperationParameters params, ResultCallback callback) { + return null; + } +} diff --git a/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedException.java b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedException.java new file mode 100644 index 00000000000..d3de5e0cbe1 --- /dev/null +++ b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/FeedException.java @@ -0,0 +1,8 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.feed.client; + +/** + * @author bjorncs + */ +public class FeedException extends RuntimeException { +} diff --git a/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/OperationParameters.java b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/OperationParameters.java new file mode 100644 index 00000000000..4b323ed5a68 --- /dev/null +++ b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/OperationParameters.java @@ -0,0 +1,28 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.feed.client; + +import java.time.Duration; +import java.util.Optional; + +/** + * @author bjorncs + */ +public class OperationParameters { + + public static Builder builder() { return new Builder(); } + + private OperationParameters(Builder builder) { + + } + + public Optional<String> documentCondition() { return Optional.empty(); } + public Optional<Duration> operationTimeout() { return Optional.empty(); } + + public static class Builder { + + private Builder() {} + + public OperationParameters build() { return new OperationParameters(this); } + + } +} diff --git a/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/Result.java b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/Result.java new file mode 100644 index 00000000000..3a3f695ca2b --- /dev/null +++ b/vespa-feed-client/src/main/java/com/yahoo/vespa/feed/client/Result.java @@ -0,0 +1,19 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.feed.client; + +import java.util.Optional; + +/** + * @author bjorncs + */ +public class Result { + + public enum Type { + + } + + public Type type() { return null; } + public String documentId() { return null; } + public String resultMessage() { return null; } + public Optional<String> traceMessage() { return Optional.empty(); } +} |