Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getState() returning null #62

Open
atorisemofe opened this issue Jul 11, 2022 · 0 comments
Open

getState() returning null #62

atorisemofe opened this issue Jul 11, 2022 · 0 comments

Comments

@atorisemofe
Copy link

I am using cups 0.7.8 jar, and want to check the printer status by using the following method of the cups API

public PrinterStateEnum getState()

The code is as follows:

String cupsHost = rb.getString("cups.server.hostname");

String cupsPort = rb.getString("cups.server.port");
CupsClient client = new CupsClient(cupsHost, new Integer(cupsPort));

List printers = client.getPrinters();
logger.info("Found printers: " + printers.toString());

for (CupsPrinter printer : printers) {
logger.info("printer available: " + printer.getName());
PrinterStateEnum printerState = printer.getState();
}

However the getState() method is returning null

I checked the cups server end and it is possible to access the printer status over the browser. This is what is seen:

image

I wanted to know if this API [ public PrinterStateEnum getState() ] is fully functional and tested for the cups jar version 0.7.8, and if so, why it may be returning null in the code, even though other API methods like CupsPrinter::getName() and CupsPrinter::getURL() are working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant