Class CupsPrinter
java.lang.Object
oshi.hardware.common.AbstractPrinter
oshi.hardware.common.platform.unix.CupsPrinter
- All Implemented Interfaces:
Printer
- Direct Known Subclasses:
LpstatPrinter
CUPS-based printer implementation with shared lpstat fallback logic. Subclasses provide native CUPS access via JNA or
FFM.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFactory interface for creating concrete printer instances.Nested classes/interfaces inherited from interface Printer
Printer.PrinterStatusModifier and TypeInterfaceDescriptionstatic enumPrinter status enumeration. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCupsPrinter(String name, String driverName, String description, Printer.PrinterStatus status, String statusReason, boolean isDefault, boolean isLocal, String portName) Creates a CupsPrinter with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionGets printers by parsing lpstat command output.Methods inherited from class AbstractPrinter
getDescription, getDriverName, getName, getPortName, getStatus, getStatusReason, isDefault, isLocal, toStringModifier and TypeMethodDescriptionRetrieves the user-friendly description of the printer.Retrieves the driver name or make/model of the printer.getName()Retrieves the name of the printer.Retrieves the port name or device URI of the printer.Retrieves the current status of the printer.Retrieves the reason for the current printer status, if available.booleanIndicates whether this is the default printer.booleanisLocal()Indicates whether this is a local printer (as opposed to a network printer).toString()
-
Constructor Details
-
CupsPrinter
protected CupsPrinter(String name, String driverName, String description, Printer.PrinterStatus status, String statusReason, boolean isDefault, boolean isLocal, String portName) Creates a CupsPrinter with the given parameters.- Parameters:
name- the printer namedriverName- the driver namedescription- the descriptionstatus- the printer statusstatusReason- the status reasonisDefault- whether this is the default printerisLocal- whether this is a local printerportName- the port name
-
-
Method Details
-
getPrintersFromLpstat
Gets printers by parsing lpstat command output. Used as a fallback when libcups is unavailable.- Parameters:
factory- function to create concrete printer instances- Returns:
- list of printers
-