gyewan.an | 91d7e7e | 2019-01-17 15:12:48 +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 | |
| 17 | package org.onosproject.netconf.ctl.impl; |
| 18 | |
| 19 | import com.google.common.collect.ImmutableList; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.netconf.NetconfProxyMessage; |
| 22 | |
| 23 | import java.util.List; |
| 24 | |
| 25 | /** |
| 26 | * Default implementation of Netconf Proxy Message. |
| 27 | */ |
| 28 | public class DefaultNetconfProxyMessage implements NetconfProxyMessage { |
| 29 | |
| 30 | private final SubjectType subjectType; |
| 31 | private final DeviceId deviceId; |
| 32 | private final List<String> arguments; |
| 33 | |
| 34 | /** |
| 35 | * Create new NetconfProxyMessage with provided informations. |
| 36 | * @param subType Message subject type. |
| 37 | * @param devId Device information that recieve message. |
| 38 | * @param args Messages arguments. |
| 39 | */ |
| 40 | public DefaultNetconfProxyMessage(SubjectType subType, |
| 41 | DeviceId devId, |
| 42 | List<String> args) { |
| 43 | subjectType = subType; |
| 44 | deviceId = devId; |
| 45 | arguments = args; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public SubjectType subjectType() { |
| 50 | return subjectType; |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public DeviceId deviceId() { |
| 55 | return deviceId; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public List<String> arguments() { |
| 60 | return ImmutableList.copyOf(arguments); |
| 61 | } |
| 62 | } |