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 | /** |
| 20 | * An abstract class representing workflow data. |
| 21 | */ |
| 22 | public abstract class WorkflowData { |
| 23 | |
| 24 | private DataModelTree data; |
| 25 | private boolean triggerNext = true; // default is true |
| 26 | |
| 27 | /** |
| 28 | * Constructor of workflow data. |
| 29 | * @param data data model tree |
| 30 | */ |
| 31 | public WorkflowData(DataModelTree data) { |
| 32 | this.data = data; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Returns name. |
| 37 | * @return name |
| 38 | */ |
| 39 | public abstract String name(); |
| 40 | |
| 41 | /** |
| 42 | * Returns work-partition distributor. |
| 43 | * @return work-partition distributor |
| 44 | */ |
| 45 | public abstract String distributor(); |
| 46 | |
| 47 | /** |
| 48 | * Returns context model tree. |
| 49 | * @return context model tree |
| 50 | */ |
| 51 | public DataModelTree data() { |
| 52 | return data; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Returns whether to trigger next worklet selection. |
| 57 | * @return whether to trigger next worklet selection |
| 58 | */ |
| 59 | public boolean triggerNext() { |
| 60 | return triggerNext; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Sets whether to handle update event. |
| 65 | * @param triggerNext whether to handle update event |
| 66 | */ |
| 67 | public void setTriggerNext(boolean triggerNext) { |
| 68 | this.triggerNext = triggerNext; |
| 69 | } |
| 70 | |
| 71 | } |