Class CTAPICardTerminalFactory
- java.lang.Object
-
- de.cardcontact.opencard.terminal.ctapi4ocf.CTAPICardTerminalFactory
-
- All Implemented Interfaces:
ICTAPIEvent,CardTerminalFactory,Pollable
public class CTAPICardTerminalFactory extends java.lang.Object implements CardTerminalFactory, Pollable, ICTAPIEvent
Implements a card terminal factory that can instantiate CT-API card terminals.
-
-
Field Summary
-
Fields inherited from interface opencard.core.terminal.CardTerminalFactory
TERMINAL_ADDRESS_ENTRY, TERMINAL_NAME_ENTRY, TERMINAL_TYPE_ENTRY
-
-
Constructor Summary
Constructors Constructor Description CTAPICardTerminalFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()deinitialize the CardTerminalFactoryvoidcreateCardTerminals(CardTerminalRegistry ctr, java.lang.String[] terminfo)create a specific CardTerminal object that knows how to handle a specific card terminal and register it to the CardTerminalRegistry.voiddetectCardTerminals(CardTerminalRegistry ctr, java.lang.String[] terminfo)voidopen()initialize the CardTerminalFactoryvoidpoll()Checks the status of the underlying terminal device.voidterminalsAdded(java.util.List<CTAPITerminal> terminals)voidterminalsRemoved(java.util.List<CTAPITerminal> terminals)
-
-
-
Method Detail
-
open
public void open() throws CardTerminalExceptionDescription copied from interface:CardTerminalFactoryinitialize the CardTerminalFactory- Specified by:
openin interfaceCardTerminalFactory- Throws:
CardTerminalException- thrown when error occurred while open initializes the factory.
-
close
public void close() throws CardTerminalExceptionDescription copied from interface:CardTerminalFactorydeinitialize the CardTerminalFactory- Specified by:
closein interfaceCardTerminalFactory- Throws:
CardTerminalException- thrown when error occurred while close deinitializes the factory.
-
terminalsAdded
public void terminalsAdded(java.util.List<CTAPITerminal> terminals)
- Specified by:
terminalsAddedin interfaceICTAPIEvent
-
terminalsRemoved
public void terminalsRemoved(java.util.List<CTAPITerminal> terminals)
- Specified by:
terminalsRemovedin interfaceICTAPIEvent
-
poll
public void poll() throws CardTerminalExceptionDescription copied from interface:PollableChecks the status of the underlying terminal device. Must generate a CardTerminalEvent if a card is being inserted or removed by calling CardTerminal.cardInserted() or CardTerminal.cardRemoved(). Alternatively the terminal could perform status checks itsself, e.g. by handling interrupts. Implementation Note: the CardTerminalRegistry calls this method of all registered Pollable terminals periodically. So the implementation of this method should not carry out lengthy operations but return as quickly as possible.- Specified by:
pollin interfacePollable- Throws:
CardTerminalException- Thrown when error occurred in poll-mechanism.
-
detectCardTerminals
public void detectCardTerminals(CardTerminalRegistry ctr, java.lang.String[] terminfo) throws CardTerminalException, TerminalInitException
-
createCardTerminals
public void createCardTerminals(CardTerminalRegistry ctr, java.lang.String[] terminfo) throws CardTerminalException, TerminalInitException
Description copied from interface:CardTerminalFactorycreate a specific CardTerminal object that knows how to handle a specific card terminal and register it to the CardTerminalRegistry.- Specified by:
createCardTerminalsin interfaceCardTerminalFactory- Parameters:
ctr- the CardTerminalRegistry for registration-processterminfo- the parameter array for the terminal. {TerminalName, TerminalType, factory-specific count of parameters....}.- Throws:
CardTerminalException- thrown when CardTerminal error occuredTerminalInitException- thrown when terminalInfo is incorrect or factory not able to support requested terminal type.
-
-