Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Commit ce78e31

Browse files
feat: init SAM context for next transaction (#54)
1 parent ba63cc3 commit ce78e31

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- `CardTransactionManager.initSamContextForNextTransaction` method.
810

911
## [1.7.0] - 2023-03-08
1012
### Added

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
group = org.calypsonet.terminal
22
title = Calypsonet Terminal Calypso API
33
description = API defining the needed interfaces to manage Calypso cards
4-
version = 1.7.1
4+
version = 1.8.0
55

66
javaSourceLevel = 1.6
77
javaTargetLevel = 1.6

src/main/java/org/calypsonet/terminal/calypso/CalypsoApiProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class CalypsoApiProperties {
2323
*
2424
* @since 1.0.0
2525
*/
26-
public static final String VERSION = "1.7";
26+
public static final String VERSION = "1.8";
2727

2828
/** Private constructor */
2929
private CalypsoApiProperties() {}

src/main/java/org/calypsonet/terminal/calypso/transaction/CardTransactionManager.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,4 +1417,29 @@ CardTransactionManager prepareChangeKey(
14171417
* @since 1.6.0
14181418
*/
14191419
CardTransactionManager prepareCancelSecureSession();
1420+
1421+
/**
1422+
* Prepares the SAM for the next transaction by anticipating all security context configuration
1423+
* operations.
1424+
*
1425+
* <p>This feature is only useful if the currently allocated SAM will be used for the next
1426+
* transaction. It is particularly relevant to optimize the transaction time in a ticketing
1427+
* context of user card validation.
1428+
*
1429+
* <p>For this optimization to be effective, it is necessary to call this method at the very end
1430+
* of the current transaction, i.e. <u>after</u> having notified the user of the access right
1431+
* (e.g. after opening the gate).
1432+
*
1433+
* @throws IllegalStateException In the following cases:
1434+
* <ul>
1435+
* <li>No {@link CardSecuritySetting} is available
1436+
* <li>Unprocessed card commands are pending
1437+
* </ul>
1438+
*
1439+
* @throws ReaderIOException If a communication error with the SAM reader occurs.
1440+
* @throws SamIOException If a communication error with the SAM occurs.
1441+
* @throws UnexpectedCommandStatusException If a command returns an unexpected status.
1442+
* @since 1.8.0
1443+
*/
1444+
void initSamContextForNextTransaction();
14201445
}

0 commit comments

Comments
 (0)