Package org.postgresql.util
Class PGPropertyUtil
- java.lang.Object
-
- org.postgresql.util.PGPropertyUtil
-
public class PGPropertyUtil extends java.lang.Object
routines to support PG properties
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description PGPropertyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.Integer
convertPgPortToInt(java.lang.String portStr)
converts PGPORT String to Integerstatic boolean
propertiesConsistencyCheck(java.util.Properties properties)
Validate properties.static java.lang.String
translatePGPropertyToPGService(java.lang.String propertyKey)
translate PGSERVICEFILE keys host, port, dbname Example: "PGHOST" becomes "host"static java.lang.String
translatePGServiceToPGProperty(java.lang.String serviceKey)
translate PGSERVICEFILE keys host, port, dbname Example: "host" becomes "PGHOST"
-
-
-
Method Detail
-
convertPgPortToInt
private static java.lang.Integer convertPgPortToInt(java.lang.String portStr)
converts PGPORT String to Integer- Parameters:
portStr
- value of port- Returns:
- value of port or null
-
propertiesConsistencyCheck
public static boolean propertiesConsistencyCheck(java.util.Properties properties)
Validate properties. Goal is to detect inconsistencies and report understandable messages- Parameters:
properties
- properties- Returns:
- false if errors found
-
translatePGServiceToPGProperty
public static java.lang.String translatePGServiceToPGProperty(java.lang.String serviceKey)
translate PGSERVICEFILE keys host, port, dbname Example: "host" becomes "PGHOST"- Parameters:
serviceKey
- key in pg_service.conf- Returns:
- translated property or the same value if translation is not needed
-
translatePGPropertyToPGService
public static java.lang.String translatePGPropertyToPGService(java.lang.String propertyKey)
translate PGSERVICEFILE keys host, port, dbname Example: "PGHOST" becomes "host"- Parameters:
propertyKey
- postgres property- Returns:
- translated property or the same value if translation is not needed
-
-