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 com.google.common.collect.ImmutableList;
12 import java.util.ArrayList;
13 import java.util.List;
14 import org.opendaylight.openflowplugin.api.openflow.registry.group.DeviceGroupRegistry;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
18 * Created by Martin Bobak <mbobak@cisco.com> on 15.4.2015.
20 public class DeviceGroupRegistryImpl implements DeviceGroupRegistry {
22 private final List<GroupId> groupIdList = new ArrayList<>();
23 private final List<GroupId> marks = new ArrayList<>();
26 public void store(final GroupId groupId) {
27 groupIdList.add(groupId);
31 public void markToBeremoved(final GroupId groupId) {
36 public void removeMarked() {
37 groupIdList.removeAll(marks);
42 public List<GroupId> getAllGroupIds() {
43 return ImmutableList.copyOf(groupIdList);