HIGUCHI Yuta | 34a3f69 | 2016-01-09 21:08:57 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0a4e674 | 2016-09-15 23:03:10 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
HIGUCHI Yuta | 34a3f69 | 2016-01-09 21:08:57 -0800 | [diff] [blame] | 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 | */ |
HIGUCHI Yuta | f46dc4f | 2016-05-13 11:24:13 -0700 | [diff] [blame] | 16 | package org.onosproject.net.utils; |
HIGUCHI Yuta | 34a3f69 | 2016-01-09 21:08:57 -0800 | [diff] [blame] | 17 | |
| 18 | import org.onlab.packet.ChassisId; |
| 19 | import org.onosproject.net.Annotations; |
| 20 | import org.onosproject.net.Device; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.driver.Behaviour; |
| 23 | import org.onosproject.net.provider.ProviderId; |
| 24 | |
| 25 | import com.google.common.annotations.Beta; |
| 26 | |
| 27 | /** |
| 28 | * A Device which forwards all its method calls to another Device. |
| 29 | */ |
| 30 | @Beta |
| 31 | public interface ForwardingDevice extends Device { |
| 32 | |
| 33 | Device delegate(); |
| 34 | |
| 35 | @Override |
| 36 | default Annotations annotations() { |
| 37 | return delegate().annotations(); |
| 38 | } |
| 39 | |
| 40 | @Override |
| 41 | default ProviderId providerId() { |
| 42 | return delegate().providerId(); |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | default <B extends Behaviour> B as(Class<B> projectionClass) { |
| 47 | return delegate().as(projectionClass); |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | default DeviceId id() { |
| 52 | return delegate().id(); |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | default Type type() { |
| 57 | return delegate().type(); |
| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | default <B extends Behaviour> boolean is(Class<B> projectionClass) { |
| 62 | return delegate().is(projectionClass); |
| 63 | } |
| 64 | |
| 65 | @Override |
| 66 | default String manufacturer() { |
| 67 | return delegate().manufacturer(); |
| 68 | } |
| 69 | |
| 70 | @Override |
| 71 | default String hwVersion() { |
| 72 | return delegate().hwVersion(); |
| 73 | } |
| 74 | |
| 75 | @Override |
| 76 | default String swVersion() { |
| 77 | return delegate().swVersion(); |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | default String serialNumber() { |
| 82 | return delegate().serialNumber(); |
| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | default ChassisId chassisId() { |
| 87 | return delegate().chassisId(); |
| 88 | } |
| 89 | } |