public class EmployeeConnector extends ServiceConnector<IEmployeeService>
IEmployeeService
.
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.
IEmployeeService
Modifier and Type | Class and Description |
---|---|
static class |
EmployeeConnector.EmployeeCallback<T>
An implementation of the
ServiceConnector.Callback interface
for receiving asynchronous results from EmployeeConnector
methods that provides default method implementations. |
static interface |
EmployeeConnector.OnActiveEmployeeChangedListener
A listener that is invoked when the active employee changes.
|
ServiceConnector.Callback<T>, ServiceConnector.OnServiceConnectedListener, ServiceConnector.ServiceCallable<S,T>, ServiceConnector.ServiceRunnable<S>
mAccount, mClient, mConnected, mContext, mHandler, mService
Constructor and Description |
---|
EmployeeConnector(Context context,
Account account,
ServiceConnector.OnServiceConnectedListener client) |
connect, 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 EmployeeConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
protected String getServiceIntentAction()
getServiceIntentAction
in class ServiceConnector<IEmployeeService>
protected String getServiceIntentPackage()
ServiceConnector
getServiceIntentPackage
in class ServiceConnector<IEmployeeService>
protected int getServiceIntentVersion()
ServiceConnector
ServiceConnector.getServiceIntentAction()
instead of using this mechanism.getServiceIntentVersion
in class ServiceConnector<IEmployeeService>
protected IEmployeeService getServiceInterface(IBinder iBinder)
getServiceInterface
in class ServiceConnector<IEmployeeService>
public void disconnect()
disconnect
in class ServiceConnector<IEmployeeService>
public void getEmployee(EmployeeConnector.EmployeeCallback<Employee> callback)
public Employee getEmployee() throws RemoteException, ClientException, ServiceException, BindingException
public void getEmployee(String id, EmployeeConnector.EmployeeCallback<Employee> callback)
public Employee getEmployee(String id) throws RemoteException, ClientException, ServiceException, BindingException
public void getEmployees(EmployeeConnector.EmployeeCallback<List<Employee>> callback)
public List<Employee> getEmployees() throws RemoteException, ClientException, ServiceException, BindingException
public Employee createEmployee(Employee employee) throws RemoteException, ClientException, ServiceException, BindingException
public void createEmployee(Employee employee, EmployeeConnector.EmployeeCallback<Employee> callback)
public Employee updateEmployee(Employee employee) throws RemoteException, ClientException, ServiceException, BindingException
@Deprecated public void setEmployeePin(String id, String pin, EmployeeConnector.EmployeeCallback<Employee> callback)
#updateEmployee(Employee, ResultStatus)
instead.@Deprecated public Employee setEmployeePin(String id, String pin) throws RemoteException, ClientException, ServiceException, BindingException
#updateEmployee(Employee, ResultStatus)
instead.public void updateEmployee(Employee employee, EmployeeConnector.EmployeeCallback<Employee> callback)
public void deleteEmployee(String employeeId) throws RemoteException, ClientException, ServiceException, BindingException
public void deleteEmployee(String employeeId, EmployeeConnector.EmployeeCallback<Void> callback)
public void login(EmployeeConnector.EmployeeCallback<Void> callback)
Lockscreen.unlock()
, Lockscreen.unlock(String)
,
or Lockscreen.unlockDefault()
.@Deprecated public void login() throws RemoteException, ClientException, ServiceException, BindingException
Lockscreen.unlock()
, Lockscreen.unlock(String)
,
or Lockscreen.unlockDefault()
.@Deprecated public void logout(EmployeeConnector.EmployeeCallback<Void> callback)
Lockscreen.lock()
.@Deprecated public void logout() throws RemoteException, ClientException, ServiceException, BindingException
Lockscreen.lock()
.public void addOnActiveEmployeeChangedListener(EmployeeConnector.OnActiveEmployeeChangedListener listener)
public void removeOnActiveEmployeeChangedListener(EmployeeConnector.OnActiveEmployeeChangedListener listener)