Add implementation for flat L3 overlay
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / lisp / mappers / SubnetUuidToGbpSubnetMapper.java
1 /*
2  * Copyright (c) 2017 Cisco Systems, Inc.  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.groupbasedpolicy.renderer.vpp.lisp.mappers;
10
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.vpp_renderer.rev160425.config.GbpSubnet;
12
13 import java.util.HashMap;
14
15 /**
16  * Created by Shakib Ahmed on 5/3/17.
17  */
18 public class SubnetUuidToGbpSubnetMapper {
19
20     private HashMap<String, GbpSubnet> subnetInformation;
21
22     private static SubnetUuidToGbpSubnetMapper INSTANCE = new SubnetUuidToGbpSubnetMapper();
23
24     private SubnetUuidToGbpSubnetMapper() {
25         subnetInformation = new HashMap<>();
26     }
27
28     public static SubnetUuidToGbpSubnetMapper getInstance() {
29         return INSTANCE;
30     }
31
32     public void addSubnetInfo(String subnetUuid, GbpSubnet subnetInfo) {
33         subnetInformation.put(subnetUuid, subnetInfo);
34     }
35
36     public GbpSubnet getSubnetInfo(String subnetUuid) {
37         return subnetInformation.get(subnetUuid);
38     }
39
40     public void removeSubnetInfo(String subnetUuid) {
41         subnetInformation.remove(subnetUuid);
42     }
43 }