org.projectfloodlight.openflow.protocol.BundleIdGenerators Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openflowj Show documentation
Show all versions of openflowj Show documentation
OpenFlowJ API supporting OpenFlow versions 1.0 through 1.5.1, generated by LoxiGen
The newest version!
package org.projectfloodlight.openflow.protocol;
import java.util.concurrent.atomic.AtomicInteger;
import org.projectfloodlight.openflow.types.BundleId;
public class BundleIdGenerators {
private static final BundleIdGenerator GLOBAL_BUNDLE_ID_GENERATOR = create();
public static BundleIdGenerator create() {
return new StandardBundleIdGenerator();
}
public static BundleIdGenerator global() {
return GLOBAL_BUNDLE_ID_GENERATOR;
}
}
class StandardBundleIdGenerator implements BundleIdGenerator {
private final AtomicInteger idGen = new AtomicInteger();
@Override
public BundleId nextBundleId() {
return BundleId.of(idGen.incrementAndGet());
}
}