public class HasarFiscalDeviceSource extends java.lang.Object implements FiscalDeviceSource
Defaults:
portSource = null;
timeout = 1200; // In milliseconds.
extendedProtocol = false;
handleExtendedProtocol = true;
maxTries = 3;
encoding = "Cp437"; // MS-DOS United States, Australia, New Zealand, South Africa.
baseRolloverYear = 1997;
Constructor and Description |
---|
HasarFiscalDeviceSource() |
HasarFiscalDeviceSource(FiscalPortSource portSource) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a deep copy of this device source.
|
int |
getBaseRolloverYear()
Get the base roll-over year to use for dates in packets.
|
java.lang.String |
getEncoding()
Get the encoding to use for strings in packets.
|
boolean |
getExtendedProtocol()
True to use the extended (STATPRN) protocol.
|
FiscalDevice |
getFiscalDevice()
Create a HasarFiscalDevice object.
|
boolean |
getHandleExtendedProtocol()
True to handle STATPRN responses via the FiscalDeviceEventHandler.onExtendedStatus() event.
|
HasarFiscalDevice |
getHasarFiscalDevice()
Create a HasarFiscalDevice object.
|
HasarFiscalDevice |
getHasarFiscalDevice(FiscalPort port)
Create a HasarFiscalDevice object.
|
int |
getMaxTries()
Get the number of times requests are tried before timeouting.
|
FiscalPortSource |
getPortSource()
Get the FiscalPort factory.
|
int |
getTimeout()
Get the protocol timeout.
|
void |
setBaseRolloverYear(int baseRolloverYear)
Set the base roll-over year to use for dates in packets.
|
void |
setEncoding(java.lang.String encoding)
Set the encoding to use for strings in packets.
|
void |
setExtendedProtocol(boolean extendedProtocol)
True to use the extended (STATPRN) protocol.
|
void |
setHandleExtendedProtocol(boolean handleExtendedProtocol)
True to handle STATPRN responses via the FiscalDeviceEventHandler.onExtendedStatus() event.
|
void |
setMaxTries(int maxTries)
Set the number of times requests are tried before timeouting.
|
void |
setPortSource(FiscalPortSource portSource)
Set the FiscalPort factory.
|
void |
setTimeout(int timeout)
Set the protocol timeout.
|
public HasarFiscalDeviceSource()
public HasarFiscalDeviceSource(FiscalPortSource portSource)
public java.lang.Object clone()
clone
in interface FiscalDeviceSource
clone
in class java.lang.Object
public void setPortSource(FiscalPortSource portSource)
FiscalDeviceSource
setPortSource
in interface FiscalDeviceSource
public FiscalPortSource getPortSource()
FiscalDeviceSource
getPortSource
in interface FiscalDeviceSource
public void setTimeout(int timeout)
public int getTimeout()
public void setExtendedProtocol(boolean extendedProtocol)
public boolean getExtendedProtocol()
public void setHandleExtendedProtocol(boolean handleExtendedProtocol)
public boolean getHandleExtendedProtocol()
public void setMaxTries(int maxTries)
public int getMaxTries()
public void setEncoding(java.lang.String encoding)
public java.lang.String getEncoding()
public void setBaseRolloverYear(int baseRolloverYear)
public int getBaseRolloverYear()
public FiscalDevice getFiscalDevice() throws java.lang.Exception
getFiscalDevice
in interface FiscalDeviceSource
java.lang.Exception
public HasarFiscalDevice getHasarFiscalDevice() throws java.lang.Exception
java.lang.Exception
public HasarFiscalDevice getHasarFiscalDevice(FiscalPort port)