-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #517 from catenax-ng/feat/orchestrator_service_logic
Orchestrator: Service logic
- Loading branch information
Showing
19 changed files
with
1,088 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...tor/src/main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/config/TaskConfigProperties.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* 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. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.config | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties | ||
import java.time.Duration | ||
|
||
@ConfigurationProperties(prefix = "bpdm.task") | ||
data class TaskConfigProperties( | ||
// Duration after which a task is removed from the Orchestrator after creation | ||
val taskTimeout: Duration = Duration.ofHours(3 * 24), | ||
// Duration for which a reservation is valid and results are accepted | ||
val taskReservationTimeout: Duration = Duration.ofHours(24) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...n/kotlin/org/eclipse/tractusx/bpdm/orchestrator/exception/BpdmDuplicateTaskIdException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* 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. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.exception | ||
|
||
import org.springframework.http.HttpStatus | ||
import org.springframework.web.bind.annotation.ResponseStatus | ||
|
||
|
||
@ResponseStatus(HttpStatus.BAD_REQUEST) | ||
class BpdmDuplicateTaskIdException( | ||
taskId: String | ||
) : RuntimeException("Duplicate task ID '$taskId'.") |
31 changes: 31 additions & 0 deletions
31
...main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/exception/BpdmIllegalStateException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* 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. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.exception | ||
|
||
import org.eclipse.tractusx.bpdm.orchestrator.model.TaskProcessingState | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.web.bind.annotation.ResponseStatus | ||
|
||
|
||
@ResponseStatus(HttpStatus.BAD_REQUEST) | ||
class BpdmIllegalStateException( | ||
taskId: String, | ||
state: TaskProcessingState | ||
) : RuntimeException("Task with ID '$taskId' is in illegal state for transition: resultState=${state.resultState}, step=${state.step}, stepState=${state.stepState}") |
29 changes: 29 additions & 0 deletions
29
...main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/exception/BpdmTaskNotFoundException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* 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. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.exception | ||
|
||
import org.springframework.http.HttpStatus | ||
import org.springframework.web.bind.annotation.ResponseStatus | ||
|
||
|
||
@ResponseStatus(HttpStatus.BAD_REQUEST) | ||
class BpdmTaskNotFoundException( | ||
taskId: String | ||
) : RuntimeException("Task with ID '$taskId' not found.") |
28 changes: 28 additions & 0 deletions
28
...estrator/src/main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/model/GoldenRecordTask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* 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. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.model | ||
|
||
import org.eclipse.tractusx.orchestrator.api.model.BusinessPartnerFullDto | ||
|
||
data class GoldenRecordTask( | ||
val taskId: String, | ||
var businessPartner: BusinessPartnerFullDto, | ||
val processingState: TaskProcessingState | ||
) |
37 changes: 37 additions & 0 deletions
37
...rator/src/main/kotlin/org/eclipse/tractusx/bpdm/orchestrator/model/TaskProcessingState.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021,2023 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* 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. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
******************************************************************************/ | ||
|
||
package org.eclipse.tractusx.bpdm.orchestrator.model | ||
|
||
import org.eclipse.tractusx.orchestrator.api.model.* | ||
import java.time.Instant | ||
|
||
data class TaskProcessingState( | ||
val mode: TaskMode, | ||
var resultState: ResultState, | ||
var errors: List<TaskErrorDto> = emptyList(), | ||
|
||
var step: TaskStep, | ||
var stepState: StepState, | ||
var reservationTimeout: Instant?, | ||
|
||
val taskCreatedAt: Instant, | ||
var taskModifiedAt: Instant, | ||
val taskTimeout: Instant, | ||
) |
Oops, something went wrong.