public class TenderConnector extends ServiceConnector<ITenderService>
ITenderService
.
This class automatically binds and provides both synchronous and asynchronous service
method invocation.
Clients of this class may optionally call ServiceConnector.connect()
to force
pre-binding to the underlying service, and must call ServiceConnector.disconnect()
when finished interacting with the underlying service.
For all service methods, this class provides both synchronous and asynchronous call options. The synchronous methods must not be called on the UI thread.
ITenderService
Modifier and Type | Class and Description |
---|---|
static class |
TenderConnector.TenderCallback<T> |
ServiceConnector.Callback<T>, ServiceConnector.OnServiceConnectedListener, ServiceConnector.ServiceCallable<S,T>, ServiceConnector.ServiceRunnable<S>
mAccount, mClient, mConnected, mContext, mHandler, mService
Constructor and Description |
---|
TenderConnector(Context context,
Account account,
ServiceConnector.OnServiceConnectedListener client)
Construct a new merchant connector.
|
Modifier and Type | Method and Description |
---|---|
Tender |
checkAndCreateTender(String label,
String labelKey,
boolean enabled,
boolean opensCashDrawer) |
void |
checkAndCreateTender(String label,
String labelKey,
boolean enabled,
boolean opensCashDrawer,
ServiceConnector.Callback<Tender> callback) |
void |
deleteTender(String tenderId) |
protected String |
getServiceIntentAction() |
protected String |
getServiceIntentPackage()
The package which hosts the service to connect to.
|
protected int |
getServiceIntentVersion()
Connectors that are versioned include a version number in the action returned by
ServiceConnector.getServiceIntentAction() instead of using this mechanism. |
protected ITenderService |
getServiceInterface(IBinder iBinder) |
List<Tender> |
getTenders() |
void |
getTenders(ServiceConnector.Callback<List<Tender>> callback) |
Tender |
setEnabled(String tenderId,
boolean enabled) |
void |
setEnabled(String tenderId,
boolean enabled,
ServiceConnector.Callback<Tender> callback) |
void |
setLabel(String tenderId,
String tenderLabel) |
void |
setOpensCashDrawer(String tenderId,
boolean opensCashDrawer) |
connect, disconnect, execute, execute, execute, execute, getService, getStartIntent, isConnected, isInstalled, notifyServiceConnected, notifyServiceDisconnected, onServiceConnected, onServiceDisconnected, postResults, throwOnFailure, waitForConnection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onBindingDied, onNullBinding
public TenderConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
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.protected String getServiceIntentAction()
getServiceIntentAction
in class ServiceConnector<ITenderService>
protected String getServiceIntentPackage()
ServiceConnector
getServiceIntentPackage
in class ServiceConnector<ITenderService>
protected int getServiceIntentVersion()
ServiceConnector
ServiceConnector.getServiceIntentAction()
instead of using this mechanism.getServiceIntentVersion
in class ServiceConnector<ITenderService>
protected ITenderService getServiceInterface(IBinder iBinder)
getServiceInterface
in class ServiceConnector<ITenderService>
public List<Tender> getTenders() throws RemoteException, ClientException, ServiceException, BindingException
public void getTenders(ServiceConnector.Callback<List<Tender>> callback)
public Tender checkAndCreateTender(String label, String labelKey, boolean enabled, boolean opensCashDrawer) throws RemoteException, ClientException, ServiceException, BindingException
public void checkAndCreateTender(String label, String labelKey, boolean enabled, boolean opensCashDrawer, ServiceConnector.Callback<Tender> callback)
public void deleteTender(String tenderId) throws RemoteException, ClientException, ServiceException, BindingException
public void setOpensCashDrawer(String tenderId, boolean opensCashDrawer) throws RemoteException, ClientException, ServiceException, BindingException
public void setLabel(String tenderId, String tenderLabel) throws RemoteException, ClientException, ServiceException, BindingException
public Tender setEnabled(String tenderId, boolean enabled) throws RemoteException, ClientException, ServiceException, BindingException
public void setEnabled(String tenderId, boolean enabled, ServiceConnector.Callback<Tender> callback)