Skip to content

Commit fce6e5d

Browse files
authored
Address thread-safety concerns raised in #357 (#370)
* Address thread-safety concerns raised in #357 * Add missing property for merging of DefaultsConfigContext
1 parent bf74626 commit fce6e5d

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

java-manta-client-unshaded/src/main/java/com/joyent/manta/config/BaseChainedConfigContext.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,139 +22,139 @@ public abstract class BaseChainedConfigContext implements SettableConfigContext<
2222
/**
2323
* Manta service endpoint.
2424
*/
25-
private String mantaURL;
25+
private volatile String mantaURL;
2626

2727
/**
2828
* Account associated with the Manta service.
2929
*/
30-
private String account;
30+
private volatile String account;
3131

3232
/**
3333
* RSA key fingerprint of the private key used to access Manta.
3434
*/
35-
private String mantaKeyId;
35+
private volatile String mantaKeyId;
3636

3737
/**
3838
* Path on the filesystem to the private RSA key used to access Manta.
3939
*/
40-
private String mantaKeyPath;
40+
private volatile String mantaKeyPath;
4141

4242
/**
4343
* General connection timeout for the Manta service.
4444
*/
45-
private Integer timeout;
45+
private volatile Integer timeout;
4646

4747
/**
4848
* Number of times to retry failed requests.
4949
*/
50-
private Integer retries;
50+
private volatile Integer retries;
5151

5252
/**
5353
* The maximum number of open connections to the Manta API.
5454
*/
55-
private Integer maxConnections;
55+
private volatile Integer maxConnections;
5656

5757
/**
5858
* Private key content. This shouldn't be set if the MantaKeyPath is set.
5959
*/
60-
private String privateKeyContent;
60+
private volatile String privateKeyContent;
6161

6262
/**
6363
* Optional password for private key.
6464
*/
65-
private String password;
65+
private volatile String password;
6666

6767
/**
6868
* Size of buffer in bytes to use to buffer streams of HTTP data.
6969
*/
70-
private Integer httpBufferSize;
70+
private volatile Integer httpBufferSize;
7171

7272
/**
7373
* Comma delimited list of supported TLS protocols.
7474
*/
75-
private String httpsProtocols;
75+
private volatile String httpsProtocols;
7676

7777
/**
7878
* Comma delimited list of supported TLS ciphers.
7979
*/
80-
private String httpsCipherSuites;
80+
private volatile String httpsCipherSuites;
8181

8282
/**
8383
* Flag indicating if HTTP signatures are turned off.
8484
*/
85-
private Boolean noAuth;
85+
private volatile Boolean noAuth;
8686

8787
/**
8888
* Flag indicating if HTTP signature native code generation is turned off.
8989
*/
90-
private Boolean disableNativeSignatures;
90+
private volatile Boolean disableNativeSignatures;
9191

9292
/**
9393
* Time in milliseconds to cache HTTP signature headers.
9494
*/
95-
private Integer tcpSocketTimeout;
95+
private volatile Integer tcpSocketTimeout;
9696

9797
/**
9898
* Time in milliseconds to wait for a connection from the connection pool.
9999
*/
100-
private Integer connectionRequestTimeout;
100+
private volatile Integer connectionRequestTimeout;
101101

102102
/**
103103
* Flag indicating if we verify the uploaded file's checksum against the
104104
* server's checksum (MD5).
105105
*/
106-
private Boolean verifyUploads;
106+
private volatile Boolean verifyUploads;
107107

108108
/**
109109
* Number of bytes to read into memory for a streaming upload before
110110
* deciding if we want to load it in memory before send it.
111111
*/
112-
private Integer uploadBufferSize;
112+
private volatile Integer uploadBufferSize;
113113

114114
/**
115115
* Flag indicating when client-side encryption is enabled.
116116
*/
117-
private Boolean clientEncryptionEnabled;
117+
private volatile Boolean clientEncryptionEnabled;
118118

119119
/**
120120
* The unique identifier of the key used for encryption.
121121
*/
122-
private String encryptionKeyId;
122+
private volatile String encryptionKeyId;
123123

124124
/**
125125
* The client encryption algorithm name in the format of
126126
* <code>cipher/mode/padding state</code>.
127127
*/
128-
private String encryptionAlgorithm;
128+
private volatile String encryptionAlgorithm;
129129

130130
/**
131131
* Flag indicating when downloading unencrypted files is allowed in
132132
* encryption mode.
133133
*/
134-
private Boolean permitUnencryptedDownloads;
134+
private volatile Boolean permitUnencryptedDownloads;
135135

136136
/**
137137
* Enum specifying if we are in strict ciphertext authentication mode or not.
138138
*/
139-
private EncryptionAuthenticationMode encryptionAuthenticationMode;
139+
private volatile EncryptionAuthenticationMode encryptionAuthenticationMode;
140140

141141
/**
142142
* Path to the private encryption key on the filesystem (can't be used if
143143
* private key bytes is not null).
144144
*/
145-
private String encryptionPrivateKeyPath;
145+
private volatile String encryptionPrivateKeyPath;
146146

147147
/**
148148
* Private encryption key data (can't be used if private key path is not null).
149149
*/
150-
private byte[] encryptionPrivateKeyBytes;
150+
private volatile byte[] encryptionPrivateKeyBytes;
151151

152152
/**
153153
* Flag indicating the the mantaKeyPath has been set only by the defaults.
154154
* True = set by defaults.
155155
* False = overwritten by non-defaults.
156156
*/
157-
private boolean mantaKeyPathSetOnlyByDefaults = false;
157+
private volatile boolean mantaKeyPathSetOnlyByDefaults = false;
158158

159159
/** Singleton instance of default configuration for easy reference. */
160160
public static final ConfigContext DEFAULT_CONFIG =

0 commit comments

Comments
 (0)