Package org.apache.sling.testing.clients

# Class SystemPropertiesConfig

java.lang.Object
org.apache.sling.testing.clients.SystemPropertiesConfig

public class SystemPropertiesConfig extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CLIENT_USERAGENT_NAME`
System property for `getClientUserAgentName()` Prefixed by `CONFIG_PROP_PREFIX`
`static final String`
`CLIENT_USERAGENT_USEVERSION`
System property for `isClientUserAgentUsingVersion()` Prefixed by `CONFIG_PROP_PREFIX`
`static final String`
`CONFIG_PROP_PREFIX`
Prefix for IT-specific system properties
`static final String`
`HTTP_DELAY_PROP`
System property for `getHttpDelay()` Prefixed by `CONFIG_PROP_PREFIX`
`static final String`
`HTTP_LOG_RETRIES_PROP`
System property for `isHttpLogRetries()` Prefixed by `CONFIG_PROP_PREFIX`
`static final String`
`HTTP_RETRIES_DELAY_PROP`
System property for `getHttpRetriesDelay()` Prefixed by `CONFIG_PROP_PREFIX`
`static final String`
`HTTP_RETRIES_ERROR_CODES_PROP`
System property for `getHttpRetriesErrorCodes()` Prefixed by `CONFIG_PROP_PREFIX`
`static final String`
`HTTP_RETRIES_PROP`
System property for `getHttpRetries()` Prefixed by `CONFIG_PROP_PREFIX`

## Constructor Summary

Constructors
Constructor
Description
`SystemPropertiesConfig()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`getClientUserAgentName()`
Returns the default user-agent name of the `SlingClient`
`static String`
`getDefaultUserAgent()`
Returns the fully constructed default user-agent from system properties
`static long`
`getHttpDelay()`
Custom delay in milliseconds before an HTTP request goes through.
`static int`
`getHttpRetries()`
Number of http call retries in case of a 5XX response code
`static int`
`getHttpRetriesDelay()`
The delay in milliseconds between http retries
`static Collection<Integer>`
`getHttpRetriesErrorCodes()`
Comma-separated list of http response codes for which to retry the request If empty, all 5XX error codes will be retried
`static String`
`getPrefixedPropertyName(String prop)`
`static boolean`
`isClientUserAgentUsingVersion()`
Whether the user-agent of the `SlingClient` should be appended by the current library version
`static boolean`
`isHttpLogRetries()`
Whether to log or not http request retries

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### CONFIG_PROP_PREFIX

public static final String CONFIG_PROP_PREFIX
Prefix for IT-specific system properties

See Also:
  - Constant Field Values

### HTTP_DELAY_PROP

public static final String HTTP_DELAY_PROP
System property for `getHttpDelay()` Prefixed by `CONFIG_PROP_PREFIX`

See Also:
  - Constant Field Values

### HTTP_RETRIES_PROP

public static final String HTTP_RETRIES_PROP
System property for `getHttpRetries()` Prefixed by `CONFIG_PROP_PREFIX`

See Also:
  - Constant Field Values

### HTTP_RETRIES_DELAY_PROP

public static final String HTTP_RETRIES_DELAY_PROP
System property for `getHttpRetriesDelay()` Prefixed by `CONFIG_PROP_PREFIX`

See Also:
  - Constant Field Values

### HTTP_LOG_RETRIES_PROP

public static final String HTTP_LOG_RETRIES_PROP
System property for `isHttpLogRetries()` Prefixed by `CONFIG_PROP_PREFIX`

See Also:
  - Constant Field Values

### HTTP_RETRIES_ERROR_CODES_PROP

public static final String HTTP_RETRIES_ERROR_CODES_PROP
System property for `getHttpRetriesErrorCodes()` Prefixed by `CONFIG_PROP_PREFIX`

See Also:
  - Constant Field Values

### CLIENT_USERAGENT_NAME

public static final String CLIENT_USERAGENT_NAME
System property for `getClientUserAgentName()` Prefixed by `CONFIG_PROP_PREFIX`

See Also:
  - Constant Field Values

### CLIENT_USERAGENT_USEVERSION

public static final String CLIENT_USERAGENT_USEVERSION
System property for `isClientUserAgentUsingVersion()` Prefixed by `CONFIG_PROP_PREFIX`

See Also:
  - Constant Field Values

## Constructor Details

### SystemPropertiesConfig

public SystemPropertiesConfig()

## Method Details

### getPrefixedPropertyName

public static String getPrefixedPropertyName(String prop)

### getHttpDelay

public static long getHttpDelay()
Custom delay in milliseconds before an HTTP request goes through. Used by `DelayRequestInterceptor`

Returns:
  the delay in muliseconds

### getHttpRetries

public static int getHttpRetries()
Number of http call retries in case of a 5XX response code

Returns:
  the number of retries to be made

### getHttpRetriesDelay

public static int getHttpRetriesDelay()
The delay in milliseconds between http retries

Returns:
  the delay between http retries

### isHttpLogRetries

public static boolean isHttpLogRetries()
Whether to log or not http request retries

Returns:
  true if retries should be logged

### getHttpRetriesErrorCodes

public static Collection<Integer> getHttpRetriesErrorCodes()
Comma-separated list of http response codes for which to retry the request If empty, all 5XX error codes will be retried

Returns:
  a non-null collection with the http resonse codes

### getClientUserAgentName

public static String getClientUserAgentName()
Returns the default user-agent name of the `SlingClient`

Returns:
  default name

### isClientUserAgentUsingVersion

public static boolean isClientUserAgentUsingVersion()
Whether the user-agent of the `SlingClient` should be appended by the current library version

Returns:
  true if version should be appended

### getDefaultUserAgent

public static String getDefaultUserAgent()
Returns the fully constructed default user-agent from system properties

Returns:
  default user-agent