public class RpcPropertyDefs
extends java.lang.Object
The intention here is to simply centralize property key names so end users have some idea what's available and what each key's semantics are. This is NOT intended as a full property repository -- property management is generally up to individual classes and packages.
Note that in general, all properties can have an optional short form ("NICK", Anglo-English for nickname...) which is typically just the full form without the cumbersome com.perforce.whatever prefix; use of the short form is particularly convenient for passing in properties through the url mechanism, but you have to be very careful that there are no conflicting system or environmental properties...
Note that if you add a property somewhere that's likely to be useful to end users, you should use the mechanism here to document it.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RPC_APPLICATION_NAME_NICK
If this property is set, attempt to set the underlying RPC protocol 'app'
tag to the associated value.
|
static int |
RPC_DEFAULT_FILE_BUF_SIZE
Default size in bytes of the "standard" file I/O buffer.
|
static java.lang.String |
RPC_DEFAULT_FILE_BUF_SIZE_NICK
Short form for the RPC_DEFAULT_FILE_BUF_SIZE property key.
|
static int |
RPC_DEFAULT_FILETYPE_PEEK_SIZE
Default size in bytes of the "peek" we take into local files to try
to infer from the contents what type the file is.
|
static java.lang.String |
RPC_DEFAULT_PROPERTY_DELIMITER
The default property delimiter for RPC properties.
|
static int |
RPC_DEFAULT_QUEUE_SIZE
Default blocking queue size used in RPC send / recv queues; size
is in elements.
|
static java.lang.String |
RPC_DEFAULT_QUEUE_SIZE_NICK
If this property is set, attempt to set the underlying RPC connection's
queue lengths to the associated value, in elements.
|
static int |
RPC_DEFAULT_RECV_BYTE_BUF_SIZE
Default size in bytes of the "standard" recv byte buffer.
|
static java.lang.String |
RPC_DEFAULT_RECV_BYTE_BUF_SIZE_NICK
Short form for the RPC_DEFAULT_RECV_BYTE_BUF_SIZE property key.
|
static int |
RPC_DEFAULT_SECURE_CLIENT_CERT_VALIDATE
Default for Certificate validation Method
|
static int |
RPC_DEFAULT_SECURE_CLIENT_TRUST_NAME
Default for Certificate validation Method
|
static java.lang.String |
RPC_DEFAULT_SECURE_SOCKET_ENABLED_PROTOCOLS
Default secure socket enabled protocol versions.
|
static java.lang.String |
RPC_DEFAULT_SECURE_SOCKET_PROTOCOL
Default secure socket protocol.
|
static boolean |
RPC_DEFAULT_SECURE_SOCKET_SET_ENABLED_PROTOCOLS
Default secure socket set enabled protocols.
|
static boolean |
RPC_DEFAULT_SECURE_SOCKET_TRUST_ALL
Default secure socket trust all certificates (i.e.
|
static int |
RPC_DEFAULT_SEND_BYTE_BUF_SIZE
Default size in bytes of the "standard" send byte buffer.
|
static java.lang.String |
RPC_DEFAULT_SEND_BYTE_BUF_SIZE_NICK
Short form for the RPC_DEFAULT_SEND_BYTE_BUF_SIZE property key.
|
static java.lang.String |
RPC_PROPERTY_PREFIX
The standard property name prefix for all RPC properties.
|
static java.lang.String |
RPC_RELAX_CMD_NAME_CHECKS_NICK
If this property is set and equals "true", do not perform
command metadata checks in the RPC layer.
|
static java.lang.String |
RPC_SECURE_CLIENT_CERT_VALIDATE_NICK
Client Certificate validation Method, corresponds to p4api ssl.client.cert.validate
|
static java.lang.String |
RPC_SECURE_CLIENT_TRUST_NAME_NICK
P4TRUST file entries, corresponds to p4api ssl.client.trust.name
|
static java.lang.String |
RPC_SECURE_SOCKET_ENABLED_PROTOCOLS_NICK
If this property is set, attempt to set enabled protocol versions
(SSLSocket.setEnabledProtocols()) for the connection.
|
static java.lang.String |
RPC_SECURE_SOCKET_PROTOCOL_NICK
If this property is set, attempt to instantiate the SSLContext with the
associated value.
|
static java.lang.String |
RPC_SECURE_SOCKET_SET_ENABLED_PROTOCOLS_NICK
If this property is set and equals "false", do not attempt to set enabled
protocol versions (SSLSocket.setEnabledProtocols()) for the connection
and use the protocol versions currently enabled for the connection.
|
static java.lang.String |
RPC_SECURE_SOCKET_TRUST_ALL_NICK
If this property is set and equals "false", do not trust all certificates.
|
static int[] |
RPC_SOCKET_PERFORMANCE_PREFERENCES_DEFAULT
Default socket performance preferences are described by three integers
whose values indicate the relative importance of short connection time,
low latency, and high bandwidth.
|
static java.lang.String |
RPC_SOCKET_PERFORMANCE_PREFERENCES_NICK
If this property is set, attempt to set the underlying RPC socket's
performance preferences to the associated values, in integers, delimited
by commas.
|
static int |
RPC_SOCKET_POOL_DEFAULT_SIZE
Default number of sockets retained in pool
|
static java.lang.String |
RPC_SOCKET_POOL_SIZE_NICK
Number of sockets to retain in pool when released
|
static java.lang.String |
RPC_SOCKET_RECV_BUF_SIZE_NICK
If this property is set, attempt to set the underlying RPC socket's
system receive buffer size to the associated value, in bytes.
|
static java.lang.String |
RPC_SOCKET_SEND_BUF_SIZE_NICK
If this property is set, attempt to set the underlying RPC socket's
system send buffer size to the associated value, in bytes.
|
static int |
RPC_SOCKET_SO_TIMEOUT_DEFAULT
Default number of milliseconds to use for RPC socket read or write timeouts.
|
static java.lang.String |
RPC_SOCKET_SO_TIMEOUT_NICK
The number of milliseconds to use for RPC socket read or write timeouts.
|
static boolean |
RPC_SOCKET_TCP_NO_DELAY_DEFAULT
Default setting for enable/disable TCP_NODELAY (disable/enable Nagle's
algorithm).
|
static java.lang.String |
RPC_SOCKET_TCP_NO_DELAY_NICK
If this property is set, attempt to use the associated value to
enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).
|
static java.lang.String |
RPC_SOCKET_USE_KEEPALIVE_NICK
If this property is set and starts with "n" or "N", DON'T use
the socket keepalive option.
|
Constructor and Description |
---|
RpcPropertyDefs() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getProperty(java.util.Properties props,
java.lang.String nick)
Convenience method to first try to get the short form from the passed-in
properties, then try for the long form.
|
static java.lang.String |
getProperty(java.util.Properties props,
java.lang.String nick,
java.lang.String defaultValue)
Convenience method to first try to get the short form from the passed-in
properties, then try for the long form.
|
static boolean |
getPropertyAsBoolean(java.util.Properties props,
java.lang.String nick,
boolean defaultValue)
Return a named property a boolean, if possible.
|
static int |
getPropertyAsInt(java.util.Properties props,
java.lang.String nick,
int defaultValue)
Return a named property as an int, if possible.
|
static int[] |
getPropertyAsIntArray(java.util.Properties props,
java.lang.String nick,
java.lang.String delimiter,
int[] defaultValues)
Return a named property as an int array, if possible.
|
public static final java.lang.String RPC_PROPERTY_PREFIX
public static final java.lang.String RPC_DEFAULT_PROPERTY_DELIMITER
public static final int RPC_DEFAULT_SEND_BYTE_BUF_SIZE
public static final int RPC_DEFAULT_RECV_BYTE_BUF_SIZE
public static final java.lang.String RPC_DEFAULT_SEND_BYTE_BUF_SIZE_NICK
public static final java.lang.String RPC_DEFAULT_RECV_BYTE_BUF_SIZE_NICK
public static final int RPC_DEFAULT_FILE_BUF_SIZE
public static final java.lang.String RPC_DEFAULT_FILE_BUF_SIZE_NICK
public static final int RPC_DEFAULT_FILETYPE_PEEK_SIZE
public static final boolean RPC_SOCKET_TCP_NO_DELAY_DEFAULT
public static final java.lang.String RPC_SOCKET_TCP_NO_DELAY_NICK
public static final java.lang.String RPC_SOCKET_USE_KEEPALIVE_NICK
public static final int RPC_SOCKET_SO_TIMEOUT_DEFAULT
public static final java.lang.String RPC_SOCKET_SO_TIMEOUT_NICK
public static final int[] RPC_SOCKET_PERFORMANCE_PREFERENCES_DEFAULT
public static final java.lang.String RPC_SOCKET_PERFORMANCE_PREFERENCES_NICK
The absolute values of the integers are irrelevant; in order to choose a protocol the values are simply compared, with larger values indicating stronger preferences. Negative values represent a lower priority than positive values.
If the application prefers short connection time over both low latency and high bandwidth, for example, then it could invoke this method with the values (1, 0, 0). If the application prefers high bandwidth above low latency, and low latency above short connection time, then it could invoke this method with the values (0, 1, 2).
public static final java.lang.String RPC_SOCKET_RECV_BUF_SIZE_NICK
public static final java.lang.String RPC_SOCKET_SEND_BUF_SIZE_NICK
public static final int RPC_DEFAULT_QUEUE_SIZE
public static final java.lang.String RPC_DEFAULT_QUEUE_SIZE_NICK
public static final java.lang.String RPC_SOCKET_POOL_SIZE_NICK
public static final int RPC_SOCKET_POOL_DEFAULT_SIZE
public static final java.lang.String RPC_SECURE_SOCKET_TRUST_ALL_NICK
public static final boolean RPC_DEFAULT_SECURE_SOCKET_TRUST_ALL
public static final java.lang.String RPC_SECURE_SOCKET_PROTOCOL_NICK
Use Security.getProviders(), Provider.getServices() and Service.getAlgorithm() to list all the providers and the algorithms supporter.
public static final java.lang.String RPC_DEFAULT_SECURE_SOCKET_PROTOCOL
public static final java.lang.String RPC_SECURE_CLIENT_CERT_VALIDATE_NICK
0: always use the P4TRUST mechanism. This is pre 2022.1 behavior.
1: validate the certificate chain (default)
2: validate the subject matches the P4PORT. The chain is not validated. but the CN of the certificate is compared to the host in the P4PORT.
public static final int RPC_DEFAULT_SECURE_CLIENT_CERT_VALIDATE
public static final java.lang.String RPC_SECURE_CLIENT_TRUST_NAME_NICK
0: Only IP address This is pre 2022.1 behavior.
1: both IP and hostname (default)
2: Only hostname The chain is not validated. but the CN of the certificate is compared to the host in the P4PORT.
public static final int RPC_DEFAULT_SECURE_CLIENT_TRUST_NAME
public static final java.lang.String RPC_SECURE_SOCKET_SET_ENABLED_PROTOCOLS_NICK
public static final boolean RPC_DEFAULT_SECURE_SOCKET_SET_ENABLED_PROTOCOLS
public static final java.lang.String RPC_SECURE_SOCKET_ENABLED_PROTOCOLS_NICK
Use SSLSocket.getSupportedProtocols() and SSLSocket.getEnabledProtocols() to list all supported and enabled protocol versions for the connection.
public static final java.lang.String RPC_DEFAULT_SECURE_SOCKET_ENABLED_PROTOCOLS
The current server (12.1) limit the protocol version support to the IETF-standard TLSv1.
public static final java.lang.String RPC_RELAX_CMD_NAME_CHECKS_NICK
public static final java.lang.String RPC_APPLICATION_NAME_NICK
public static java.lang.String getProperty(java.util.Properties props, java.lang.String nick)
Note: this method is null safe, i.e. if either or both props or nick is null, it simply returns null.
props
- propsnick
- nickpublic static java.lang.String getProperty(java.util.Properties props, java.lang.String nick, java.lang.String defaultValue)
Note: this method is null safe, i.e. if either or both props or nick is null, it simply returns null.
props
- propsnick
- nickdefaultValue
- defaultValuepublic static int getPropertyAsInt(java.util.Properties props, java.lang.String nick, int defaultValue)
Will log to P4JLog any conversion error as a warning.
Note: this method is null safe, i.e. if either or both props or nick is null, it simply returns defaultValue.
props
- propsnick
- nickdefaultValue
- defaultValuepublic static int[] getPropertyAsIntArray(java.util.Properties props, java.lang.String nick, java.lang.String delimiter, int[] defaultValues)
Will log to P4JLog any conversion error as a warning.
Note: this method is null safe, i.e. if either or both props or nick is null, it simply returns an empty int array.
props
- propsnick
- nickdelimiter
- delimiterdefaultValues
- defaultValuespublic static boolean getPropertyAsBoolean(java.util.Properties props, java.lang.String nick, boolean defaultValue)
Will log to P4JLog any conversion error as a warning.
Note: this method is null safe, i.e. if either or both props or nick is null, it simply returns defaultValue.
props
- propsnick
- nickdefaultValue
- defaultValue