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.group;
11 import java.util.ArrayList;
12 import java.util.List;
13 import org.opendaylight.openflowplugin.api.openflow.registry.group.DeviceGroupRegistry;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
17 * Created by Martin Bobak <mbobak@cisco.com> on 15.4.2015.
19 public class DeviceGroupRegistryImpl implements DeviceGroupRegistry {
21 private final List<GroupId> groupIdList = new ArrayList<>();
22 private final List<GroupId> marks = new ArrayList<>();
25 public void store(final GroupId groupId) {
26 groupIdList.add(groupId);
30 public void markToBeremoved(final GroupId groupId) {
35 public void removeMarked() {
36 synchronized (groupIdList) {
37 groupIdList.removeAll(marks);
43 public List<GroupId> getAllGroupIds() {
49 synchronized (groupIdList) {
52 synchronized (marks) {