Of Tunnel creation Oper Implementation
[genius.git] / itm / itm-impl / src / main / java / org / opendaylight / genius / itm / cache / UnprocessedOFNodeConnectorCache.java
1 /*
2  * Copyright (c) 2020 Ericsson India Global Services Pvt Ltd. and others.  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.genius.itm.cache;
9
10 import java.util.concurrent.ConcurrentHashMap;
11 import java.util.concurrent.ConcurrentMap;
12 import javax.inject.Singleton;
13 import org.opendaylight.genius.itm.utils.NodeConnectorInfo;
14
15 @Singleton
16 public class UnprocessedOFNodeConnectorCache {
17
18     private final ConcurrentMap<String, NodeConnectorInfo> unprocessedOFNodeConnectorMap = new ConcurrentHashMap<>();
19
20     public void add(String ofPortName, NodeConnectorInfo nodeConnectorInfo) {
21         unprocessedOFNodeConnectorMap.put(ofPortName, nodeConnectorInfo);
22     }
23
24     public NodeConnectorInfo get(String ofPortName) {
25         return unprocessedOFNodeConnectorMap.get(ofPortName);
26     }
27
28     public NodeConnectorInfo remove(String ofPortName) {
29         return unprocessedOFNodeConnectorMap.remove(ofPortName);
30     }
31
32     public ConcurrentMap<String, NodeConnectorInfo> getAllPresent() {
33         return unprocessedOFNodeConnectorMap;
34     }
35 }