hi
i've wrote an application for monitoring printers.i wanna read printer queue and see if the job printing is completed,do somethings.(printing must be completed not canceled or failed)
could anyone help me?

this is my listener :

public class Listener implements PrintServiceAttributeListener {

public void attributeUpdate(PrintServiceAttributeEvent e) {

// Some event occurred with a print service

Attribute[] attrs = e.getAttributes().toArray();
for (int i = 0; i < attrs.length; i++) {
String attrName = attrs[i].getName();

// New value
String attrValue = attrs[i].toString();
System.out.println("Name : " + attrName + " Value : " + attrValue);
}
}
}