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

io.vertx.up.uca.rs.secure.ShuntBolt Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package io.vertx.up.uca.rs.secure;

import io.vertx.core.Vertx;
import io.vertx.ext.web.handler.AuthHandler;
import io.vertx.up.atom.secure.Cliff;

/**
 * Dispatch Bolt to real bolt instance.
 */
class ShuntBolt implements Bolt {

    private static Bolt INSTANCE;

    static Bolt create() {
        if (null == INSTANCE) {
            INSTANCE = new ShuntBolt();
        }
        return INSTANCE;
    }

    /**
     * @param vertx Vertx reference
     * @param cliff Cliff reference
     * @return AuthHandler building
     */
    @Override
    public AuthHandler mount(final Vertx vertx,
                             final Cliff cliff) {
        if (cliff.isDefined()) {
            // User-defined
            // TODO: All should be defined by user.
            return null;
        } else {
            // Native
            final Bolt bolt = NativeBolt.create();
            return bolt.mount(vertx, cliff);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy