diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml new file mode 100644 index 0000000..7d97b7f --- /dev/null +++ b/.github/workflows/checkstyle.yml @@ -0,0 +1,18 @@ +name: checkstyle + +on: + workflow_dispatch: + pull_request: + branches: [ main ] + +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '17' + - name: Run Checkstyle + run: ./gradlew checkstyleMain checkstyleTest diff --git a/build.gradle.kts b/build.gradle.kts index 2a4fc48..968b3cf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,6 +3,7 @@ plugins { `java-library` `maven-publish` signing + checkstyle id("com.vanniktech.maven.publish") version "0.36.0" } diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000..f56d17b --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml new file mode 100644 index 0000000..6a89b01 --- /dev/null +++ b/config/checkstyle/suppressions.xml @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/src/main/java/org/eclipse/dataplane/Dataplane.java b/src/main/java/org/eclipse/dataplane/Dataplane.java index 8a43a7c..4ffa6ea 100644 --- a/src/main/java/org/eclipse/dataplane/Dataplane.java +++ b/src/main/java/org/eclipse/dataplane/Dataplane.java @@ -58,12 +58,12 @@ public class Dataplane { private final Set transferTypes = new HashSet<>(); private final Set labels = new HashSet<>(); - private OnPrepare onPrepare = _m -> Result.failure(new UnsupportedOperationException("onPrepare is not implemented")); - private OnStart onStart = _m -> Result.failure(new UnsupportedOperationException("onStart is not implemented")); - private OnTerminate onTerminate = _m -> Result.failure(new UnsupportedOperationException("onTerminate is not implemented")); - private OnSuspend onSuspend = _m -> Result.failure(new UnsupportedOperationException("onSuspend is not implemented")); - private OnStarted onStarted = _m -> Result.failure(new UnsupportedOperationException("onStarted is not implemented"));; - private OnCompleted onCompleted = _m -> Result.failure(new UnsupportedOperationException("onCompleted is not implemented")); + private OnPrepare onPrepare = dataFlow -> Result.failure(new UnsupportedOperationException("onPrepare is not implemented")); + private OnStart onStart = dataFlow -> Result.failure(new UnsupportedOperationException("onStart is not implemented")); + private OnTerminate onTerminate = dataFlow -> Result.failure(new UnsupportedOperationException("onTerminate is not implemented")); + private OnSuspend onSuspend = dataFlow -> Result.failure(new UnsupportedOperationException("onSuspend is not implemented")); + private OnStarted onStarted = dataFlow -> Result.failure(new UnsupportedOperationException("onStarted is not implemented")); + private OnCompleted onCompleted = dataFlow -> Result.failure(new UnsupportedOperationException("onCompleted is not implemented")); private final HttpClient httpClient = HttpClient.newHttpClient(); private final ObjectMapper objectMapper = new ObjectMapper(); @@ -173,7 +173,7 @@ public Result terminate(String dataFlowId, DataFlowTerminateMessage messag /** * Notify the control plane that the data flow has been completed. * - * @param dataFlowId + * @param dataFlowId id of the data flow */ public Result notifyCompleted(String dataFlowId) { return store.findById(dataFlowId) @@ -201,8 +201,8 @@ public Result notifyCompleted(String dataFlowId) { /** * Notify the control plane that the data flow failed for some reason * - * @param dataFlowId - * @param throwable + * @param dataFlowId id of the data flow + * @param throwable the error */ public Result notifyErrored(String dataFlowId, Throwable throwable) { return store.findById(dataFlowId) @@ -243,8 +243,8 @@ public Result started(String flowId, DataFlowStartedNotificationMessage st /** * Received notification that the flow has been completed * - * @param flowId - * @return + * @param flowId id of the data flow + * @return result indicating whether data flow was completed successfully */ public Result completed(String flowId) { return store.findById(flowId).compose(onCompleted::action) diff --git a/src/main/java/org/eclipse/dataplane/domain/DataAddress.java b/src/main/java/org/eclipse/dataplane/domain/DataAddress.java index 10de174..073f040 100644 --- a/src/main/java/org/eclipse/dataplane/domain/DataAddress.java +++ b/src/main/java/org/eclipse/dataplane/domain/DataAddress.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,10 +29,10 @@ public DataAddress(String endpointType, String endpoint, List this("DataAddress", endpointType, endpoint, endpointProperties); } - public record EndpointProperty ( - String type, - String name, - String value + public record EndpointProperty( + String type, + String name, + String value ) { } diff --git a/src/main/java/org/eclipse/dataplane/domain/Result.java b/src/main/java/org/eclipse/dataplane/domain/Result.java index 6d25911..5b218ef 100644 --- a/src/main/java/org/eclipse/dataplane/domain/Result.java +++ b/src/main/java/org/eclipse/dataplane/domain/Result.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain; import java.util.NoSuchElementException; @@ -13,13 +27,15 @@ public static Result success(C content) { return new Success<>(content); } - public static Result failure(Exception e){ return new Failure<>(e); } + public static Result failure(Exception e) { + return new Failure<>(e); + } public static Result attempt(ExceptionThrowingSupplier resultSupplier) { try { var resultValue = resultSupplier.get(); return Result.success(resultValue); - } catch (Exception exception){ + } catch (Exception exception) { return Result.failure(exception); } } @@ -32,7 +48,7 @@ public static Result attempt(ExceptionThrowingSupplier resultSupplier) public abstract C orElseThrow(Function exceptionSupplier) throws X; - public abstract Result map(ExceptionThrowingFunction transformValue); + public abstract Result map(ExceptionThrowingFunction transformValue); public abstract Result compose(ExceptionThrowingFunction> transformValue); @@ -48,7 +64,7 @@ private static class Success extends Result { private final C content; - public Success(C content) { + Success(C content) { this.content = content; } @@ -81,7 +97,7 @@ public Result map(ExceptionThrowingFunction transformValue) { public Result compose(ExceptionThrowingFunction> transformValue) { try { return transformValue.apply(this.content); - } catch(Exception e) { + } catch (Exception e) { return Result.failure(e); } } @@ -90,6 +106,7 @@ public Result compose(ExceptionThrowingFunction> transformVa private static class Failure extends Result { private final Exception exception; + private Failure(Exception exception) { this.exception = exception; } @@ -126,7 +143,7 @@ public Result compose(ExceptionThrowingFunction> transformVa } @FunctionalInterface - public interface ExceptionThrowingFunction { + public interface ExceptionThrowingFunction { R apply(T t) throws Exception; } diff --git a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowPrepareMessage.java b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowPrepareMessage.java index 0f2164f..dad3244 100644 --- a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowPrepareMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowPrepareMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.dataflow; import java.util.List; diff --git a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowResponseMessage.java b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowResponseMessage.java index 6101fa4..f9ced83 100644 --- a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowResponseMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowResponseMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.dataflow; import org.eclipse.dataplane.domain.DataAddress; diff --git a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartMessage.java b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartMessage.java index 524ca6e..a156ec1 100644 --- a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.dataflow; import org.eclipse.dataplane.domain.DataAddress; diff --git a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartedNotificationMessage.java b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartedNotificationMessage.java index 6075365..7fadb04 100644 --- a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartedNotificationMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStartedNotificationMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.dataflow; import org.eclipse.dataplane.domain.DataAddress; diff --git a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStatusResponseMessage.java b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStatusResponseMessage.java index 8c83551..851e946 100644 --- a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStatusResponseMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowStatusResponseMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.dataflow; public record DataFlowStatusResponseMessage( diff --git a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowSuspendMessage.java b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowSuspendMessage.java index 9cc6353..a8d372e 100644 --- a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowSuspendMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowSuspendMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.dataflow; public record DataFlowSuspendMessage( diff --git a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowTerminateMessage.java b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowTerminateMessage.java index e7053be..fffb46c 100644 --- a/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowTerminateMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/dataflow/DataFlowTerminateMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.dataflow; public record DataFlowTerminateMessage( diff --git a/src/main/java/org/eclipse/dataplane/domain/registration/DataPlaneRegistrationMessage.java b/src/main/java/org/eclipse/dataplane/domain/registration/DataPlaneRegistrationMessage.java index 362d9f6..b4f72d5 100644 --- a/src/main/java/org/eclipse/dataplane/domain/registration/DataPlaneRegistrationMessage.java +++ b/src/main/java/org/eclipse/dataplane/domain/registration/DataPlaneRegistrationMessage.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.domain.registration; import java.util.Set; @@ -9,6 +23,6 @@ public record DataPlaneRegistrationMessage( String endpoint, Set transferTypes, Set labels - // TODO: authorization +// TODO: authorization ) { } diff --git a/src/main/java/org/eclipse/dataplane/logic/OnCompleted.java b/src/main/java/org/eclipse/dataplane/logic/OnCompleted.java index 5c459aa..1c7516b 100644 --- a/src/main/java/org/eclipse/dataplane/logic/OnCompleted.java +++ b/src/main/java/org/eclipse/dataplane/logic/OnCompleted.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.logic; import org.eclipse.dataplane.domain.Result; diff --git a/src/main/java/org/eclipse/dataplane/logic/OnPrepare.java b/src/main/java/org/eclipse/dataplane/logic/OnPrepare.java index 65b4b59..429edfe 100644 --- a/src/main/java/org/eclipse/dataplane/logic/OnPrepare.java +++ b/src/main/java/org/eclipse/dataplane/logic/OnPrepare.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.logic; import org.eclipse.dataplane.domain.Result; diff --git a/src/main/java/org/eclipse/dataplane/logic/OnStart.java b/src/main/java/org/eclipse/dataplane/logic/OnStart.java index 3d0753c..c716c0a 100644 --- a/src/main/java/org/eclipse/dataplane/logic/OnStart.java +++ b/src/main/java/org/eclipse/dataplane/logic/OnStart.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.logic; import org.eclipse.dataplane.domain.Result; diff --git a/src/main/java/org/eclipse/dataplane/logic/OnStarted.java b/src/main/java/org/eclipse/dataplane/logic/OnStarted.java index e13f305..c1a0cd0 100644 --- a/src/main/java/org/eclipse/dataplane/logic/OnStarted.java +++ b/src/main/java/org/eclipse/dataplane/logic/OnStarted.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.logic; import org.eclipse.dataplane.domain.Result; diff --git a/src/main/java/org/eclipse/dataplane/logic/OnSuspend.java b/src/main/java/org/eclipse/dataplane/logic/OnSuspend.java index 9704ebf..0187b21 100644 --- a/src/main/java/org/eclipse/dataplane/logic/OnSuspend.java +++ b/src/main/java/org/eclipse/dataplane/logic/OnSuspend.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.logic; import org.eclipse.dataplane.domain.Result; diff --git a/src/main/java/org/eclipse/dataplane/logic/OnTerminate.java b/src/main/java/org/eclipse/dataplane/logic/OnTerminate.java index 1a8cdf3..c522bbb 100644 --- a/src/main/java/org/eclipse/dataplane/logic/OnTerminate.java +++ b/src/main/java/org/eclipse/dataplane/logic/OnTerminate.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.logic; import org.eclipse.dataplane.domain.Result; diff --git a/src/main/java/org/eclipse/dataplane/port/DataPlaneSignalingApiController.java b/src/main/java/org/eclipse/dataplane/port/DataPlaneSignalingApiController.java index 505b7dc..954f574 100644 --- a/src/main/java/org/eclipse/dataplane/port/DataPlaneSignalingApiController.java +++ b/src/main/java/org/eclipse/dataplane/port/DataPlaneSignalingApiController.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.port; import jakarta.ws.rs.Consumes; diff --git a/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotFoundException.java b/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotFoundException.java index ec0e260..eb989c7 100644 --- a/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotFoundException.java +++ b/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotFoundException.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.port.exception; public class DataFlowNotFoundException extends Exception { diff --git a/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyCompletedFailed.java b/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyCompletedFailed.java index d15aad3..5f9e43d 100644 --- a/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyCompletedFailed.java +++ b/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyCompletedFailed.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.port.exception; import java.net.http.HttpResponse; diff --git a/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyErroredFailed.java b/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyErroredFailed.java index ca7546b..5d243f8 100644 --- a/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyErroredFailed.java +++ b/src/main/java/org/eclipse/dataplane/port/exception/DataFlowNotifyErroredFailed.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.port.exception; import java.net.http.HttpResponse; diff --git a/src/main/java/org/eclipse/dataplane/port/exception/DataplaneNotRegistered.java b/src/main/java/org/eclipse/dataplane/port/exception/DataplaneNotRegistered.java index ac92967..b3d7abc 100644 --- a/src/main/java/org/eclipse/dataplane/port/exception/DataplaneNotRegistered.java +++ b/src/main/java/org/eclipse/dataplane/port/exception/DataplaneNotRegistered.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.port.exception; public class DataplaneNotRegistered extends RuntimeException { diff --git a/src/main/java/org/eclipse/dataplane/port/store/DataFlowStore.java b/src/main/java/org/eclipse/dataplane/port/store/DataFlowStore.java index 2b7ee7d..71a4604 100644 --- a/src/main/java/org/eclipse/dataplane/port/store/DataFlowStore.java +++ b/src/main/java/org/eclipse/dataplane/port/store/DataFlowStore.java @@ -1,7 +1,21 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.port.store; -import org.eclipse.dataplane.domain.dataflow.DataFlow; import org.eclipse.dataplane.domain.Result; +import org.eclipse.dataplane.domain.dataflow.DataFlow; public interface DataFlowStore { Result save(DataFlow dataFlow); diff --git a/src/main/java/org/eclipse/dataplane/port/store/InMemoryDataFlowStore.java b/src/main/java/org/eclipse/dataplane/port/store/InMemoryDataFlowStore.java index 71770d7..42f507f 100644 --- a/src/main/java/org/eclipse/dataplane/port/store/InMemoryDataFlowStore.java +++ b/src/main/java/org/eclipse/dataplane/port/store/InMemoryDataFlowStore.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.port.store; import org.eclipse.dataplane.domain.Result; diff --git a/src/test/java/org/eclipse/dataplane/ControlPlane.java b/src/test/java/org/eclipse/dataplane/ControlPlane.java index d3e6e19..4b43683 100644 --- a/src/test/java/org/eclipse/dataplane/ControlPlane.java +++ b/src/test/java/org/eclipse/dataplane/ControlPlane.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane; import io.restassured.response.ValidatableResponse; diff --git a/src/test/java/org/eclipse/dataplane/DataplaneClient.java b/src/test/java/org/eclipse/dataplane/DataplaneClient.java index 78b69fe..07a9600 100644 --- a/src/test/java/org/eclipse/dataplane/DataplaneClient.java +++ b/src/test/java/org/eclipse/dataplane/DataplaneClient.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane; import io.restassured.http.ContentType; diff --git a/src/test/java/org/eclipse/dataplane/DataplaneTest.java b/src/test/java/org/eclipse/dataplane/DataplaneTest.java index 2740e4d..09faa33 100644 --- a/src/test/java/org/eclipse/dataplane/DataplaneTest.java +++ b/src/test/java/org/eclipse/dataplane/DataplaneTest.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane; import com.github.tomakehurst.wiremock.WireMockServer; diff --git a/src/test/java/org/eclipse/dataplane/HttpServer.java b/src/test/java/org/eclipse/dataplane/HttpServer.java index af81aa7..5c0c575 100644 --- a/src/test/java/org/eclipse/dataplane/HttpServer.java +++ b/src/test/java/org/eclipse/dataplane/HttpServer.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane; import org.eclipse.jetty.ee10.servlet.ServletContextHandler; diff --git a/src/test/java/org/eclipse/dataplane/scenario/ConsumerPullTest.java b/src/test/java/org/eclipse/dataplane/scenario/ConsumerPullTest.java index 85dad0d..ca0f68f 100644 --- a/src/test/java/org/eclipse/dataplane/scenario/ConsumerPullTest.java +++ b/src/test/java/org/eclipse/dataplane/scenario/ConsumerPullTest.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.scenario; import org.eclipse.dataplane.ControlPlane; @@ -28,7 +42,7 @@ import static org.eclipse.dataplane.domain.dataflow.DataFlow.State.PREPARED; import static org.eclipse.dataplane.domain.dataflow.DataFlow.State.STARTED; -public class ConsumerPullTest { +class ConsumerPullTest { private final HttpServer httpServer = new HttpServer(21341); private final int filesAvailableOnProvider = 13; @@ -82,7 +96,7 @@ private class ConsumerDataPlane { private final Path storage; - public ConsumerDataPlane() { + ConsumerDataPlane() { try { storage = Files.createTempDirectory("consumer-storage"); } catch (IOException e) { @@ -122,7 +136,7 @@ private class ProviderDataPlane { .build(); private final int filesToBeCreated; - public ProviderDataPlane(int fileToBeCreated) { + ProviderDataPlane(int fileToBeCreated) { this.filesToBeCreated = fileToBeCreated; } diff --git a/src/test/java/org/eclipse/dataplane/scenario/ProviderPushTest.java b/src/test/java/org/eclipse/dataplane/scenario/ProviderPushTest.java index f6808f4..bc01d8c 100644 --- a/src/test/java/org/eclipse/dataplane/scenario/ProviderPushTest.java +++ b/src/test/java/org/eclipse/dataplane/scenario/ProviderPushTest.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.scenario; import org.eclipse.dataplane.ControlPlane; @@ -139,7 +153,7 @@ private Result onStart(DataFlow dataFlow) { } }, executor); - future.whenComplete((_v, throwable) -> { + future.whenComplete((completed, throwable) -> { if (throwable == null) { sdk.notifyCompleted(dataFlow.getId()); } else { diff --git a/src/test/java/org/eclipse/dataplane/scenario/StreamingPullTest.java b/src/test/java/org/eclipse/dataplane/scenario/StreamingPullTest.java index b0e5eac..c5d3d6f 100644 --- a/src/test/java/org/eclipse/dataplane/scenario/StreamingPullTest.java +++ b/src/test/java/org/eclipse/dataplane/scenario/StreamingPullTest.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.scenario; import org.eclipse.dataplane.ControlPlane; @@ -36,7 +50,7 @@ import static org.eclipse.dataplane.domain.dataflow.DataFlow.State.PREPARED; import static org.eclipse.dataplane.domain.dataflow.DataFlow.State.STARTED; -public class StreamingPullTest { +class StreamingPullTest { private final HttpServer httpServer = new HttpServer(21341); @@ -133,7 +147,7 @@ private static class ConsumerDataPlane { private final Path storage; private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); - public ConsumerDataPlane() { + ConsumerDataPlane() { try { storage = Files.createTempDirectory("consumer-storage"); } catch (IOException e) { @@ -200,7 +214,7 @@ private static class ProviderDataPlane { private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(5); private final Map> flows = new HashMap<>(); - public ProviderDataPlane() { + ProviderDataPlane() { } public Object controller() { diff --git a/src/test/java/org/eclipse/dataplane/scenario/StreamingPushTest.java b/src/test/java/org/eclipse/dataplane/scenario/StreamingPushTest.java index 5754921..90974fd 100644 --- a/src/test/java/org/eclipse/dataplane/scenario/StreamingPushTest.java +++ b/src/test/java/org/eclipse/dataplane/scenario/StreamingPushTest.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Think-it GmbH + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Think-it GmbH - initial API and implementation + * + */ + package org.eclipse.dataplane.scenario; import org.eclipse.dataplane.ControlPlane;