4251f46b7097d2c02941eaa0eebbb8cafdaeb24e
[vpnservice.git] / bgpmanager / bgpmanager-impl / src / main / java / org / opendaylight / bgpmanager / thrift / client / globals / Route.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.bgpmanager.thrift.client.globals;
10
11
12 public class Route {
13
14     private int prefixlen;
15     private int label;
16     private String rd;
17     private String prefix;
18     private String nexthop;
19
20     public Route(String rd, String prefix, int prefixlen, String nexthop, int label) {
21         this.rd = rd;
22         this.prefix = prefix;
23         this.prefixlen = prefixlen;
24         this.nexthop = nexthop;
25         this.label = label;
26     }
27
28     public String getRd() {
29         return this.rd;
30     }
31
32     public String getPrefix() {
33         return new StringBuilder().append(this.prefix).append("/").append(this.prefixlen).toString();
34     }
35
36     public String getNexthop() {
37         return this.nexthop;
38     }
39
40     public int getLabel() {
41         return this.label;
42     }
43
44     public void setRd(String rd) {
45         this.rd = rd;
46     }
47
48     public void setPrefix(String prefix) {
49         String[] splitStr = prefix.split("/");
50         this.prefix = splitStr[0];
51         this.prefixlen = Integer.parseInt(splitStr[1]);
52     }
53
54     public void setNexthop(String nextHop) {
55         this.nexthop = nextHop;
56     }
57
58     public void setLabel(int label) {
59         this.label = label;
60     }
61 }