blob: aa29d61bc80026c49cea8db9dfe242381da5e2b9 [file] [log] [blame]
Dhruv Dhody4d8943a2016-02-17 16:36:08 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Dhruv Dhody4d8943a2016-02-17 16:36:08 +05303 *
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.ospf.controller.impl;
17
18import org.onlab.packet.Ip4Address;
19import org.onosproject.ospf.controller.LinkInformation;
20
21/**
22 * Representation of an OSPF link information..
23 */
24public class LinkInformationImpl implements LinkInformation {
25
26 String linkId;
27 Ip4Address linkSourceId;
28 Ip4Address linkDestinationId;
29 Ip4Address interfaceIp;
30 boolean linkSrcIdNotRouterId;
31 boolean alreadyCreated;
32 Ip4Address linkSourceIpAddress;
33 Ip4Address linkDestinationIpAddress;
34
35 /**
36 * Gets link id.
37 *
38 * @return link id
39 */
40 public String linkId() {
41 return linkId;
42 }
43
44 /**
45 * Sets link id.
46 *
47 * @param linkId link id
48 */
49 public void setLinkId(String linkId) {
50 this.linkId = linkId;
51 }
52
53 /**
54 * Gets is already created or not.
55 *
56 * @return true if already created else false
57 */
58 public boolean isAlreadyCreated() {
59 return alreadyCreated;
60 }
61
62 /**
63 * Sets is already created or not.
64 *
65 * @param alreadyCreated true or false
66 */
67 public void setAlreadyCreated(boolean alreadyCreated) {
68 this.alreadyCreated = alreadyCreated;
69 }
70
71 /**
72 * Gets is link source id is not router id.
73 *
74 * @return true if link source id is router id else false
75 */
76 public boolean isLinkSrcIdNotRouterId() {
77 return linkSrcIdNotRouterId;
78 }
79
80 /**
81 * Sets is link source id is not router id.
82 *
83 * @param linkSrcIdNotRouterId true or false
84 */
85 public void setLinkSrcIdNotRouterId(boolean linkSrcIdNotRouterId) {
86 this.linkSrcIdNotRouterId = linkSrcIdNotRouterId;
87 }
88
89 /**
90 * Gets link destination id.
91 *
92 * @return link destination id
93 */
94 public Ip4Address linkDestinationId() {
95 return linkDestinationId;
96 }
97
98 /**
99 * Sets link destination id.
100 *
101 * @param linkDestinationId link destination id
102 */
103 public void setLinkDestinationId(Ip4Address linkDestinationId) {
104 this.linkDestinationId = linkDestinationId;
105 }
106
107 /**
108 * Gets link source id.
109 *
110 * @return link source id
111 */
112 public Ip4Address linkSourceId() {
113 return linkSourceId;
114 }
115
116 /**
117 * Sets link source id.
118 *
119 * @param linkSourceId link source id
120 */
121 public void setLinkSourceId(Ip4Address linkSourceId) {
122 this.linkSourceId = linkSourceId;
123 }
124
125 /**
126 * Gets interface IP address.
127 *
128 * @return interface IP address
129 */
130 public Ip4Address interfaceIp() {
131 return interfaceIp;
132 }
133
134 /**
135 * Sets interface IP address.
136 *
137 * @param interfaceIp interface IP address
138 */
139 public void setInterfaceIp(Ip4Address interfaceIp) {
140 this.interfaceIp = interfaceIp;
141 }
142
143 /**
144 * Gets link source IP address.
145 *
146 * @return link source IP address
147 */
148 public Ip4Address linkSourceIpAddress() {
149 return linkSourceIpAddress;
150 }
151
152 /**
153 * Sets link source IP address.
154 *
155 * @param linkSourceIpAddress link source IP address
156 */
157 public void setLinkSourceIpAddress(Ip4Address linkSourceIpAddress) {
158 this.linkSourceIpAddress = linkSourceIpAddress;
159 }
160
161 /**
162 * Gets link destination IP address.
163 *
164 * @return link destination IP address
165 */
166 public Ip4Address linkDestinationIpAddress() {
167 return linkDestinationIpAddress;
168 }
169
170 /**
171 * Sets link destination IP address.
172 *
173 * @param linkDestinationIpAddress link destination IP address
174 */
175 public void setLinkDestinationIpAddress(Ip4Address linkDestinationIpAddress) {
176 this.linkDestinationIpAddress = linkDestinationIpAddress;
177 }
178}