public class MerchantConnector extends ServiceConnector<IMerchantService>
IMerchantService
.
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 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.
Modifier and Type | Class and Description |
---|---|
static class |
MerchantConnector.MerchantCallback<T>
An implementation of the
ServiceConnector.Callback interface
for receiving asynchronous results from MerchantConnector
methods that provides default method implementations. |
static interface |
MerchantConnector.OnMerchantChangedListener
A listener that is invoked when the merchant changes.
|
ServiceConnector.Callback<T>, ServiceConnector.OnServiceConnectedListener, ServiceConnector.ServiceCallable<S,T>, ServiceConnector.ServiceRunnable<S>
mAccount, mClient, mConnected, mContext, mHandler, mService
Constructor and Description |
---|
MerchantConnector(Context context,
Account account,
ServiceConnector.OnServiceConnectedListener client)
Construct a new merchant connector.
|
connect, execute, execute, execute, execute, getService, getStartIntent, isConnected, isInstalled, notifyServiceDisconnected, onServiceConnected, onServiceDisconnected, postResults, throwOnFailure, waitForConnection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onBindingDied, onNullBinding
public MerchantConnector(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.public void setOnMerchantChangedListener(MerchantConnector.OnMerchantChangedListener listener)
protected String getServiceIntentAction()
getServiceIntentAction
in class ServiceConnector<IMerchantService>
protected String getServiceIntentPackage()
ServiceConnector
getServiceIntentPackage
in class ServiceConnector<IMerchantService>
protected int getServiceIntentVersion()
ServiceConnector
ServiceConnector.getServiceIntentAction()
instead of using this mechanism.getServiceIntentVersion
in class ServiceConnector<IMerchantService>
protected IMerchantService getServiceInterface(IBinder iBinder)
getServiceInterface
in class ServiceConnector<IMerchantService>
protected void notifyServiceConnected(ServiceConnector.OnServiceConnectedListener client)
notifyServiceConnected
in class ServiceConnector<IMerchantService>
public void disconnect()
disconnect
in class ServiceConnector<IMerchantService>
public void getMerchant(ServiceConnector.Callback<Merchant> callback)
public Merchant getMerchant() throws RemoteException, ClientException, ServiceException, BindingException
public void setAddress(MerchantAddress address, ServiceConnector.Callback<Void> callback)
public void setAddress(MerchantAddress address) throws RemoteException, ClientException, ServiceException, BindingException
public void setPhoneNumber(String phoneNumber, ServiceConnector.Callback<Void> callback)
public void setPhoneNumber(String phoneNumber) throws RemoteException, ClientException, ServiceException, BindingException
public void setUpdateStock(boolean updateStock, ServiceConnector.Callback<Void> callback)
public void setUpdateStock(boolean updateStock) throws RemoteException, ClientException, ServiceException, BindingException
public void setTrackStock(boolean trackStock, ServiceConnector.Callback<Void> callback)
public void setTrackStock(boolean trackStock) throws RemoteException, ClientException, ServiceException, BindingException