Package com.clover.sdk.v1.printer
Class PrinterConnector
- java.lang.Object
-
- com.clover.sdk.v1.ServiceConnector<IPrinterService>
-
- com.clover.sdk.v1.printer.PrinterConnector
-
- All Implemented Interfaces:
ServiceConnection
public class PrinterConnector extends ServiceConnector<IPrinterService>
A class that encapsulates interaction withIPrinterService
. This class automatically binds and provides both synchronous and asynchronous service method invocation. Clients of this class may optionally callServiceConnector.connect()
to force pre-binding to the underlying service, and must callServiceConnector.disconnect()
when finished interacting with the underlying service. The preferred methods in this class are synchronous methods which do not use callbacks and should be invoked on a non-main thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PrinterConnector.PrinterCallback<T>
Deprecated.-
Nested classes/interfaces inherited from class com.clover.sdk.v1.ServiceConnector
ServiceConnector.Callback<T>, ServiceConnector.OnServiceConnectedListener, ServiceConnector.ServiceCallable<S,T>, ServiceConnector.ServiceRunnable<S>
-
-
Field Summary
-
Fields inherited from class com.clover.sdk.v1.ServiceConnector
mAccount, mClient, mConnected, mContext, mHandler, mService
-
-
Constructor Summary
Constructors Constructor Description PrinterConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
Construct a new printer connector.
-
Method Summary
-
Methods inherited from class com.clover.sdk.v1.ServiceConnector
connect, disconnect, execute, execute, execute, execute, getService, getStartIntent, isConnected, isInstalled, notifyServiceConnected, notifyServiceDisconnected, onServiceConnected, onServiceDisconnected, postResults, throwOnFailure, waitForConnection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface android.content.ServiceConnection
onBindingDied, onNullBinding
-
-
-
-
Constructor Detail
-
PrinterConnector
public PrinterConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
Construct a new printer connector.- Parameters:
context
- The Context in which this connector will bind to the underlying service.account
- The Clover account which is used when binding to the underlying service.client
- A listener, or null to receive no notifications.
-
-
Method Detail
-
getServiceIntentAction
protected String getServiceIntentAction()
- Specified by:
getServiceIntentAction
in classServiceConnector<IPrinterService>
-
getServiceIntentPackage
protected String getServiceIntentPackage()
Description copied from class:ServiceConnector
The package which hosts the service to connect to. Returning null is OK for api target < 21. Once you try to build with 21 or higher returning null will cause an illegal argument exception- Overrides:
getServiceIntentPackage
in classServiceConnector<IPrinterService>
-
getServiceIntentVersion
protected int getServiceIntentVersion()
Description copied from class:ServiceConnector
Connectors that are versioned include a version number in the action returned byServiceConnector.getServiceIntentAction()
instead of using this mechanism.- Overrides:
getServiceIntentVersion
in classServiceConnector<IPrinterService>
-
getServiceInterface
protected IPrinterService getServiceInterface(IBinder iBinder)
- Specified by:
getServiceInterface
in classServiceConnector<IPrinterService>
-
getPrinters
@Deprecated public void getPrinters(ServiceConnector.Callback<List<Printer>> callback)
Deprecated.UsegetPrinters()
instead on a non-main thread.
-
getPrinters
public List<Printer> getPrinters() throws RemoteException, ClientException, ServiceException, BindingException
-
getPrinters
@Deprecated public void getPrinters(Category category, ServiceConnector.Callback<List<Printer>> callback)
Deprecated.UsegetPrinters(Category)
instead on a non-main thread.
-
getPrinters
public List<Printer> getPrinters(Category category) throws RemoteException, ClientException, ServiceException, BindingException
-
isPrinterSet
@Deprecated public void isPrinterSet(Category category, ServiceConnector.Callback<Boolean> callback)
Deprecated.UseisPrinterSet(Category)
instead on a non-main thread.
-
isPrinterSet
public boolean isPrinterSet(Category category) throws RemoteException, ClientException, ServiceException, BindingException
-
getPrinter
@Deprecated public void getPrinter(String id, ServiceConnector.Callback<Printer> callback)
Deprecated.UsegetPrinter(String)
instead on a non-main thread.
-
getPrinter
public Printer getPrinter(String id) throws RemoteException, ClientException, ServiceException, BindingException
-
setPrinter
@Deprecated public void setPrinter(Printer printer, ServiceConnector.Callback<Printer> callback)
Deprecated.UsesetPrinter(Printer)
instead on a non-main thread.
-
setPrinter
public Printer setPrinter(Printer printer) throws RemoteException, ClientException, ServiceException, BindingException
-
removePrinter
@Deprecated public void removePrinter(Printer printer, ServiceConnector.Callback<Void> callback)
Deprecated.UseremovePrinter(Printer)
instead on a non-main thread.
-
removePrinter
public void removePrinter(Printer printer) throws RemoteException, ClientException, ServiceException, BindingException
-
getPrinterTypeDetails
public TypeDetails getPrinterTypeDetails(Printer printer) throws RemoteException, ClientException, ServiceException, BindingException
-
-