blob: c5e00a7e15c026b698b1c12491efefe92cf50da8 [file] [log] [blame]
jaegonkim6a7b5242018-09-12 23:09:42 +09001/*
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 */
16package org.onosproject.workflow.api;
17
18import org.onosproject.event.Event;
19import org.onosproject.event.ListenerService;
20
nitinanandf3f94c62019-02-08 10:36:39 +053021import java.util.Set;
22
jaegonkim6a7b5242018-09-12 23:09:42 +090023/**
24 * Interface for workflow execution service.
25 */
26public 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 /**
jaegonkime0f45b52018-10-09 20:23:26 +090035 * Evals workflow context.
36 * @param contextName the name of workflow context
37 */
38 void eval(String contextName);
39
40 /**
jaegonkim6a7b5242018-09-12 23:09:42 +090041 * 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)
nitinanandf3f94c62019-02-08 10:36:39 +053050 * @param eventHintSet Set of event hint value
jaegonkim6a7b5242018-09-12 23:09:42 +090051 * @param contextName workflow context name to be called by this event map
jaegonkime0f45b52018-10-09 20:23:26 +090052 * @param programCounterString worklet type to be called by this event map
jaegonkim6a7b5242018-09-12 23:09:42 +090053 * @throws WorkflowException workflow exception
54 */
nitinanandf3f94c62019-02-08 10:36:39 +053055 void registerEventMap(Class<? extends Event> eventType, Set<String> eventHintSet,
jaegonkime0f45b52018-10-09 20:23:26 +090056 String contextName, String programCounterString) throws WorkflowException;
jaegonkim6a7b5242018-09-12 23:09:42 +090057}