Fix of Lisp commands for DVR
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / commands / lisp / dom / GbpGpeEntryDom.java
1 /*
2  * Copyright (c) 2017 Cisco Systems. 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 package org.opendaylight.groupbasedpolicy.renderer.vpp.commands.lisp.dom;
9
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntry;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntryBuilder;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.GpeEntryKey;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.LocalEid;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.gpe.rev170801.gpe.entry.table.grouping.gpe.entry.table.gpe.entry.RemoteEid;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.lisp.rev170808.MapReplyAction;
17
18 public class GbpGpeEntryDom implements CommandModel{
19     private String id;
20     private Long vrf;
21     private Long vni;
22     private LocalEid localEid;
23     private RemoteEid remoteEid;
24     private MapReplyAction action;
25
26     public String getId() {
27         return id;
28     }
29
30     public void setId(String id) {
31         this.id = id;
32     }
33
34     public Long getVrf() {
35         return vrf;
36     }
37
38     public void setVrf(Long vrf) {
39         this.vrf = vrf;
40     }
41
42     public Long getVni() {
43         return vni;
44     }
45
46     public void setVni(Long vni) {
47         this.vni = vni;
48     }
49
50     public RemoteEid getRemoteEid() {
51         return remoteEid;
52     }
53
54     public void setRemoteEid(RemoteEid remoteEid) {
55         this.remoteEid = remoteEid;
56     }
57
58     public MapReplyAction getAction() {
59         return action;
60     }
61
62     public LocalEid getLocalEid() {
63         return localEid;
64     }
65
66     public void setLocalEid(LocalEid localEid) {
67         this.localEid = localEid;
68     }
69
70     public void setAction(MapReplyAction action) {
71         this.action = action;
72     }
73
74     @Override
75     public GpeEntry getSALObject() {
76         Preconditions.checkNotNull(id, "Gpe Entry Id need to be set!");
77         return new GpeEntryBuilder()
78                     .setKey(new GpeEntryKey(id))
79                     .setId(id)
80                     .setDpTable(vrf)
81                     .setVni(vni)
82                     .setRemoteEid(remoteEid)
83                     .setLocalEid(localEid)
84                     .setAction(action).build();
85     }
86
87     @Override public String toString() {
88         return "GbpGpeEntry{" + "id='" + id + ", vrf=" + vrf + ", vni=" + vni + ", localEid=" + localEid
89             + ", remoteEid=" + remoteEid + ", action=" + action + '}';
90     }
91 }