Top Description Fields Constructors Methods
org.postgresql.util

public Class PGPropertyUtil

extends Object
Class Inheritance
Imports
org.postgresql.PGProperty, org.checkerframework.checker.nullness.qual.Nullable, java.util.Locale, .Properties, java.util.logging.Level, .Logger

routines to support PG properties

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static @Nullable Integer

Returns:

value of port or null
convertPgPortToInt
(String
value of port
portStr
)

converts PGPORT String to Integer

public static boolean

Returns:

false if errors found
propertiesConsistencyCheck
(Properties
properties
properties
)

Validate properties.

public static String

Returns:

translated property or the same value if translation is not needed
translatePGPropertyToPGService
(String
postgres property
propertyKey
)

translate PGSERVICEFILE keys host, port, dbname Example: "PGHOST" becomes "host"

public static String

Returns:

translated property or the same value if translation is not needed
translatePGServiceToPGProperty
(String
key in pg_service.conf
serviceKey
)

translate PGSERVICEFILE keys host, port, dbname Example: "host" becomes "PGHOST"

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

PGPropertyUtilback to summary
public PGPropertyUtil()

Method Detail

convertPgPortToIntback to summary
private static @Nullable Integer convertPgPortToInt(String portStr)

converts PGPORT String to Integer

Parameters
portStr:String

value of port

Returns:@Nullable Integer

value of port or null

propertiesConsistencyCheckback to summary
public static boolean propertiesConsistencyCheck(Properties properties)

Validate properties. Goal is to detect inconsistencies and report understandable messages

Parameters
properties:Properties

properties

Returns:boolean

false if errors found

translatePGPropertyToPGServiceback to summary
public static String translatePGPropertyToPGService(String propertyKey)

translate PGSERVICEFILE keys host, port, dbname Example: "PGHOST" becomes "host"

Parameters
propertyKey:String

postgres property

Returns:String

translated property or the same value if translation is not needed

translatePGServiceToPGPropertyback to summary
public static String translatePGServiceToPGProperty(String serviceKey)

translate PGSERVICEFILE keys host, port, dbname Example: "host" becomes "PGHOST"

Parameters
serviceKey:String

key in pg_service.conf

Returns:String

translated property or the same value if translation is not needed