Package com.clover.sdk.v1.tender
Class TenderConnector
- java.lang.Object
-
- com.clover.sdk.v1.ServiceConnector<ITenderService>
-
- com.clover.sdk.v1.tender.TenderConnector
-
- All Implemented Interfaces:
ServiceConnection
public class TenderConnector extends ServiceConnector<ITenderService>
A class that encapsulates interaction withITenderService
. 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 callServiceConnector.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.
- See Also:
ITenderService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TenderConnector.TenderCallback<T>
-
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 TenderConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
Construct a new merchant connector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 byServiceConnector.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)
-
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
-
TenderConnector
public TenderConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
Construct a new merchant 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<ITenderService>
-
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<ITenderService>
-
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<ITenderService>
-
getServiceInterface
protected ITenderService getServiceInterface(IBinder iBinder)
- Specified by:
getServiceInterface
in classServiceConnector<ITenderService>
-
getTenders
public List<Tender> getTenders() throws RemoteException, ClientException, ServiceException, BindingException
-
getTenders
public void getTenders(ServiceConnector.Callback<List<Tender>> callback)
-
checkAndCreateTender
public Tender checkAndCreateTender(String label, String labelKey, boolean enabled, boolean opensCashDrawer) throws RemoteException, ClientException, ServiceException, BindingException
-
checkAndCreateTender
public void checkAndCreateTender(String label, String labelKey, boolean enabled, boolean opensCashDrawer, ServiceConnector.Callback<Tender> callback)
-
deleteTender
public void deleteTender(String tenderId) throws RemoteException, ClientException, ServiceException, BindingException
-
setOpensCashDrawer
public void setOpensCashDrawer(String tenderId, boolean opensCashDrawer) throws RemoteException, ClientException, ServiceException, BindingException
-
setLabel
public void setLabel(String tenderId, String tenderLabel) throws RemoteException, ClientException, ServiceException, BindingException
-
setEnabled
public Tender setEnabled(String tenderId, boolean enabled) throws RemoteException, ClientException, ServiceException, BindingException
-
setEnabled
public void setEnabled(String tenderId, boolean enabled, ServiceConnector.Callback<Tender> callback)
-
-