Search in sources :

Example 1 with SystemAccessControlFactory

use of com.facebook.presto.spi.security.SystemAccessControlFactory in project presto by prestodb.

the class PluginManager method installPlugin.

public void installPlugin(Plugin plugin) {
    for (BlockEncodingFactory<?> blockEncodingFactory : plugin.getBlockEncodingFactories(blockEncodingManager)) {
        log.info("Registering block encoding %s", blockEncodingFactory.getName());
        blockEncodingManager.addBlockEncodingFactory(blockEncodingFactory);
    }
    for (Type type : plugin.getTypes()) {
        log.info("Registering type %s", type.getTypeSignature());
        typeRegistry.addType(type);
    }
    for (ParametricType parametricType : plugin.getParametricTypes()) {
        log.info("Registering parametric type %s", parametricType.getName());
        typeRegistry.addParametricType(parametricType);
    }
    for (ConnectorFactory connectorFactory : plugin.getConnectorFactories()) {
        log.info("Registering connector %s", connectorFactory.getName());
        connectorManager.addConnectorFactory(connectorFactory);
    }
    for (Class<?> functionClass : plugin.getFunctions()) {
        log.info("Registering functions from %s", functionClass.getName());
        metadata.addFunctions(extractFunctions(functionClass));
    }
    for (ResourceGroupConfigurationManagerFactory configurationManagerFactory : plugin.getResourceGroupConfigurationManagerFactories()) {
        log.info("Registering resource group configuration manager %s", configurationManagerFactory.getName());
        resourceGroupManager.addConfigurationManagerFactory(configurationManagerFactory);
    }
    for (SystemAccessControlFactory accessControlFactory : plugin.getSystemAccessControlFactories()) {
        log.info("Registering system access control %s", accessControlFactory.getName());
        accessControlManager.addSystemAccessControlFactory(accessControlFactory);
    }
    for (EventListenerFactory eventListenerFactory : plugin.getEventListenerFactories()) {
        log.info("Registering event listener %s", eventListenerFactory.getName());
        eventListenerManager.addEventListenerFactory(eventListenerFactory);
    }
}
Also used : SystemAccessControlFactory(com.facebook.presto.spi.security.SystemAccessControlFactory) Type(com.facebook.presto.spi.type.Type) ParametricType(com.facebook.presto.spi.type.ParametricType) ConnectorFactory(com.facebook.presto.spi.connector.ConnectorFactory) ResourceGroupConfigurationManagerFactory(com.facebook.presto.spi.resourceGroups.ResourceGroupConfigurationManagerFactory) EventListenerFactory(com.facebook.presto.spi.eventlistener.EventListenerFactory) ParametricType(com.facebook.presto.spi.type.ParametricType)

Example 2 with SystemAccessControlFactory

use of com.facebook.presto.spi.security.SystemAccessControlFactory in project presto by prestodb.

the class AccessControlManager method setSystemAccessControl.

@VisibleForTesting
protected void setSystemAccessControl(String name, Map<String, String> properties) {
    requireNonNull(name, "name is null");
    requireNonNull(properties, "properties is null");
    checkState(systemAccessControlLoading.compareAndSet(false, true), "System access control already initialized");
    log.info("-- Loading system access control --");
    SystemAccessControlFactory systemAccessControlFactory = systemAccessControlFactories.get(name);
    checkState(systemAccessControlFactory != null, "Access control %s is not registered", name);
    SystemAccessControl systemAccessControl = systemAccessControlFactory.create(ImmutableMap.copyOf(properties));
    this.systemAccessControl.set(systemAccessControl);
    log.info("-- Loaded system access control %s --", name);
}
Also used : SystemAccessControlFactory(com.facebook.presto.spi.security.SystemAccessControlFactory) SystemAccessControl(com.facebook.presto.spi.security.SystemAccessControl) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

SystemAccessControlFactory (com.facebook.presto.spi.security.SystemAccessControlFactory)2 ConnectorFactory (com.facebook.presto.spi.connector.ConnectorFactory)1 EventListenerFactory (com.facebook.presto.spi.eventlistener.EventListenerFactory)1 ResourceGroupConfigurationManagerFactory (com.facebook.presto.spi.resourceGroups.ResourceGroupConfigurationManagerFactory)1 SystemAccessControl (com.facebook.presto.spi.security.SystemAccessControl)1 ParametricType (com.facebook.presto.spi.type.ParametricType)1 Type (com.facebook.presto.spi.type.Type)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1