Interface AlertProvider

All Known Subinterfaces:
ZebraPrinterLinkOs
All Known Implementing Classes:
Profile

public interface AlertProvider
This is an utility class for getting/setting alerts on a printer.

package test.zebra.sdk.printer.examples;
 
 import java.util.List;
 
 import com.zebra.sdk.comm.ConnectionException;
 import com.zebra.sdk.comm.TcpConnection;
 import com.zebra.sdk.device.ZebraIllegalArgumentException;
 import com.zebra.sdk.printer.PrinterAlert;
 import com.zebra.sdk.printer.ZebraPrinterFactory;
 import com.zebra.sdk.printer.ZebraPrinterLinkOs;
 
 public class AlertProviderExample {
 
     public static void main(String[] args) throws Exception {
         TcpConnection connection = new TcpConnection("192.168.1.32", TcpConnection.DEFAULT_ZPL_TCP_PORT);
         try {
             connection.open();
             ZebraPrinterLinkOs linkOsPrinter = ZebraPrinterFactory.getLinkOsPrinter(connection);
             if (linkOsPrinter != null) {
                 List<PrinterAlert> alerts = linkOsPrinter.getConfiguredAlerts();
                 for (PrinterAlert thisAlert : alerts) {
                     System.out.println(thisAlert.getCondition() + " " + thisAlert.getDestinationAsSgdString());
                 }
             }
         } catch (ConnectionException e) {
             e.printStackTrace();
         } catch (ZebraIllegalArgumentException e) {
             e.printStackTrace();
         } finally {
             connection.close();
         }
     }
 }