io.r2dbc.postgresql.PostgresqlConnectionFactoryProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of r2dbc-postgresql Show documentation
Show all versions of r2dbc-postgresql Show documentation
Reactive Relational Database Connectivity Driver Implementation for Postgresql
The newest version!
/*
* Copyright 2017 the original author or authors.
*
* Licensed 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
*
* https://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 io.r2dbc.postgresql;
import io.netty.handler.ssl.SslContextBuilder;
import io.r2dbc.postgresql.client.DefaultHostnameVerifier;
import io.r2dbc.postgresql.client.SSLMode;
import io.r2dbc.postgresql.codec.Codecs;
import io.r2dbc.postgresql.codec.Json;
import io.r2dbc.postgresql.extension.Extension;
import io.r2dbc.postgresql.util.Assert;
import io.r2dbc.postgresql.util.LogLevel;
import io.r2dbc.spi.ConnectionFactoryOptions;
import io.r2dbc.spi.ConnectionFactoryProvider;
import io.r2dbc.spi.Option;
import org.reactivestreams.Publisher;
import reactor.netty.resources.LoopResources;
import javax.net.ssl.HostnameVerifier;
import java.time.Duration;
import java.time.ZoneId;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TimeZone;
import java.util.function.Function;
import java.util.function.Supplier;
import static io.r2dbc.spi.ConnectionFactoryOptions.CONNECT_TIMEOUT;
import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE;
import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER;
import static io.r2dbc.spi.ConnectionFactoryOptions.HOST;
import static io.r2dbc.spi.ConnectionFactoryOptions.PASSWORD;
import static io.r2dbc.spi.ConnectionFactoryOptions.PORT;
import static io.r2dbc.spi.ConnectionFactoryOptions.PROTOCOL;
import static io.r2dbc.spi.ConnectionFactoryOptions.SSL;
import static io.r2dbc.spi.ConnectionFactoryOptions.USER;
/**
* An implementation of {@link ConnectionFactoryProvider} for creating {@link PostgresqlConnectionFactory}s.
*/
public final class PostgresqlConnectionFactoryProvider implements ConnectionFactoryProvider {
/**
* Application name.
*/
public static final Option APPLICATION_NAME = Option.valueOf("applicationName");
/**
* Auto-detect extensions.
*/
public static final Option AUTODETECT_EXTENSIONS = Option.valueOf("autodetectExtensions");
/**
* Compatibility query mode for cursored query execution.
*
* @since 0.8.7
*/
public static final Option COMPATIBILITY_MODE = Option.valueOf("compatibilityMode");
/**
* Error Response Log Level.
*/
public static final Option ERROR_RESPONSE_LOG_LEVEL = Option.valueOf("errorResponseLogLevel");
/**
* Extensions to register.
*
* @since 0.8.9
*/
public static final Option> EXTENSIONS = Option.valueOf("extensions");
/**
* Fetch Size.
*/
public static final Option FETCH_SIZE = Option.valueOf("fetchSize");
/**
* Force binary transfer.
*/
public static final Option FORCE_BINARY = Option.valueOf("forceBinary");
/**
* Host status recheck time.
*
* @since 1.0
*/
public static final Option HOST_RECHECK_TIME = Option.valueOf("hostRecheckTime");
/**
* Load balance hosts.
*
* @since 1.0
*/
public static final Option LOAD_BALANCE_HOSTS = Option.valueOf("loadBalanceHosts");
/**
* Lock timeout.
*
* @since 0.8.9
*/
public static final Option LOCK_WAIT_TIMEOUT = ConnectionFactoryOptions.LOCK_WAIT_TIMEOUT;
/**
* Event {@link LoopResources}.
*
* @since 0.8.5
*/
public static final Option LOOP_RESOURCES = Option.valueOf("loopResources");
/**
* Notice Response Log Level.
*/
public static final Option NOTICE_LOG_LEVEL = Option.valueOf("noticeLogLevel");
/**
* Connection options which are applied once after the connection has been created.
*/
public static final Option
© 2015 - 2024 Weber Informatics LLC | Privacy Policy