pzampino commented on code in PR #1057: URL: https://github.com/apache/knox/pull/1057#discussion_r2216653656
########## gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/hive/IcebergRestServiceModelGenerator.java: ########## @@ -0,0 +1,115 @@ +/* + * 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.knox.gateway.topology.discovery.cm.model.hive; + +import com.cloudera.api.swagger.client.ApiException; +import com.cloudera.api.swagger.model.ApiConfigList; +import com.cloudera.api.swagger.model.ApiRole; +import com.cloudera.api.swagger.model.ApiService; +import com.cloudera.api.swagger.model.ApiServiceConfig; +import org.apache.knox.gateway.topology.discovery.cm.ServiceModel; +import org.apache.knox.gateway.topology.discovery.cm.ServiceModelGeneratorHandleResponse; +import org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGenerator; + +import java.util.Locale; + +public class IcebergRestServiceModelGenerator extends AbstractServiceModelGenerator { + + public static final String SERVICE = "ICEBERG-REST"; + public static final String SERVICE_TYPE = "HIVE"; + public static final String ROLE_TYPE = "HIVEMETASTORE"; + + static final String HTTP_PORT = "hive_metastore_catalog_servlet_port"; + static final String HTTP_PATH = "hive_metastore_catalog_servlet_path"; + static final String REST_CATALOG_ENABLED = "hive_rest_catalog_enabled"; + + static final String DEFAULT_HTTP_PATH = "icecli"; + + @Override + public String getService() { + return SERVICE; + } + + @Override + public String getServiceType() { + return SERVICE_TYPE; + } + + @Override + public String getRoleType() { + return ROLE_TYPE; + } + + @Override + public ServiceModel.Type getModelType() { + return ServiceModel.Type.API; + } + + @Override + public ServiceModelGeneratorHandleResponse handles(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) { + final ServiceModelGeneratorHandleResponse response = super.handles(service, serviceConfig, role, roleConfig); + if (response.handled()) { + validateCatalogEnabled(serviceConfig, response); + } + return response; + } + + @Override + public ServiceModel generateService(ApiService service, + ApiServiceConfig serviceConfig, + ApiRole role, + ApiConfigList roleConfig, ApiServiceConfig coreSettingsConfig) throws ApiException { + String hostname = role.getHostRef().getHostname(); + String scheme = "http"; + String port = getHttpPort(serviceConfig); Review Comment: Does this service not have a separate HTTPS configuration? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@knox.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org