Search in sources :

Example 1 with SystemAccessControl

use of com.facebook.presto.spi.security.SystemAccessControl 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

SystemAccessControl (com.facebook.presto.spi.security.SystemAccessControl)1 SystemAccessControlFactory (com.facebook.presto.spi.security.SystemAccessControlFactory)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1