All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.projectfloodlight.openflow.protocol.BundleIdGenerators Maven / Gradle / Ivy

Go to download

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());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy