Class SelectDestination
java.lang.Object
org.jpos.transaction.participant.SelectDestination
- All Implemented Interfaces:
Configurable, XmlConfigurable, TransactionConstants, TransactionParticipant
public class SelectDestination
extends Object
implements TransactionParticipant, Configurable, XmlConfigurable
Transaction participant that picks a routing destination for an inbound
request based on the cardholder's BIN ranges and PAN regular expressions
declared in its XML configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInclusive numeric BIN range mapped to a routing destination. -
Field Summary
Fields inherited from interface TransactionConstants
ABORTED, FAIL, NO_JOIN, PAUSE, PREPARED, READONLY, RETRYModifier and TypeFieldDescriptionstatic final intTransaction has been aborted.static final intShortcut for a read-only, non-joining abort (READONLY | NO_JOIN).static final intThis participant does not join the transactionstatic final intTransaction is paused.static final intTransaction has been prepared successfully.static final intContext has not been modified (no need to persist a snapshot)static final intTransaction should be retried. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintprepare(long id, Serializable context) Called by TransactionManager in preparation for a transactionvoidsetConfiguration(org.jdom2.Element xml) SelectDestination expects an XML configuration in the following format:voidConfigures this object with the suppliedConfiguration.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TransactionParticipant
abort, commitModifier and TypeMethodDescriptiondefault voidabort(long id, Serializable context) Called by TransactionManager upon transaction commit.default voidcommit(long id, Serializable context) Called by TransactionManager upon transaction commit.
-
Constructor Details
-
SelectDestination
public SelectDestination()Default constructor; no instance state to initialise.
-
-
Method Details
-
prepare
Description copied from interface:TransactionParticipantCalled by TransactionManager in preparation for a transaction- Specified by:
preparein interfaceTransactionParticipant- Parameters:
id- the Transaction identifiercontext- transaction context- Returns:
- PREPARED or ABORTED (| NO_JOIN | READONLY)
-
setConfiguration
Description copied from interface:ConfigurableConfigures this object with the suppliedConfiguration.- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration object
-
setConfiguration
SelectDestination expects an XML configuration in the following format:<endpoint destination="XXX"> 4000000..499999 4550000..455999 5 </endpoint>- Specified by:
setConfigurationin interfaceXmlConfigurable- Parameters:
xml- Configuration element- Throws:
ConfigurationException- if the XML cannot be parsed into BIN ranges or regexes
-