SynchronousTerminalListener
public class SynchronousTerminalListener : TerminalListener
Helper class for handle synchronous method calls in the {@link Terminal} class. Used internally by the {@link Terminal} instance to provide synchronous behavior. TimApi users can though use this class as base for their own synchronous use of the TimApi by using asynchronous function calls only. Provides the user with the ability to work also with intermediate completed request data in contrary to the synchronous method calls provided by {@link Terminal}.
The listener collects all response data received for all possible requests. The user can then examine those at a later time. The most recent request data is stored. {@link TimEvent} is not stored. Stores the last received {@link TimException}.
To use the listener call it like this:
{@code SynchronousTerminalListener listener = new SynchronousTerminalListener(); listener.prepareWait(RequestType.TRANSACTION); // run action potentially completing straight away listener.waitForRequestCompleted(); // work with the result in listener }
-
Run code block synchronously. Wait for request to complete collecting received events. Blocks the calling thread until the request completes. Clears all stored responses before waiting for the request to complete.
Declaration
Swift
public func runSynchronous(requestType: CRequestType, block: () throws -> ()) throws
-
Declaration
Swift
public func connectCompleted(event: TimEvent)
-
Declaration
Swift
public func disconnectCompleted(event: TimEvent)
-
Declaration
Swift
public func activateCompleted(event: TimEvent, data: ActivateResponse?)
-
Declaration
Swift
public func applicationInformationCompleted(event: TimEvent)
-
Declaration
Swift
public func balanceCompleted(event: TimEvent, data: BalanceResponse?)
-
Declaration
Swift
public func changeSettingsCompleted(event: TimEvent)
-
Declaration
Swift
public func deactivateCompleted(event: TimEvent, data: DeactivateResponse?)
-
Declaration
Swift
public func hardwareInformationCompleted(event: TimEvent, data: HardwareInformationResponse?)
-
Declaration
Swift
public func loginCompleted(event: TimEvent)
-
Declaration
Swift
public func logoutCompleted(event: TimEvent)
-
Declaration
Swift
public func rebootCompleted(event: TimEvent)
-
Declaration
Swift
public func reconciliationCompleted(event: TimEvent, data: ReconciliationResponse?)
-
Declaration
Swift
public func receiptRequestCompleted(event: TimEvent, data: ReceiptRequestResponse?)
-
Declaration
Swift
public func softwareUpdateCompleted(event: TimEvent, data: CUpdateStatus?)
-
Declaration
Swift
public func systemInformationCompleted(event: TimEvent, data: SystemInformationResponse?)
-
Declaration
Swift
public func transactionCompleted(event: TimEvent, data: TransactionResponse?)
-
Declaration
Swift
public func terminalStatusChanged(terminal: Terminal)
-
Called if an {@link Terminal#closeReaderAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func closeReaderCompleted(event: TimEvent)
-
Called if an {@link Terminal#openReaderAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func openReaderCompleted(event: TimEvent)
-
Called if an {@link Terminal#ejectCardAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func ejectCardCompleted(event: TimEvent)
-
Called if an {@link Terminal#openMaintenanceWindowAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func openMaintenanceWindowCompleted(event: TimEvent)
-
Called if an {@link Terminal#closeMaintenanceWindowAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func closeMaintenanceWindowCompleted(event: TimEvent)
-
Called if an {@link Terminal#activateServiceMenuAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func activateServiceMenuCompleted(event: TimEvent)
-
Called if an {@link Terminal#openDialogModeAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func openDialogModeCompleted(event: TimEvent)
-
Called if an {@link Terminal#closeDialogModeAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func closeDialogModeCompleted(event: TimEvent)
-
Called if an {@link Terminal#showSignatureCaptureAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func showSignatureCaptureCompleted(event: TimEvent, data: ShowSignatureCaptureResponse?)
-
Called if an {@link Terminal#showDialogAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func showDialogCompleted(event: TimEvent, data: ShowDialogResponse?)
-
Called if an {@link Terminal#sendCardCommandAsync} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func sendCardCommandCompleted(event: TimEvent, data: [CommandResponse]?)
-
Called if an {@link Terminal#balanceInquiryAsync()} started request finished.
Supported only if {@link com.six.timapi.constants.Guides#ADVANCED_RETAIL} is enabled. @param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func balanceInquiryCompleted(event: TimEvent, data: BalanceInquiryResponse?)
-
Called if an {@link Terminal#requestAlias()} started request finished.
@param event Contains the terminal sending the event and error information if the request failed.
Declaration
Swift
public func requestAliasCompleted(event: TimEvent, data: String?)
-
Request to wait for completion or null if not waiting.
Declaration
Swift
public private(set) var notifyRequestType: CRequestType?
-
Matching request has been received.
Declaration
Swift
public private(set) var notifyRequestCompleted: Bool
-
Last received exception or null if none.
Declaration
Swift
public private(set) var lastException: Errors? { get set }
-
Last activate response or null if none.
Declaration
Swift
public private(set) var lastActivateResponse: ActivateResponse? { get set }
-
Last balance response or null if none.
Declaration
Swift
public private(set) var lastBalanceResponse: BalanceResponse? { get set }
-
Last commit response or null if none.
Declaration
Swift
public private(set) var lastCommitResponse: PrintData? { get set }
-
Last counters request response or null if none.
Declaration
Swift
public private(set) var lastCountersRequestResponse: Counters? { get set }
-
Last deactivate response or null if none.
Declaration
Swift
public private(set) var lastDeactivateResponse: DeactivateResponse? { get set }
-
Last dcc rates response or null if none.
Declaration
Swift
public private(set) var lastDccRatesResponse: PrintData? { get set }
-
Last hardware information response or null if none.
Declaration
Swift
public private(set) var lastHardwareInformationResponse: HardwareInformationResponse? { get set }
-
Last reconciliation response or null if none.
Declaration
Swift
public private(set) var lastReconciliationResponse: ReconciliationResponse? { get set }
-
Last receipt request response or null if none.
Declaration
Swift
public private(set) var lastReceiptRequestResponse: ReceiptRequestResponse? { get set }
-
Last reconfig response or null if none.
Declaration
Swift
public private(set) var lastReconfigResponse: PrintData? { get set }
-
Last rollback response or null if none.
Declaration
Swift
public private(set) var lastRollbackResponse: PrintData? { get set }
-
Last software update response or null if none.
Declaration
Swift
public private(set) var lastSoftwareUpdateResponse: CUpdateStatus? { get set }
-
Last system information response or null if none.
Declaration
Swift
public private(set) var lastSystemInformationResponse: SystemInformationResponse? { get set }
-
Last transaction response or null if none.
Declaration
Swift
public private(set) var lastTransactionResponse: TransactionResponse? { get set }
-
Last show signature capture response or null if none.
Declaration
Swift
public private(set) var lastShowSignatureCaptureResponse: ShowSignatureCaptureResponse? { get set }
-
Last show dialog response or null if none.
Declaration
Swift
public private(set) var lastShowDialogResponse: ShowDialogResponse? { get set }
-
Last send card command response or nil if none.
Declaration
Swift
public private(set) var lastSendCardCommandResponse: [CommandResponse]? { get set }
-
Last balance inquiry response or null if none.
Declaration
Swift
public private(set) var lastBalanceInquiryResponse: BalanceInquiryResponse? { get set }
-
Last request alias transaction response or null if none.
Declaration
Swift
public private(set) var lastRequestAliasResponse: String? { get set }
-
Last query loyalty response or null if none.
Declaration
Swift
public private(set) var lastQueryLoyaltyResponse: CardData? { get set }
-
Last init transaction response or null if none.
Declaration
Swift
public private(set) var lastInitTransactionResponse: CardData? { get set }