# Configuration files

This page provides information on configuring the WallStreet Adapter.

The configuration files describe on this page can be found under the `<framework_root>/global_config/overrides/WallStreetAdapter/etc` directory when the adapter is deployed to the [Caplin Deployment Framework](../caplin-platform/deployment-framework/index.md).

**❗ IMPORTANT**\
The WallStreet Adapter does not ship with a WSS client license and will not start without one. See [WSS client-licence files](#wss-client-licence-files) below.

## Adapter configuration files

The following configuration files are provided with the adapter.

### File: adapter.conf

Reserved for future use.

### File: adapter-properties.yaml

**Since**: 1.6.0 (incorporates file `permissions.yaml`, which was discontinued in 1.6.0)

WallStreet Adapter properties.

#### accountCodePrefix

WallStreet requires the account numbers for some types of account to be prefixed with a code.

**accountCodePrefix.prefixes map**

| Key | Default | Description |
| --- | --- | --- |
| type |  | Bank account type. |
| Prefix |  | The prefix to apply to the account code. |

Example:

```yaml
accountCodePrefix:
  prefixes:
    - type: BSB
      code: //AU
    - type: TRNO
      code: //CC
    - type: ABA
      code: //FW
    - type: UKSORT
      code: //SC
    - type: NZBA
      code: //NZ
```

#### caches.settlementInstructionCache.initialDelay

Initial time to wait before publishing first value.

**Default**: 0

```yaml
caches.settlementInstructionCache.initialDelay: 0
```

#### caches.settlementInstructionCache.period

The period of time between publishing subsequent values.

**Default**: 60

```yaml
caches.settlementInstructionCache.period: 60
```

#### caches.settlementInstructionCache.timeUnit

The time unit for `caches.settlementInstructionCache.initialDelay` and `caches.settlementInstructionCache.period` above. Valid values: `DAYS`, `HOURS`, `MICROSECONDS`, `MILLISECONDS`, `MINUTES`, `NANOSECONDS`, and `SECONDS`.

**Default**: SECONDS

```yaml
caches.settlementInstructionCache.timeUnit: SECONDS
```

#### caches.fxDealCache.initialDelay

Initial time to wait before publishing first value.

**Default**: 0

```yaml
caches.fxDealCache.initialDelay: 0
```

#### caches.fxDealCache.period

The period of time between publishing subsequent values.

**Default**: 60

```yaml
caches.fxDealCache.period: 60
```

#### caches.fxDealCache.timeUnit

The time unit for `caches.fxDealCache.initialDelay` and `caches.fxDealCache.period`. Valid values: `DAYS`, `HOURS`, `MICROSECONDS`, `MILLISECONDS`, `MINUTES`, `NANOSECONDS`, and `SECONDS`.

**Default**: SECONDS

```yaml
caches.fxDealCache.timeUnit: SECONDS
```

#### deadlines

The `deadlines` map defines the date and time of the default settlement-instruction (SI) confirmation deadline, and includes overrides for specific currencies.

If the currencies in an FX transaction have different SI confirmation deadlines, then the earliest deadline takes precedence and applies to all currencies in the transaction.

**deadlines map**

| Key | Default | Description |
| --- | --- | --- |
| displayTimezone | America/New_York | Time zone for the values of `deadlines: defaultCutOffTime` and `deadlines: cutOffTimes: cutOffTime`. Must be a valid [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) zone name. |
| defaultCutOffTime | 16:00 | The time-of-day of the default SI confirmation deadline. Format: `HH:MM` (in the timezone defined by `deadlines: displayTimezone`). Can be overridden for specific currencies in `deadlines: cutOffTimes`. |
| defaultNoticePeriod | 2 | The date of the default SI confirmation deadline, expressed as the number of business days prior to the date of settlement. Can be overridden for specific currencies in `deadlines: cutOffTimes`. |
| cutOffTimes |  | A sequence of maps defining currency-specific overrides to `defaultCutOffTime` and `defaultNoticePeriod`. For the map specification, see the next table. |

**Maps in the 'deadlines: cutOffTimes' sequence**

| Key | Default | Description |
| --- | --- | --- |
| currency |  | The name of the currency expressed as a standard three-letter currency code. |
| cutOffTime |  | The time-of-day of the SI confirmation deadline for this currency. Format: `HH:MM` (in the timezone defined by `deadlines: displayTimezone`). |
| noticePeriod |  | The date of the SI confirmation deadline for this currency, expressed as the number of business days prior to the date of settlement. |

Example:

```yaml
deadlines:
  displayTimezone: "America/New_York"
  defaultCutOffTime: "16:00"
  defaultNoticePeriod: 2
  cutOffTimes:
    - currency: "AED"
      cutOffTime: "12:00"
      noticePeriod: 1
```

#### enableTrustedSource

When set to `false`, trades with ad-hoc settlement instructions require manual authorisation by bank staff.

**Default**: false

```yaml
enableTrustedSource: false
```

#### fxDealBlotter.historic.days

Age (in days) of the oldest deal to display in the blotter.

**Default**: 30

```yaml
fxDealBlotter.historic.days: 30
```

#### fxDealBlotter.paging.size

Number of blotter entries requested at a time when populating the historical blotter.

**Default**: 500

```yaml
fxDealBlotter.historic.size: 500
```

#### permissions: actionRefRules

A sequence of maps that describe Action Ref rules destined for Caplin’s Permissioning Service.

Each map consists of a series of keyed-values that correspond to the parameters of the Caplin Java Permissioning API’s [PermissioningDataSource.createActionRefRule](https://docs.caplin.com/developer/api/permissioning_java/latest/com/caplin/permissioning/PermissioningDataSource.html#createActionRefRule-java.lang.String-java.util.Map-java.lang.String-java.lang.String-java.lang.String-) method.

For more information on permissioning, see [Caplin-Platform: Permissioning](../caplin-platform/platform-architecture/permissioning.md).

**Maps in the 'permissions: actionRefRules' sequence**

| Key | Default | Description |
| --- | --- | --- |
| subjectNameMatch |  | Message subject name (regular expression) |
| permissionNameSpace |  | Namespace under which a permission associated with this action must be defined. |
| actionRef |  | The name of the message field containing the name of the action (the 'verb') to be performed on the product (the 'object'). |
| productRef |  | The name of the message field containing the name of the product (the 'object') on which the action (the 'verb') is performed. Accepts the `ALL_PRODUCTS` wildcard. |

Example:

```yaml
permissions:
  actionRefRules:
    - subjectNameMatch: "^/PRIVATE/NOTIFICATIONS/.*"
      permissionNameSpace: "NOTIFICATION_OPERATIONS"
      actionRef: "NotificationOperation"
      productRef: "ALL_PRODUCTS"
```

#### permissions: actionRules

A sequence of maps that describe Action rules for Caplin’s Permissioning Service.

Each map consists of a series of keyed-values that correspond to the parameters of the Caplin Java Permissioning API’s [PermissioningDataSource.createActionRule](https://docs.caplin.com/developer/api/permissioning_java/latest/com/caplin/permissioning/PermissioningDataSource.html#createActionRule-java.lang.String-java.lang.String-java.lang.String-java.lang.String-) method.

For more information on permissioning, see [Caplin Platform: Permissioning](../caplin-platform/platform-architecture/permissioning.md).

**Maps in the 'permissions: actionRules' sequence**

| Key | Default | Description |
| --- | --- | --- |
| subjectNameMatch |  | Message subject name (regular expression) |
| permissionNameSpace |  | Namespace under which a permission associated with this action must be defined. |
| action |  | The name of the action (the 'verb'). |
| productRef |  | The name of the message field containing the name of the product (the 'object') on which the action (the 'verb') is performed. Accepts the `ALL_PRODUCTS` wildcard. |

Example:

```yaml
permissions:
  actionRules:
    - subjectNameMatch: "^/PRIVATE/PERSISTENCE/%u/CONTROL"
      permissionNameSpace: "PERSISTENCE_CONTROL"
      action: "PERSISTENCE-CONTROL"
      productRef: "ALL_PRODUCTS"
```

#### permissions: groups

A sequence of maps in which each map defines a permissioning group and the permissions granted to it.

**Maps in the 'permissions: groups' sequence**

| Key | Default | Description |
| --- | --- | --- |
| group |  | Name of the group |
| isWallStreetUserGroup | true |  |
| permissions |  | The permissions granted to the group. A sequence of maps, in which the keys of each map correspond to the parameters passed to the Java Permissioning API’s [Permissionable.applyPermission](https://docs.caplin.com/developer/api/permissioning_java/latest/com/caplin/permissioning/Permissionable.html#applyPermission-java.util.Set-java.lang.String-java.lang.String-com.caplin.permissioning.Authorization-) method. See next table for map specification. |

**Maps in the 'permissions: groups: permissions' sequence**

| Key | Default | Description |
| --- | --- | --- |
| subject |  | The name of the product |
| namespace |  | The namespace under which this permission is defined |
| action |  | The action to be performed on the product (`subject`) |
| authorization |  | Whether the action is allowed or denied. Valid values: ALLOW, DENY |

Example:

```yaml
groups:
  - name: "global"
    permissions:
      - subject: ".*"
        nameSpace: "NOTIFICATION_OPERATIONS"
        action: "DISMISS"
        authorization: "ALLOW"
```

#### status.initialDelay

Initial delay before the adapter first checks the status of a connection to WallStreet. For the time unit, see `status.timeUnit`.

**Default**: 0

```yaml
status.initialDelay: 0
```

#### status.period

How often the adapter should check the status of a connection to WallStreet when the last-known status is 'up'. For the time unit, see `status.timeUnit`.

**Default**: 30

```yaml
status.period: 30
```

#### status.timeUnit

The time unit used for `status.initialDelay` and `status.timeUnit`. Valid values: DAYS, HOURS, MICROSECONDS, MILLISECONDS, MINUTES, NANOSECONDS, SECONDS.

**Default**: SECONDS

```yaml
status.timeUnit: SECONDS
```

#### status.retry.delay

How often the adapter should check the status of the connection to Wallstreet when the last-known status is 'down'.

**Default**: 5

```yaml
status.retry.delay: 5
```

#### status.retry.timeUnit

The time unit used for `status.retry.timeUnit`. Valid values: DAYS, HOURS, MICROSECONDS, MILLISECONDS, MINUTES, NANOSECONDS, SECONDS.

**Default**: SECONDS

```yaml
status.retry.timeUnit: SECONDS
```

#### queues.unsettled

WallStreet queues containing unsettled trades. Formatted as a single string of single-letter queue names.

**Default**: 9PWw

```yaml
queues.unsettled: 9PWw
```

### File: app.properties

WSS client-library configuration file.

**Connection**

| Item | Default | Description |
| --- | --- | --- |
| objecttoolkit.typed | POOLED | **Do not change**. |
| objecttoolkit.server |  | **Required**. The hostname or IP address of your WSS core server. Example: `192.168.1.60` |
| objecttoolkit.port |  | **Required**. The port number of your WSS core server. Example: `8080` |
| objecttoolkit.user |  | **Required**. The username with which the Wallstreet Adapter authenticates with your WSS core server. Example: `bob` |
| objecttoolkit.pass |  | **Required**. The password with which the Wallstreet Adapter authenticates with your WSS core server. Example: `letmein` |

**Pool of physical socket connections**

| Item | Default | Description |
| --- | --- | --- |
| objecttoolkit.pool.preload | 4 | Number of idle connection objects with which to preload the pool. |
| objecttoolkit.pool.apache.minEvictableIdleTimeMillis | 1740000 | The minimum amount of time (in milliseconds) an object may sit idle in the pool before it is eligible for eviction due to idle time. Specify -1 to stop threads from being evicted on the basis of idle time alone. |
| objecttoolkit.pool.apache.timeBetweenEvictionRunsMillis | 30000 | Indicates how long the eviction thread should sleep before "runs" of examing idle objects. Specify -1 to disable the eviction of idle threads. |
| objecttoolkit.pool.apache.maxActive | -1 | Maximum number of connection objects, whether active or idle, that are allowed in the pool. Specify -1 for no limit. |
| objecttoolkit.pool.apache.maxIdle | -1 | Maximum number of connection objects that are allowed to sit idle in the pool. Specify -1 for no limit. |

**Pool of JBS user sessions**

| Item | Default | Description |
| --- | --- | --- |
| jbs.pool.apache.maxActive | -1 | Maximum number of connection objects, whether active or idle, that are allowed in the pool. Specify -1 for no limit. |
| jbs.pool.apache.maxIdle | -1 | Maximum number of connection objects that are allowed to sit idle in the pool. Specify -1 for no limit. |

**Licence file locations**

| Item | Default | Description |
| --- | --- | --- |
| objecttoolkit.license | license.txt | The location of the Wallstreet client licence file. |
| objecttoolkit.license.signature | signature.txt | The location of the Wallstreet client signature file. |
| jbs.server.wsscore.xml.file | wsscore.xml | The location of the Wallstreet client configuration file. |

**SSL/TLS configuration**

| Item | Default | Description |
| --- | --- | --- |
| objecttoolkit.keyStorePassPhrase |  | The pass phrase to the Java key store containing the adapter’s TLS certificates |
| objecttoolkit.sslKeyStore |  | The path to the Java key store holding the adapter’s TLS client certificate. |
| objecttoolkit.sslTrustStore |  | The path to the Java key store holding the adapter’s TLS trusted certificates. |
| objecttoolkit.sslKeyManager |  | For example, `Ibmx509` |
| objecttoolkit.sslSSLProvider |  | For example, `com.ibm.jsse2.IBMJSSEProvider2` |
| objecttoolkit.sslContext |  | Leave blank or specify `TLS`. Defaults to `TLS` if left blank. |

### File: datasource-overrides.conf

Contains the following DataSource configuration items:

* Peer definition ([add-peer](../caplin-platform/datasource/datasource-datasource-peers-configuration-part-1.md#add-peer)) for Liberator
* Peer definition ([add-peer](../caplin-platform/datasource/datasource-datasource-peers-configuration-part-1.md#add-peer)) for Transformer
* The location of the adapter’s log directory ([log-dir](../caplin-platform/datasource/datasource-logging-configuration.md#log-dir))
* The adapter’s logging level ([log-level](../caplin-platform/datasource/datasource-logging-configuration.md#log-level))

For more information on DataSource configuration, see [DataSource Configuration Reference: Introduction](../caplin-platform/datasource/datasource-datasource-configuration-reference-introduction.md).

### File: log4j2.xml

Configuration file for [Apache Log4J 2](https://logging.apache.org/log4j/2.x/).

For more information on Log4J configuration, see [Log4J Configuration Syntax](https://logging.apache.org/log4j/2.x/manual/configuration.html#configurationsyntax).

### File: permissions.yaml

**Discontinued**: 1.6.0 (moved to `adapter-properties.yaml` in 1.6.0)

Map of permissioning data that the Wallstreet Adapter supplies to the Caplin Permissioning Service, a Liberator auth module.

### File: trading-provider.properties

Caplin [Trading API for Java](https://docs.caplin.com/developer/api/trading_java/latest/) configuration file.

## WSS client-licence files

The Wall Street Systems client licence files are not provided with the adapter.

Request a client licence from Wall Street Systems and copy the licence files to the `<framework_root>/global_config/overrides/WallStreetAdapter/etc/` directory. Alternatively, copy the licence files to custom locations, and specify the custom locations using the configuration options in the [Licence file locations](#licence-file-locations) table above.

**Wall Street Systems client licence files**

| Licence file | Description |
| --- | --- |
| license.txt | Client licence. |
| signature.txt | Digital signature of the client licence. |
| wsscore.xml | Client licence configuration file. |

**❗ IMPORTANT**\
Do not edit the files of the client licence. The licence is digitally signed, and editing the licence invalidates it.
