Search in sources :

Example 6 with IDataEncrypter

use of io.apiman.common.util.crypt.IDataEncrypter in project apiman by apiman.

the class AbstractEngineFactory method createEngine.

/**
 * Call this to create a new engine. This method uses the engine
 * config singleton to create the engine.
 */
@Override
public final IEngine createEngine() {
    IPluginRegistry pluginRegistry = createPluginRegistry();
    IDataEncrypter encrypter = createDataEncrypter(pluginRegistry);
    CurrentDataEncrypter.instance = encrypter;
    IRegistry registry = createRegistry(pluginRegistry, encrypter);
    IComponentRegistry componentRegistry = createComponentRegistry(pluginRegistry);
    IConnectorFactory cfactory = createConnectorFactory(pluginRegistry);
    IPolicyFactory pfactory = createPolicyFactory(pluginRegistry);
    IMetrics metrics = createMetrics(pluginRegistry);
    IApiRequestPathParser pathParser = createRequestPathParser(pluginRegistry);
    List<IGatewayInitializer> initializers = createInitializers(pluginRegistry);
    for (IGatewayInitializer initializer : initializers) {
        initializer.initialize();
    }
    complete();
    return new EngineImpl(registry, pluginRegistry, componentRegistry, cfactory, pfactory, metrics, pathParser);
}
Also used : IPluginRegistry(io.apiman.gateway.engine.IPluginRegistry) IPolicyFactory(io.apiman.gateway.engine.policy.IPolicyFactory) IApiRequestPathParser(io.apiman.gateway.engine.IApiRequestPathParser) IComponentRegistry(io.apiman.gateway.engine.IComponentRegistry) IConnectorFactory(io.apiman.gateway.engine.IConnectorFactory) IGatewayInitializer(io.apiman.gateway.engine.IGatewayInitializer) IDataEncrypter(io.apiman.common.util.crypt.IDataEncrypter) IRegistry(io.apiman.gateway.engine.IRegistry) IMetrics(io.apiman.gateway.engine.IMetrics)

Example 7 with IDataEncrypter

use of io.apiman.common.util.crypt.IDataEncrypter in project apiman by apiman.

the class WarCdiFactory method provideDataEncrypter.

@Produces
@ApplicationScoped
public static IDataEncrypter provideDataEncrypter(@New DefaultDataEncrypter defaultEncrypter, WarApiManagerConfig config, IPluginRegistry pluginRegistry) {
    try {
        IDataEncrypter encrypter = createCustomComponent(IDataEncrypter.class, config.getDataEncrypterType(), config.getDataEncrypterProperties(), pluginRegistry, defaultEncrypter);
        CurrentDataEncrypter.instance = encrypter;
        return encrypter;
    } catch (Throwable t) {
        // $NON-NLS-1$
        throw new RuntimeException("Error or unknown data encrypter type: " + config.getDataEncrypterType(), t);
    }
}
Also used : IDataEncrypter(io.apiman.common.util.crypt.IDataEncrypter) Produces(javax.enterprise.inject.Produces) ApplicationScoped(javax.enterprise.context.ApplicationScoped)

Aggregations

IDataEncrypter (io.apiman.common.util.crypt.IDataEncrypter)7 AesDataEncrypter (io.apiman.common.util.crypt.AesDataEncrypter)3 HashMap (java.util.HashMap)3 Test (org.junit.Test)3 ApplicationScoped (javax.enterprise.context.ApplicationScoped)2 Produces (javax.enterprise.inject.Produces)2 IApiRequestPathParser (io.apiman.gateway.engine.IApiRequestPathParser)1 IComponentRegistry (io.apiman.gateway.engine.IComponentRegistry)1 IConnectorFactory (io.apiman.gateway.engine.IConnectorFactory)1 IGatewayInitializer (io.apiman.gateway.engine.IGatewayInitializer)1 IMetrics (io.apiman.gateway.engine.IMetrics)1 IPluginRegistry (io.apiman.gateway.engine.IPluginRegistry)1 IRegistry (io.apiman.gateway.engine.IRegistry)1 IPolicyFactory (io.apiman.gateway.engine.policy.IPolicyFactory)1