ds.ov2.util
Class PrintWriter_APDUListener

java.lang.Object
  extended by ds.ov2.util.PrintWriter_APDUListener
All Implemented Interfaces:
cardservices.APDUListener

public class PrintWriter_APDUListener
extends Object
implements cardservices.APDUListener

An APDUListener printing to a PrintWriter. Outputs progress messages from the global platform manager to a PrintWriter. The generated output can be adjusted in verbosity. By default full APDU's are printed. With print_dots one can optionally switch to printing one dot per APDU. The output PrintWriter can be null, then nothing is printed.

CPP Preprocessing
no cpp preprocessing needed
Execution Environment:
host
Author:
Hendrik Tews
Version:
$Revision: 1.3 $
Last Commit:
$Date: 2009-03-26 15:51:31 $ by $Author: tews $

Field Summary
private  boolean dots_only
          Control wether to print full APDU's or dots only.
private  PrintWriter out
          Local reference the channel we print to.
 
Constructor Summary
PrintWriter_APDUListener(PrintWriter out)
          Create a new APDUListener printing on out.
 
Method Summary
 void exchangedAPDU(CommandAPDU c, ResponseAPDU r)
          Print a command/response APDU pair to the configured channel.
 void print_dots(boolean dots_only)
          Switch between printing full APDU's or dots only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private final PrintWriter out
Local reference the channel we print to.


dots_only

private boolean dots_only
Control wether to print full APDU's or dots only. Set by print_dots.

Constructor Detail

PrintWriter_APDUListener

public PrintWriter_APDUListener(PrintWriter out)
Create a new APDUListener printing on out. If out is null printing will be disabled.

Parameters:
out - channel to print to, pass null to disable printing.
Method Detail

print_dots

public void print_dots(boolean dots_only)
Switch between printing full APDU's or dots only.

Parameters:
dots_only - if true, print full APDU's subsequently; otherwise print dots only

exchangedAPDU

public void exchangedAPDU(CommandAPDU c,
                          ResponseAPDU r)
Print a command/response APDU pair to the configured channel. Printing can be switched between printing full APDU's (default, set with print_dots(false)) and one dot per APDU only (set with print_dots(true)).

Specified by:
exchangedAPDU in interface cardservices.APDUListener
Parameters:
c - command APDU to print
r - response APDU to print