|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.dse.base.DSENotifier
com.ibm.dse.base.Service
com.ibm.dse.services.landp.MsreService
Magnetic Stripe Reader and Encoder service. It extends MsreLandp, which interacts with the MSRE hardware through a LANDP server.
Field Summary | |
---|---|
java.lang.String |
COMPID
|
static int |
RC_ALREADY_OPENED
|
static int |
RC_IN_PROCESS
|
static int |
RC_INVALID_DATA
|
static int |
RC_NOT_OPENED
|
static int |
RC_OK
|
static int |
TIMEOUT_FOREVER
|
Fields inherited from class com.ibm.dse.base.Service |
---|
externalizer |
Fields inherited from class com.ibm.dse.base.DSENotifier |
---|
handlersList, name |
Constructor Summary | |
---|---|
MsreService()
MsreService constructor. |
Method Summary | |
---|---|
void |
addReadListener(ReadListener newListener)
|
void |
addTimeoutListener(TimeoutListener newListener)
|
void |
addWriteListener(WriteListener newListener)
|
int |
cancel()
Cancels a previous read or write operation. |
int |
close()
Closes the device. |
int |
getAllTrackParams(MsreTrackParams[] tp)
Gets the track parameters for all three tracks. |
int |
getCapabilities(MsreCapabilities cap)
Gets the device capabilities. |
int |
getCounters(MsreErrorCounters ec)
Gets the error counters. |
java.lang.String |
getLandpServerName()
Getter for the externalizable parameter landpServerName. |
DeviceStatus |
getStatus()
Gets the device status: OPEN,CLOSED,READING or WRITING. |
boolean |
getTraceFlag()
Returns the trace flag. |
int |
getTrackParams(int trackNum,
MsreTrackParams tp)
Gets track parameters. |
int |
getTrackSelFlags(MsreTrackSelFlags tf)
Gets the track selection flags. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes the service. |
int |
open()
Opens the device with its default server name. |
int |
open(java.lang.String name)
Opens the device. |
int |
read()
Prepares (arms) the device for reading. |
int |
read(int timeout)
Prepares (arms) the device for reading. |
void |
readCompleted(ReadEvent ev)
Event handler for the ReadEvent event. |
void |
removeReadListener(ReadListener newListener)
|
void |
removeTimeoutListener(TimeoutListener newListener)
|
void |
removeWriteListener(WriteListener newListener)
|
int |
setAllTrackParams(MsreTrackParams[] tps)
Sets the track parameters for all three tracks. |
void |
setLandpServerName(java.lang.String sname)
Setter for the externalizable parameter landpServerName. |
void |
setTraceFlag(boolean tf)
Enables or disables tracing |
int |
setTrackParams(int trackNum,
MsreTrackParams tp)
Sets track parameters. |
int |
setTrackSelFlags(MsreTrackSelFlags tf)
Sets the track selection flags. |
void |
timedOut(TimeoutEvent ev)
Event handler for the TimeoutEvent event. |
java.lang.String |
toString()
Gives an SGML representation of the service and its parameters. |
protected void |
trace(java.lang.String s)
Traces a line to the trace facility. |
int |
write(java.lang.String data)
Prepares the device for writing. |
int |
write(java.lang.String data,
int timeout)
Prepares the device for writing. |
void |
writeCompleted(WriteEvent ev)
Event handler for the WriteEvent event. |
Methods inherited from class com.ibm.dse.base.Service |
---|
externalizer, getExternalizer, getTagName, readExternal, readExternal, readObject, removeExternal, setExternalizer, terminate, toStrings, toTags, writeExternal, writeExternal |
Methods inherited from class com.ibm.dse.base.DSENotifier |
---|
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ibm.dse.base.Externalizable |
---|
getName, setName |
Field Detail |
public static final int TIMEOUT_FOREVER
public static final int RC_OK
public static final int RC_ALREADY_OPENED
public static final int RC_NOT_OPENED
public static final int RC_IN_PROCESS
public static final int RC_INVALID_DATA
public java.lang.String COMPID
Constructor Detail |
public MsreService() throws LandpException
LandpException
- thrown when LANDP is not loaded.Method Detail |
public void addReadListener(ReadListener newListener)
addReadListener
in interface MsreServiceInterface
newListener
- ReadListenerpublic void addTimeoutListener(TimeoutListener newListener)
addTimeoutListener
in interface MsreServiceInterface
newListener
- TimeoutListenerpublic void addWriteListener(WriteListener newListener)
addWriteListener
in interface MsreServiceInterface
newListener
- WriteListenerpublic int cancel() throws LandpException
cancel
in interface MsreServiceInterface
LandpException
- thrown when the remote request returned some unexpected error.public int close() throws LandpException
close
in interface MsreServiceInterface
LandpException
- thrown when the remote request returned some unexpected error.public int getAllTrackParams(MsreTrackParams[] tp) throws LandpException
getAllTrackParams
in interface MsreServiceInterface
tp
- - array of track parameters
LandpException
- thrown when the remote request returned some unexpected error.public int getCapabilities(MsreCapabilities cap) throws LandpException
getCapabilities
in interface MsreServiceInterface
cap
- destination capabilities object
LandpException
- thrown when the remote request returned some unexpected error.public int getCounters(MsreErrorCounters ec) throws LandpException
getCounters
in interface MsreServiceInterface
ec
- destination error counter object
LandpException
- thrown when the remote request returned some unexpected error.public java.lang.String getLandpServerName()
public DeviceStatus getStatus()
getStatus
in interface MsreServiceInterface
public boolean getTraceFlag()
public int getTrackParams(int trackNum, MsreTrackParams tp) throws LandpException
getTrackParams
in interface MsreServiceInterface
trackNum
- - number of track, 1 to 3.tp
- - destination track parameters
LandpException
- thrown when the remote request returned some unexpected error.public int getTrackSelFlags(MsreTrackSelFlags tf) throws LandpException
getTrackSelFlags
in interface MsreServiceInterface
tf
- destination flags
LandpException
- thrown when the remote request returned some unexpected error.public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException
initializeFrom
in interface Externalizable
initializeFrom
in class Service
aTag
- com.ibm.dse.base.Tag
java.io.IOException
- thrown when an IO exception happenspublic int open() throws LandpException
open
in interface MsreServiceInterface
LandpException
- thrown when the remote request returned some unexpected error.public int open(java.lang.String name) throws LandpException
open
in interface MsreServiceInterface
name
- - the LANDP MSRE server name.
LandpException
- thrown when the remote request returned some unexpected error.public int read() throws LandpException
read
in interface MsreServiceInterface
LandpException
- thrown when the remote request returned some unexpected error.public int read(int timeout) throws LandpException
read
in interface MsreServiceInterface
timeout
- Time out in seconds.
LandpException
- thrown when the remote request returned some unexpected error.public void readCompleted(ReadEvent ev)
readCompleted
in interface ReadListener
ev
- ReadEvent the read event objectpublic void removeReadListener(ReadListener newListener)
removeReadListener
in interface MsreServiceInterface
newListener
- ReadListenerpublic void removeTimeoutListener(TimeoutListener newListener)
removeTimeoutListener
in interface MsreServiceInterface
newListener
- TimeoutListenerpublic void removeWriteListener(WriteListener newListener)
removeWriteListener
in interface MsreServiceInterface
newListener
- WriteListenerpublic int setAllTrackParams(MsreTrackParams[] tps) throws LandpException
setAllTrackParams
in interface MsreServiceInterface
LandpException
- thrown when the remote request returned some unexpected error.public void setLandpServerName(java.lang.String sname)
public void setTraceFlag(boolean tf) throws java.lang.NumberFormatException
tf
- boolean - true if trace active, false otherwise
java.lang.NumberFormatException
public int setTrackParams(int trackNum, MsreTrackParams tp) throws LandpException
setTrackParams
in interface MsreServiceInterface
trackNum
- number of track, 1 to 3.tp
- track parameters
LandpException
- thrown when the remote request returned some unexpected error.public int setTrackSelFlags(MsreTrackSelFlags tf) throws LandpException
setTrackSelFlags
in interface MsreServiceInterface
LandpException
- thrown when the remote request returned some unexpected error.public void timedOut(TimeoutEvent ev)
timedOut
in interface TimeoutListener
ev
- TimeoutEvent - the timeout event objectpublic java.lang.String toString()
toString
in class Service
protected void trace(java.lang.String s)
s
- String - the text to tracepublic int write(java.lang.String data) throws LandpException
write
in interface MsreServiceInterface
data
- String - the data to write to the magnetic stripe.
LandpException
- thrown when the remote request returned some unexpected error.public int write(java.lang.String data, int timeout) throws LandpException
write
in interface MsreServiceInterface
timeout
- - Time out in seconds.data
- String - the data to write to the stripe.
LandpException
- thrown when the remote request returned some unexpected error.public void writeCompleted(WriteEvent ev)
writeCompleted
in interface WriteListener
ev
- WriteEvent - the write event object
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |