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 | import org.onosproject.event.Event; |
| 19 | import org.onosproject.event.ListenerService; |
| 20 | |
nitinanand | f3f94c6 | 2019-02-08 10:36:39 +0530 | [diff] [blame] | 21 | import java.util.Set; |
| 22 | |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 23 | /** |
| 24 | * Interface for workflow execution service. |
| 25 | */ |
| 26 | public interface WorkflowExecutionService extends ListenerService<WorkflowDataEvent, WorkflowDataListener> { |
| 27 | |
| 28 | /** |
| 29 | * Executes init worklet. |
| 30 | * @param context workflow context |
| 31 | */ |
| 32 | void execInitWorklet(WorkflowContext context); |
| 33 | |
| 34 | /** |
jaegonkim | e0f45b5 | 2018-10-09 20:23:26 +0900 | [diff] [blame] | 35 | * Evals workflow context. |
| 36 | * @param contextName the name of workflow context |
| 37 | */ |
| 38 | void eval(String contextName); |
| 39 | |
| 40 | /** |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 41 | * Triggers workflow event map. |
| 42 | * @param event triggering event |
| 43 | * @param generator event hint generation method reference |
| 44 | */ |
| 45 | void eventMapTrigger(Event event, EventHintSupplier generator); |
| 46 | |
| 47 | /** |
| 48 | * Registers workflow event map. |
| 49 | * @param eventType event type (class name of event) |
nitinanand | f3f94c6 | 2019-02-08 10:36:39 +0530 | [diff] [blame] | 50 | * @param eventHintSet Set of event hint value |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 51 | * @param contextName workflow context name to be called by this event map |
jaegonkim | e0f45b5 | 2018-10-09 20:23:26 +0900 | [diff] [blame] | 52 | * @param programCounterString worklet type to be called by this event map |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 53 | * @throws WorkflowException workflow exception |
| 54 | */ |
nitinanand | f3f94c6 | 2019-02-08 10:36:39 +0530 | [diff] [blame] | 55 | void registerEventMap(Class<? extends Event> eventType, Set<String> eventHintSet, |
jaegonkim | e0f45b5 | 2018-10-09 20:23:26 +0900 | [diff] [blame] | 56 | String contextName, String programCounterString) throws WorkflowException; |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 57 | } |