public class PrinterAlert extends Object implements Serializable
package test.zebra.sdk.printer.examples;
import com.zebra.sdk.printer.PrinterAlert;
import com.zebra.sdk.settings.AlertCondition;
import com.zebra.sdk.settings.AlertDestination;
public class PrinterAlertExample {
public static void main(String[] args) {
PrinterAlert myPrinterAlert = new PrinterAlert(AlertCondition.PAPER_OUT, AlertDestination.TCP, true, false, "10.3.4.5", 9100, false);
PrinterAlert myGenericAlert = myPrinterAlert;
System.out.println("Alert Info:");
System.out.println(" Condition = " + myGenericAlert.getCondition());
System.out.println(" Destination = " + myGenericAlert.getDestinationAsSgdString());
System.out.println(" Address = " + myGenericAlert.getDestinationAddress());
System.out.println(" Port = " + myGenericAlert.getPort());
System.out.println(" Fire when condition occurs? = " + myPrinterAlert.isOnSet());
System.out.println(" Fire when condition clears? = " + myPrinterAlert.isOnClear());
System.out.println(" Are alerts quelled? = " + myPrinterAlert.getQuelling());
}
}
Constructor and Description |
---|
PrinterAlert(AlertCondition condition,
AlertDestination destination,
boolean onSet,
boolean onClear,
String destinationAddress,
int port,
boolean quelling)
Creates an instance of a PrinterAlert object.
|
PrinterAlert(AlertCondition condition,
AlertDestination destination,
boolean onSet,
boolean onClear,
String destinationAddress,
int port,
boolean quelling,
String alertText)
Creates an instance of a PrinterAlert object, including the printer alert text.
|
PrinterAlert(AlertCondition condition,
AlertDestination destination,
String sgdName,
boolean onSet,
boolean onClear,
String destinationAddress,
int port,
boolean quelling)
Creates an instance of a PrinterAlert object, including a Set-Get-Do name.
|
PrinterAlert(AlertCondition condition,
AlertDestination destination,
String sgdName,
boolean onSet,
boolean onClear,
String destinationAddress,
int port,
boolean quelling,
String alertText)
Creates an instance of a PrinterAlert object, including a Set-Get-Do name and the printer alert text.
|
Modifier and Type | Method and Description |
---|---|
String |
getAlertText()
Return the text received from the printer.
|
AlertCondition |
getCondition()
Return the
AlertCondition of the alert. |
AlertDestination |
getDestination()
Return the
AlertDestination used by the alert. |
String |
getDestinationAddress()
Return the destination where the alert should be sent, for example, an IP Address or an email address, depending
on the value of getDestinationAsSGDString.
|
String |
getDestinationAsSgdString()
Return the
String representation of the alert destination for Set-Get-Do. |
int |
getPort()
Return the destination port number where the alert should be sent.
|
boolean |
getQuelling()
Return the quelling state of the alert.
|
String |
getSgdName()
Return the
String representation of the Set-Get-Do Name. |
boolean |
isOnClear()
Return alert will be triggered on 'clear'.
|
boolean |
isOnSet()
Return true if the alert is fired when 'set'.
|
public PrinterAlert(AlertCondition condition, AlertDestination destination, boolean onSet, boolean onClear, String destinationAddress, int port, boolean quelling)
condition
- The printer condition that will trigger the alert.destination
- The destination that the alert will be sent to.onSet
- If true, the alert will be triggered when the condition occurs.onClear
- If true, the alert will be triggered when the condition is cleared.destinationAddress
- The destination address, if the destination requires one.port
- The destination port, if the destination requires one.quelling
- If true, the alert is quelled.public PrinterAlert(AlertCondition condition, AlertDestination destination, String sgdName, boolean onSet, boolean onClear, String destinationAddress, int port, boolean quelling)
condition
- The printer condition that will trigger the alert.destination
- The destination that the alert will be sent to.sgdName
- If condition
is SGD_SET
, the name of the Set-Get-Do to be monitored.onSet
- If true, the alert will be triggered when the condition occurs.onClear
- If true, the alert will be triggered when the condition is cleared.destinationAddress
- The destination address, if the destination requires one.port
- The destination port, if the destination requires one.quelling
- If true, the alert is quelled.public PrinterAlert(AlertCondition condition, AlertDestination destination, boolean onSet, boolean onClear, String destinationAddress, int port, boolean quelling, String alertText)
condition
- The printer condition that will trigger the alert.destination
- The destination that the alert will be sent to.onSet
- If true, the alert will be triggered when the condition occurs.onClear
- If true, the alert will be triggered when the condition is cleared.destinationAddress
- The destination address, if the destination requires one.port
- The destination port, if the destination requires one.quelling
- If true, the alert is quelled.alertText
- The text received from the printer.public PrinterAlert(AlertCondition condition, AlertDestination destination, String sgdName, boolean onSet, boolean onClear, String destinationAddress, int port, boolean quelling, String alertText)
condition
- The printer condition that will trigger the alert.destination
- The destination that the alert will be sent to.sgdName
- If condition
is SGD_SET
, the name of the Set-Get-Do to be monitored.onSet
- If true, the alert will be triggered when the condition occurs.onClear
- If true, the alert will be triggered when the condition is cleared.destinationAddress
- The destination address, if the destination requires one.port
- The destination port, if the destination requires one.quelling
- If true, the alert is quelled.alertText
- The text received from the printer.public String getDestinationAsSgdString()
String
representation of the alert destination for Set-Get-Do.public String getDestinationAddress()
public int getPort()
public AlertCondition getCondition()
AlertCondition
of the alert.public String getSgdName()
String
representation of the Set-Get-Do Name.String
public boolean isOnSet()
public AlertDestination getDestination()
AlertDestination
used by the alert.public boolean getQuelling()
public String getAlertText()
© 2015 ZIH Corp. All Rights Reserved.