Fix metadata for route, arp and overlay
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / lisp / flat / overlay / RoutingInfo.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.lisp.flat.overlay;
9
10 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
11
12 import java.util.HashSet;
13 import java.util.Set;
14
15 /**
16  * Created by Shakib Ahmed on 5/4/17.
17  */
18 public class RoutingInfo {
19     private String ProtocolName;
20     private int count = 0;
21     private Set<Ipv4Address> allIpsInVrf;
22
23     public RoutingInfo() {
24         allIpsInVrf = new HashSet<>();
25     }
26
27     public String getProtocolName() {
28         return ProtocolName;
29     }
30
31     public void setProtocolName(String protocolName) {
32         ProtocolName = protocolName;
33     }
34
35     public int getCount() {
36         return count;
37     }
38
39     public void addIpInVrf(Ipv4Address ip) {
40         allIpsInVrf.add(ip);
41         incrementCount();
42     }
43
44     public boolean ipAlreadyExistsinVrf(Ipv4Address ip) {
45         return allIpsInVrf.contains(ip);
46     }
47
48     private void incrementCount() {
49         count++;
50     }
51 }