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 java.net.URI; |
| 19 | import java.util.Collection; |
| 20 | |
| 21 | /** |
| 22 | * Store for managing workflow. |
| 23 | */ |
| 24 | public interface WorkflowStore { |
| 25 | |
| 26 | /** |
| 27 | * Registers workflow. |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 28 | * |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 29 | * @param workflow registering workflow |
| 30 | */ |
| 31 | void register(Workflow workflow); |
| 32 | |
| 33 | /** |
| 34 | * Unregisters workflow. |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 35 | * |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 36 | * @param id id of workflow |
| 37 | */ |
| 38 | void unregister(URI id); |
| 39 | |
| 40 | /** |
| 41 | * Gets workflow. |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 42 | * |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 43 | * @param id id of workflow |
| 44 | * @return workflow |
| 45 | */ |
| 46 | Workflow get(URI id); |
| 47 | |
| 48 | /** |
| 49 | * Gets all workflow. |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 50 | * |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 51 | * @return collection of workflow |
| 52 | */ |
| 53 | Collection<Workflow> getAll(); |
| 54 | |
| 55 | /** |
| 56 | * Registers local class loader. |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 57 | * |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 58 | * @param loader class loader |
| 59 | */ |
| 60 | void registerLocal(ClassLoader loader); |
| 61 | |
| 62 | /** |
| 63 | * Unregisters local class loader. |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 64 | * |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 65 | * @param loader class loader |
| 66 | */ |
| 67 | void unregisterLocal(ClassLoader loader); |
| 68 | |
| 69 | /** |
| 70 | * Gets class from registered class loaders. |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 71 | * |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 72 | * @param name name of class |
| 73 | * @return class |
| 74 | * @throws ClassNotFoundException class not found exception |
| 75 | */ |
| 76 | Class getClass(String name) throws ClassNotFoundException; |
m.rahil | 0925188 | 2019-04-15 22:58:33 +0530 | [diff] [blame] | 77 | |
jaegonkim | 6a7b524 | 2018-09-12 23:09:42 +0900 | [diff] [blame] | 78 | } |