Fix metadata for route, arp and overlay
[groupbasedpolicy.git] / renderers / vpp / src / main / java / org / opendaylight / groupbasedpolicy / renderer / vpp / lisp / mappers / HostIdToMetadataInterfaceMapper.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
9 package org.opendaylight.groupbasedpolicy.renderer.vpp.lisp.mappers;
10
11 import com.google.common.collect.HashMultimap;
12 import com.google.common.collect.SetMultimap;
13
14
15 /**
16  * Created by Shakib Ahmed on 7/10/17.
17  */
18 public class HostIdToMetadataInterfaceMapper {
19     private SetMultimap<String, String> hostIdToMetadataInterfaceNameMapper;
20
21     private static final HostIdToMetadataInterfaceMapper INSTANCE = new HostIdToMetadataInterfaceMapper();
22
23     private HostIdToMetadataInterfaceMapper() {
24         hostIdToMetadataInterfaceNameMapper = HashMultimap.create();
25     }
26
27     public static HostIdToMetadataInterfaceMapper getInstance() {
28         return INSTANCE;
29     }
30
31     public boolean isMetadataInterfaceConfigured(String hostId, String metadataInterfaceName) {
32         return hostIdToMetadataInterfaceNameMapper.get(hostId).contains(metadataInterfaceName);
33     }
34
35     public void addMetadataInterfaceInHost(String hostId, String metadataInterfaceName) {
36         hostIdToMetadataInterfaceNameMapper.put(hostId, metadataInterfaceName);
37     }
38 }