Mani | cdb2641 | 2016-02-16 19:44:34 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Open Networking Laboratory |
| 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 | package org.onosproject.ospf.protocol.ospfpacket.subtype; |
| 17 | |
| 18 | import com.google.common.base.MoreObjects; |
| 19 | |
| 20 | /** |
| 21 | * Representation of an LS Request packet and fields and access methods to access it. |
| 22 | */ |
| 23 | public class LsRequestPacket { |
| 24 | |
| 25 | private int lsType; |
| 26 | private String linkStateId; |
| 27 | private String ownRouterId; |
| 28 | |
| 29 | /** |
| 30 | * Gets the LSA type. |
| 31 | * |
| 32 | * @return LSA type |
| 33 | */ |
| 34 | public int lsType() { |
| 35 | return lsType; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Sets the LSA type. |
| 40 | * |
| 41 | * @param lsType LSA type |
| 42 | */ |
| 43 | public void setLsType(int lsType) { |
| 44 | this.lsType = lsType; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Gets the link state id. |
| 49 | * |
| 50 | * @return link state id |
| 51 | */ |
| 52 | public String linkStateId() { |
| 53 | return linkStateId; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Sets link state id. |
| 58 | * |
| 59 | * @param linkStateId state id |
| 60 | */ |
| 61 | public void setLinkStateId(String linkStateId) { |
| 62 | this.linkStateId = linkStateId; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Gets the router id. |
| 67 | * |
| 68 | * @return router id |
| 69 | */ |
| 70 | public String ownRouterId() { |
| 71 | return ownRouterId; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Sets the router id. |
| 76 | * |
| 77 | * @param ownRouterId router id |
| 78 | */ |
| 79 | public void setOwnRouterId(String ownRouterId) { |
| 80 | this.ownRouterId = ownRouterId; |
| 81 | } |
| 82 | |
| 83 | @Override |
| 84 | public String toString() { |
| 85 | return MoreObjects.toStringHelper(getClass()) |
| 86 | .omitNullValues() |
| 87 | .add("lsType", lsType) |
| 88 | .add("linkStateId", linkStateId) |
| 89 | .add("ownRouterId", ownRouterId) |
| 90 | .toString(); |
| 91 | } |
| 92 | } |