blob: 942660ad406e618452fb4ec3e9f728d18f928462 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.phoenix.queryserver.server;
import java.util.Collections;
import java.util.List;
import org.apache.calcite.avatica.server.AvaticaServerConfiguration;
import org.apache.calcite.avatica.server.ServerCustomizer;
import org.apache.hadoop.conf.Configuration;
import org.eclipse.jetty.server.Server;
/**
* Creates customizers for the underlying Avatica HTTP server.
* Allows for fine grained control of authentication, etc.
*/
public interface ServerCustomizersFactory {
/**
* Creates a list of customizers that will customize the server.
* @param conf Configuration to use
* @param avaticaServerConfiguration to use in case custom-auth is enabled
* @return List of server suctomizers
*/
List<ServerCustomizer<Server>> createServerCustomizers(Configuration conf, AvaticaServerConfiguration avaticaServerConfiguration);
/**
* Factory that creates an empty list of customizers.
*/
class ServerCustomizersFactoryImpl implements ServerCustomizersFactory {
private static final List<ServerCustomizer<Server>> EMPTY_LIST = Collections.emptyList();
@Override
public List<ServerCustomizer<Server>> createServerCustomizers(Configuration conf,
AvaticaServerConfiguration avaticaServerConfiguration) {
return EMPTY_LIST;
}
}
}