jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.workflow.api; |
| 17 | |
| 18 | |
| 19 | import com.fasterxml.jackson.databind.JsonNode; |
| 20 | |
| 21 | /** |
| 22 | * Interface for workflow service. |
| 23 | */ |
| 24 | public interface WorkflowService { |
| 25 | |
jaegonkim | 44628d6 | 2019-04-07 10:30:32 +0900 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Registers workflow. |
| 29 | * @param workflow registering workflow |
| 30 | * @throws WorkflowException workflow exception |
| 31 | */ |
| 32 | void register(Workflow workflow) throws WorkflowException; |
| 33 | |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 34 | /** |
| 35 | * Creates workplace. |
| 36 | * @param wpDesc workplace description |
| 37 | * @throws WorkflowException workflow exception |
| 38 | */ |
| 39 | void createWorkplace(WorkplaceDescription wpDesc) throws WorkflowException; |
| 40 | |
| 41 | /** |
| 42 | * Removes workplace. |
| 43 | * @param wpDesc workplace description |
| 44 | * @throws WorkflowException workflow exception |
| 45 | */ |
| 46 | void removeWorkplace(WorkplaceDescription wpDesc) throws WorkflowException; |
| 47 | |
| 48 | /** |
| 49 | * Clears all workplaces. |
| 50 | * @throws WorkflowException workflow exception |
| 51 | */ |
| 52 | void clearWorkplace() throws WorkflowException; |
| 53 | |
| 54 | /** |
| 55 | * Invokes workflow. |
| 56 | * @param wfDesc workflow description |
| 57 | * @throws WorkflowException workflow exception |
| 58 | */ |
| 59 | void invokeWorkflow(WorkflowDescription wfDesc) throws WorkflowException; |
| 60 | |
| 61 | /** |
| 62 | * Invokes workflow. |
| 63 | * @param worklowDescJson workflow description json |
| 64 | * @throws WorkflowException workflow exception |
| 65 | */ |
| 66 | void invokeWorkflow(JsonNode worklowDescJson) throws WorkflowException; |
| 67 | |
| 68 | /** |
| 69 | * Terminates workflow. |
| 70 | * @param wfDesc workflow description |
| 71 | * @throws WorkflowException workflow exception |
| 72 | */ |
| 73 | void terminateWorkflow(WorkflowDescription wfDesc) throws WorkflowException; |
| 74 | } |