Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [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 | */ |
Marc De Leenheer | b473b9d | 2015-02-06 15:21:03 -0800 | [diff] [blame] | 16 | package org.onosproject.store.device.impl; |
| 17 | |
| 18 | import com.google.common.base.MoreObjects; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.device.PortDescription; |
| 21 | import org.onosproject.net.provider.ProviderId; |
| 22 | |
| 23 | import java.util.List; |
| 24 | |
| 25 | public class PortInjectedEvent { |
| 26 | |
| 27 | private ProviderId providerId; |
| 28 | private DeviceId deviceId; |
| 29 | private List<PortDescription> portDescriptions; |
| 30 | |
| 31 | protected PortInjectedEvent(ProviderId providerId, DeviceId deviceId, List<PortDescription> portDescriptions) { |
| 32 | this.providerId = providerId; |
| 33 | this.deviceId = deviceId; |
| 34 | this.portDescriptions = portDescriptions; |
| 35 | } |
| 36 | |
| 37 | public DeviceId deviceId() { |
| 38 | return deviceId; |
| 39 | } |
| 40 | |
| 41 | public ProviderId providerId() { |
| 42 | return providerId; |
| 43 | } |
| 44 | |
| 45 | public List<PortDescription> portDescriptions() { |
| 46 | return portDescriptions; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public String toString() { |
| 51 | return MoreObjects.toStringHelper(getClass()) |
| 52 | .add("providerId", providerId) |
| 53 | .add("deviceId", deviceId) |
| 54 | .add("portDescriptions", portDescriptions) |
| 55 | .toString(); |
| 56 | } |
| 57 | |
| 58 | // for serializer |
| 59 | protected PortInjectedEvent() { |
| 60 | this.providerId = null; |
| 61 | this.deviceId = null; |
| 62 | this.portDescriptions = null; |
| 63 | } |
| 64 | |
| 65 | } |