Simplify overlay information mappers and managers
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / lisp / info / container / states / VrfHolder.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.info.container.states;
9
10 import java.util.HashMap;
11
12 /**
13  * Created by Shakib Ahmed on 7/17/17.
14  */
15 public class VrfHolder {
16     HashMap<Long, VrfState> vrfIdToVrfStateMapper;
17
18     public VrfHolder() {
19         vrfIdToVrfStateMapper = new HashMap<>();
20     }
21
22     public VrfState getVrfState(Long vrfId) {
23         return vrfIdToVrfStateMapper.get(vrfId);
24     }
25
26     public void initializeVrfState(Long vrfId, String routingProtocolName) {
27         vrfIdToVrfStateMapper.put(vrfId, new VrfState(routingProtocolName));
28     }
29
30     public boolean hasVrf(Long vrfId) {
31         return vrfIdToVrfStateMapper.containsKey(vrfId);
32     }
33 }