-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/release/os/5.2' into CORE-18984/…
…mediator-configs # Conflicts: # gradle.properties
- Loading branch information
Showing
25 changed files
with
390 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
application/src/main/java/net/corda/v5/application/messaging/FlowSessionConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package net.corda.v5.application.messaging; | ||
|
||
import java.time.Duration; | ||
|
||
/** | ||
* Flow session configuration. Instances should be created using {@link Builder}. | ||
*/ | ||
public final class FlowSessionConfiguration { | ||
private final boolean requireClose; | ||
private final Duration timeout; | ||
|
||
private FlowSessionConfiguration(Builder builder) { | ||
this.requireClose = builder.requireClose; | ||
this.timeout = builder.timeout; | ||
} | ||
|
||
public boolean isRequireClose() { | ||
return requireClose; | ||
} | ||
|
||
public Duration getTimeout() { | ||
return timeout; | ||
} | ||
|
||
public static final class Builder { | ||
private boolean requireClose = true; | ||
private Duration timeout; | ||
|
||
/** | ||
* When set to true, the initiated party will send a close message after calling FlowSession.close() | ||
* and the initiating party will suspend and wait to receive the message when they call FlowSession.close(). | ||
* When set to false the session is marked as terminated immediately when close() is called. | ||
* Default value is true. | ||
* @param requireClose Flag that indicates whether close message is required. | ||
* @return {@link Builder}. | ||
*/ | ||
public Builder requireClose(boolean requireClose) { | ||
this.requireClose = requireClose; | ||
return this; | ||
} | ||
|
||
/** | ||
* The duration that Corda waits when no message has been received from a counterparty before | ||
* causing the session to error. If set to null, value set in Corda Configuration will be used. | ||
* Default value is null. | ||
* @param timeout Session timeout. | ||
* @return {@link Builder}. | ||
*/ | ||
public Builder timeout(Duration timeout) { | ||
this.timeout = timeout; | ||
return this; | ||
} | ||
|
||
/** | ||
* Builds a new instance of {@link FlowSessionConfiguration}. | ||
* @return a new instance of {@link FlowSessionConfiguration}. | ||
*/ | ||
public FlowSessionConfiguration build() { | ||
return new FlowSessionConfiguration(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...n/resources/avro/net/corda/data/crypto/wire/ops/encryption/request/DecryptRpcCommand.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"type": "record", | ||
"name": "DecryptRpcCommand", | ||
"namespace": "net.corda.data.crypto.wire.ops.encryption.request", | ||
"doc": "Request to decrypt the given byte array", | ||
"fields": [ | ||
{ | ||
"name": "category", | ||
"type": "string", | ||
"doc": "The category of HSM e.g. ENCRYPTION_SECRET, TLS, etc." | ||
}, | ||
{ | ||
"name": "alias", | ||
"type": ["null", "string"], | ||
"doc": "The symmetric key alias." | ||
}, | ||
{ | ||
"name": "cipherBytes", | ||
"type": "bytes", | ||
"doc": "The data to decrypt." | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
...n/resources/avro/net/corda/data/crypto/wire/ops/encryption/request/EncryptRpcCommand.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"type": "record", | ||
"name": "EncryptRpcCommand", | ||
"namespace": "net.corda.data.crypto.wire.ops.encryption.request", | ||
"doc": "Request to encrypt the given byte array", | ||
"fields": [ | ||
{ | ||
"name": "category", | ||
"type": "string", | ||
"doc": "The category of HSM e.g. ENCRYPTION_SECRET, TLS, etc." | ||
}, | ||
{ | ||
"name": "alias", | ||
"type": ["null", "string"], | ||
"doc": "The symmetric key alias." | ||
}, | ||
{ | ||
"name": "plainBytes", | ||
"type": "bytes", | ||
"doc": "The data to encrypt." | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
...urces/avro/net/corda/data/crypto/wire/ops/encryption/response/CryptoDecryptionResult.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "record", | ||
"name": "CryptoDecryptionResult", | ||
"namespace": "net.corda.data.crypto.wire.ops.encryption.response", | ||
"doc": "Decryption operation response", | ||
"fields": [ | ||
{ | ||
"name": "plainBytes", | ||
"type": "bytes", | ||
"doc": "Decrypted byte array" | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
...urces/avro/net/corda/data/crypto/wire/ops/encryption/response/CryptoEncryptionResult.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"type": "record", | ||
"name": "CryptoEncryptionResult", | ||
"namespace": "net.corda.data.crypto.wire.ops.encryption.response", | ||
"doc": "Encryption operation response", | ||
"fields": [ | ||
{ | ||
"name": "cipherBytes", | ||
"type": "bytes", | ||
"doc": "Encrypted byte array" | ||
} | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
...ources/avro/net/corda/data/crypto/wire/ops/encryption/response/DecryptionOpsResponse.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"type": "record", | ||
"name": "DecryptionOpsResponse", | ||
"namespace": "net.corda.data.crypto.wire.ops.encryption.response", | ||
"doc": "Response for crypto's decryption operations envelope", | ||
"fields": [ | ||
{ | ||
"name": "response", | ||
"type": [ | ||
"net.corda.data.crypto.wire.ops.encryption.response.CryptoDecryptionResult", | ||
"net.corda.data.crypto.wire.ops.encryption.response.EncryptionOpsError" | ||
], | ||
"doc": "Response's payload, depends on the requested operation" | ||
} | ||
] | ||
} |
Oops, something went wrong.