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 void
close()
deinitialize the CardTerminalFactoryvoid
createCardTerminals(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.void
detectCardTerminals(CardTerminalRegistry ctr, java.lang.String[] terminfo)
void
open()
initialize the CardTerminalFactoryvoid
poll()
Checks the status of the underlying terminal device.void
terminalsAdded(java.util.List<CTAPITerminal> terminals)
void
terminalsRemoved(java.util.List<CTAPITerminal> terminals)
-
-
-
Method Detail
-
open
public void open() throws CardTerminalException
Description copied from interface:CardTerminalFactory
initialize the CardTerminalFactory- Specified by:
open
in interfaceCardTerminalFactory
- Throws:
CardTerminalException
- thrown when error occurred while open initializes the factory.
-
close
public void close() throws CardTerminalException
Description copied from interface:CardTerminalFactory
deinitialize the CardTerminalFactory- Specified by:
close
in interfaceCardTerminalFactory
- Throws:
CardTerminalException
- thrown when error occurred while close deinitializes the factory.
-
terminalsAdded
public void terminalsAdded(java.util.List<CTAPITerminal> terminals)
- Specified by:
terminalsAdded
in interfaceICTAPIEvent
-
terminalsRemoved
public void terminalsRemoved(java.util.List<CTAPITerminal> terminals)
- Specified by:
terminalsRemoved
in interfaceICTAPIEvent
-
poll
public void poll() throws CardTerminalException
Description copied from interface:Pollable
Checks 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:
poll
in 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:CardTerminalFactory
create a specific CardTerminal object that knows how to handle a specific card terminal and register it to the CardTerminalRegistry.- Specified by:
createCardTerminals
in 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.
-
-