Search in sources :

Example 1 with ApiConfigs

use of com.google.api.services.discovery.model.ApiConfigs in project endpoints-java by cloudendpoints.

the class ProxyingDiscoveryProvider method getDirectory.

@Override
public DirectoryList getDirectory(String root) throws InternalServerErrorException {
    try {
        Map<ApiKey, String> configStrings = configWriter.writeConfig(rewriteConfigsWithRoot(getAllApiConfigs(), root));
        ApiConfigs configs = new ApiConfigs();
        configs.setConfigs(Lists.newArrayList(configStrings.values()));
        return discovery.apis().generateDirectory(configs).execute();
    } catch (IOException | ApiConfigException e) {
        logger.atSevere().withCause(e).log("Could not generate or cache directory");
        throw new InternalServerErrorException("Internal Server Error", e);
    }
}
Also used : ApiKey(com.google.api.server.spi.config.model.ApiKey) ApiConfigException(com.google.api.server.spi.config.ApiConfigException) InternalServerErrorException(com.google.api.server.spi.response.InternalServerErrorException) IOException(java.io.IOException) ApiConfigs(com.google.api.services.discovery.model.ApiConfigs)

Aggregations

ApiConfigException (com.google.api.server.spi.config.ApiConfigException)1 ApiKey (com.google.api.server.spi.config.model.ApiKey)1 InternalServerErrorException (com.google.api.server.spi.response.InternalServerErrorException)1 ApiConfigs (com.google.api.services.discovery.model.ApiConfigs)1 IOException (java.io.IOException)1