Yi Tseng | 82512da | 2017-08-16 19:46:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-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 | |
| 17 | package org.onosproject.p4runtime.api; |
| 18 | |
| 19 | import com.google.common.annotations.Beta; |
| 20 | import org.onosproject.net.group.Group; |
| 21 | import org.onosproject.net.pi.runtime.PiActionGroup; |
| 22 | |
| 23 | /** |
| 24 | * A wrapper for a ONOS group installed on a P4Runtime device. |
| 25 | */ |
| 26 | @Beta |
| 27 | public class P4RuntimeGroupWrapper { |
| 28 | private final PiActionGroup piActionGroup; |
| 29 | private final Group group; |
| 30 | private final long installMilliSeconds; |
| 31 | |
| 32 | /** |
| 33 | * Creates new group wrapper. |
| 34 | * |
| 35 | * @param piActionGroup the Pi action group |
| 36 | * @param group the group |
| 37 | * @param installMilliSeconds the installation time |
| 38 | */ |
| 39 | public P4RuntimeGroupWrapper(PiActionGroup piActionGroup, Group group, |
| 40 | long installMilliSeconds) { |
| 41 | this.piActionGroup = piActionGroup; |
| 42 | this.group = group; |
| 43 | this.installMilliSeconds = installMilliSeconds; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Gets PI action group from this wrapper. |
| 48 | * |
| 49 | * @return the PI action group |
| 50 | */ |
| 51 | public PiActionGroup piActionGroup() { |
| 52 | return piActionGroup; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Gets group from this wrapper. |
| 57 | * |
| 58 | * @return the group |
| 59 | */ |
| 60 | public Group group() { |
| 61 | return group; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Gets installation time of this wrapper. |
| 66 | * |
| 67 | * @return the installation time |
| 68 | */ |
| 69 | public long installMilliSeconds() { |
| 70 | return installMilliSeconds; |
| 71 | } |
| 72 | } |