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
8 package org.opendaylight.groupbasedpolicy.neutron.mapper.mapping;
10 import java.util.HashSet;
13 import org.opendaylight.neutron.spi.NeutronNetwork;
15 import com.google.common.base.Preconditions;
17 public class NeutronNetworkDao {
19 private final Set<String> externalNetworks = new HashSet<>();
21 public void addNetwork(NeutronNetwork network) {
22 Preconditions.checkNotNull(network);
23 if (network.getRouterExternal() != null && network.getRouterExternal() == true) {
24 externalNetworks.add(network.getID());
29 * Checks if neutron network is external
30 * @param networkId UUID of the network
31 * @return {@code true} if {@link NeutronNetwork#getRouterExternal()} is {@code true}; {@code false} otherwise
33 public boolean isExternalNetwork(String networkId) {
34 return externalNetworks.contains(networkId);