blob: 285c5a5338f339b4c3511cbe2a2a4e1d5177bd25 [file] [log] [blame]
Yixiao Chen68bfab22016-11-11 11:04:10 -05001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Yixiao Chen68bfab22016-11-11 11:04:10 -05003 *
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 */
16package org.onosproject.tetopology.management.impl;
17
18import org.onosproject.tetopology.management.api.KeyId;
19import org.onosproject.tetopology.management.api.TeTopologyEvent.Type;
20import org.onosproject.tetopology.management.api.TeTopologyKey;
21import org.onosproject.tetopology.management.api.link.NetworkLinkKey;
22import org.onosproject.tetopology.management.api.link.TeLinkTpGlobalKey;
23import org.onosproject.tetopology.management.api.node.NetworkNodeKey;
24import org.onosproject.tetopology.management.api.node.TeNodeKey;
25
26import com.google.common.base.MoreObjects;
27
28public class TeTopologyMapEvent {
29 private final Type type;
30 private TeTopologyKey teTopologyKey;
31 private TeNodeKey teNodeKey;
32 private TeLinkTpGlobalKey teLinkKey;
33 private KeyId networkKey;
34 private NetworkNodeKey networkNodeKey;
35 private NetworkLinkKey networkLinkKey;
36
37 /**
38 * Creates an instance of TeTopologyMapEvent.
39 *
40 * @param type the map event type
41 */
42 public TeTopologyMapEvent(Type type) {
43 this.type = type;
44 }
45
46 /**
47 * Returns the map event type.
48 *
49 * @return the type
50 */
51 public Type type() {
52 return type;
53 }
54
55 /**
56 * Returns the TE topology key of the event.
57 *
58 * @return the teTopologyKey
59 */
60 public TeTopologyKey teTopologyKey() {
61 return teTopologyKey;
62 }
63
64 /**
65 * Sets the TE topology key of the event.
66 *
67 * @param teTopologyKey the teTopologyKey to set
68 */
69 public void setTeTopologyKey(TeTopologyKey teTopologyKey) {
70 this.teTopologyKey = teTopologyKey;
71 }
72
73 /**
74 * Returns the TE node key of the event.
75 *
76 * @return the teNodeKey
77 */
78 public TeNodeKey teNodeKey() {
79 return teNodeKey;
80 }
81
82 /**
83 * Sets the TE node key of the event.
84 *
85 * @param teNodeKey the teNodeKey to set
86 */
87 public void setTeNodeKey(TeNodeKey teNodeKey) {
88 this.teNodeKey = teNodeKey;
89 }
90
91 /**
92 * Returns the TE link key of the event.
93 *
94 * @return the teLinkKey
95 */
96 public TeLinkTpGlobalKey teLinkKey() {
97 return teLinkKey;
98 }
99
100 /**
101 * Sets the TE link key of the event.
102 *
103 * @param teLinkKey the teLinkKey to set
104 */
105 public void setTeLinkKey(TeLinkTpGlobalKey teLinkKey) {
106 this.teLinkKey = teLinkKey;
107 }
108
109 /**
110 * Returns the network key of the event.
111 *
112 * @return the networkKey
113 */
114 public KeyId networkKey() {
115 return networkKey;
116 }
117
118 /**
119 * Sets the network key of the event.
120 *
121 * @param networkKey the networkKey to set
122 */
123 public void setNetworkKey(KeyId networkKey) {
124 this.networkKey = networkKey;
125 }
126
127 /**
128 * Returns the network node key of the event.
129 *
130 * @return the networkNodeKey
131 */
132 public NetworkNodeKey networkNodeKey() {
133 return networkNodeKey;
134 }
135
136 /**
137 * Sets the network node key of the event.
138 *
139 * @param networkNodeKey the networkNodeKey to set
140 */
141 public void setNetworkNodeKey(NetworkNodeKey networkNodeKey) {
142 this.networkNodeKey = networkNodeKey;
143 }
144
145 /**
146 * Returns the network link key of the event.
147 *
148 * @return the networkLinkKey
149 */
150 public NetworkLinkKey networkLinkKey() {
151 return networkLinkKey;
152 }
153
154 /**
155 * Sets the network link key of the event.
156 *
157 * @param networkLinkKey the networkLinkKey to set
158 */
159 public void setNetworkLinkKey(NetworkLinkKey networkLinkKey) {
160 this.networkLinkKey = networkLinkKey;
161 }
162
163 @Override
164 public String toString() {
165 return MoreObjects.toStringHelper(this)
166 .add("type", type)
167 .add("teTopologyKey", teTopologyKey)
168 .add("teNodeKey", teNodeKey)
169 .add("teLinkKey", teLinkKey)
170 .add("networkKey", networkKey)
171 .add("networkNodeKey", networkNodeKey)
172 .add("networkLinkKey", networkLinkKey)
173 .toString();
174 }
175
176}