Top Description Fields Constructors Methods
org.postgresql.hostchooser

public sealed Enum HostRequirement

extends Enum<HostRequirement>
Class Inheritance
Imports
org.checkerframework.checker.nullness.qual.Nullable

Describes the required server type.

Field Summary

Modifier and TypeField and Description
public static final HostRequirement
public static final HostRequirement
master

Deprecated we no longer use the terms master or slave in the driver, or the PostgreSQL project.
public static final HostRequirement
public static final HostRequirement
public static final HostRequirement
public static final HostRequirement

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public abstract boolean
public static HostRequirement

Returns:

HostRequirement
getTargetServerType
(String
the value of targetServerType connection property
targetServerType
)

The postgreSQL project has decided not to use the term slave to refer to alternate servers.

public static HostRequirement
public static HostRequirement[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

anyback to summary
public static final HostRequirement any
masterback to summary
public static final HostRequirement master

Deprecated

we no longer use the terms master or slave in the driver, or the PostgreSQL project.

Annotations
@Deprecated
preferPrimaryback to summary
public static final HostRequirement preferPrimary
preferSecondaryback to summary
public static final HostRequirement preferSecondary
primaryback to summary
public static final HostRequirement primary
secondaryback to summary
public static final HostRequirement secondary

Constructor Detail

HostRequirementback to summary
private HostRequirement()

Method Detail

allowConnectingToback to summary
public abstract boolean allowConnectingTo(@Nullable HostStatus status)
getTargetServerTypeback to summary
public static HostRequirement getTargetServerType(String targetServerType)

The postgreSQL project has decided not to use the term slave to refer to alternate servers. secondary or standby is preferred. We have arbitrarily chosen secondary. As of Jan 2018 in order not to break existing code we are going to accept both slave or secondary for names of alternate servers.

The current policy is to keep accepting this silently but not document slave, or slave preferSlave

As of Jul 2018 silently deprecate the use of the word master as well

Parameters
targetServerType:String

the value of targetServerType connection property

Returns:HostRequirement

HostRequirement

valueOfback to summary
public static HostRequirement valueOf(String name)
valuesback to summary
public static HostRequirement[] values()