2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.openflowplugin.impl.registry.meter;
11 import java.util.ArrayList;
12 import java.util.List;
13 import org.opendaylight.openflowplugin.api.openflow.registry.meter.DeviceMeterRegistry;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
17 * Created by Martin Bobak <mbobak@cisco.com> on 15.4.2015.
19 public class DeviceMeterRegistryImpl implements DeviceMeterRegistry {
21 private final List<MeterId> meterIds = new ArrayList<>();
22 private final List<MeterId> marks = new ArrayList<>();
25 public void store(final MeterId meterId) {
26 meterIds.add(meterId);
30 public void markToBeremoved(final MeterId meterId) {
35 public void removeMarked() {
36 synchronized (meterIds) {
37 meterIds.removeAll(marks);
39 synchronized (marks) {
45 public List<MeterId> getAllMeterIds() {
51 synchronized (meterIds) {
54 synchronized (marks) {