blob: b61560d43948466ed1928fd759612fd20ed87ef2 [file] [log] [blame]
YuanyouZhangd06bb6b2015-08-05 16:59:07 +08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
YuanyouZhangd06bb6b2015-08-05 16:59:07 +08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.ovsdb.controller;
17
18import java.util.concurrent.ConcurrentMap;
19
20import org.onosproject.ovsdb.rfc.notation.Row;
21
22import com.google.common.collect.Maps;
23
24/**
25 * The class representing a table data.
26 */
27public class OvsdbRowStore {
28
29 private final ConcurrentMap<String, Row> rowStore = Maps.newConcurrentMap();
30
31 /**
32 * Gets the row.
33 *
34 * @param uuid the key of the rowStore
35 * @return row the row of the rowStore
36 */
37 public Row getRow(String uuid) {
38 return rowStore.get(uuid);
39 }
40
41 /**
42 * Inserts a row to rowStore.
43 *
44 * @param uuid key of the row
45 * @param row a row of the table
46 */
47 public void insertRow(String uuid, Row row) {
48 rowStore.put(uuid, row);
49 }
50
51 /**
52 * Deletes a row to rowStore.
53 *
54 * @param uuid key of the row
55 */
56 public void deleteRow(String uuid) {
57 rowStore.remove(uuid);
58 }
59
60 /**
61 * Gets the rowStore.
62 *
63 * @return rowStore
64 */
65 public ConcurrentMap<String, Row> getRowStore() {
66 return rowStore;
67 }
68
69}