blob: da9db376c6176c9f2514d667a75f288c82fc6477 [file] [log] [blame]
gyewan.an91d7e7e2019-01-17 15:12:48 +09001/*
gyewan.an3c99ee72019-02-18 15:53:55 +09002 * Copyright 2019-present Open Networking Foundation
gyewan.an91d7e7e2019-01-17 15:12:48 +09003 *
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
17package org.onosproject.netconf.ctl.impl;
18
19import com.google.common.collect.ImmutableList;
gyewan.an3c99ee72019-02-18 15:53:55 +090020import org.onosproject.cluster.NodeId;
gyewan.an91d7e7e2019-01-17 15:12:48 +090021import org.onosproject.net.DeviceId;
22import org.onosproject.netconf.NetconfProxyMessage;
23
24import java.util.List;
25
26/**
27 * Default implementation of Netconf Proxy Message.
28 */
29public class DefaultNetconfProxyMessage implements NetconfProxyMessage {
30
31 private final SubjectType subjectType;
32 private final DeviceId deviceId;
33 private final List<String> arguments;
gyewan.an3c99ee72019-02-18 15:53:55 +090034 private final NodeId senderId;
gyewan.an91d7e7e2019-01-17 15:12:48 +090035
36 /**
37 * Create new NetconfProxyMessage with provided informations.
38 * @param subType Message subject type.
39 * @param devId Device information that recieve message.
40 * @param args Messages arguments.
gyewan.an3c99ee72019-02-18 15:53:55 +090041 * @param nodeId nodeId of sender
gyewan.an91d7e7e2019-01-17 15:12:48 +090042 */
43 public DefaultNetconfProxyMessage(SubjectType subType,
44 DeviceId devId,
gyewan.an3c99ee72019-02-18 15:53:55 +090045 List<String> args,
46 NodeId nodeId) {
gyewan.an91d7e7e2019-01-17 15:12:48 +090047 subjectType = subType;
48 deviceId = devId;
49 arguments = args;
gyewan.an3c99ee72019-02-18 15:53:55 +090050 senderId = nodeId;
gyewan.an91d7e7e2019-01-17 15:12:48 +090051 }
52
gyewan.an3c99ee72019-02-18 15:53:55 +090053
gyewan.an91d7e7e2019-01-17 15:12:48 +090054 @Override
55 public SubjectType subjectType() {
56 return subjectType;
57 }
58
59 @Override
60 public DeviceId deviceId() {
61 return deviceId;
62 }
63
64 @Override
65 public List<String> arguments() {
66 return ImmutableList.copyOf(arguments);
67 }
gyewan.an3c99ee72019-02-18 15:53:55 +090068
69 @Override
70 public NodeId senderId() {
71 return senderId;
72 }
gyewan.an91d7e7e2019-01-17 15:12:48 +090073}