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.util;
11 import java.util.concurrent.atomic.AtomicInteger;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
15 * Created by Martin Bobak <mbobak@cisco.com> on 8.4.2015.
17 public final class FlowUtil {
19 private static final String ALIEN_SYSTEM_FLOW_ID = "#UF$TABLE*";
20 private static final AtomicInteger unaccountedFlowsCounter = new AtomicInteger(0);
24 throw new IllegalStateException("This class should not be instantiated.");
27 public static FlowId createAlienFlowId(final Short tableId) {
28 final StringBuilder sBuilder = new StringBuilder(ALIEN_SYSTEM_FLOW_ID)
29 .append(tableId).append("-").append(unaccountedFlowsCounter.incrementAndGet());
30 return new FlowId(sBuilder.toString());