Package com.clover.sdk.v3.employees
Class EmployeeConnector
- java.lang.Object
-
- com.clover.sdk.v1.ServiceConnector<IEmployeeService>
-
- com.clover.sdk.v3.employees.EmployeeConnector
-
- All Implemented Interfaces:
ServiceConnection
public class EmployeeConnector extends ServiceConnector<IEmployeeService>
A class that encapsulates interaction withIEmployeeService
. 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 calldisconnect()
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:
IEmployeeService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EmployeeConnector.EmployeeCallback<T>
An implementation of theServiceConnector.Callback
interface for receiving asynchronous results fromEmployeeConnector
methods that provides default method implementations.static interface
EmployeeConnector.OnActiveEmployeeChangedListener
A listener that is invoked when the active employee changes.-
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 EmployeeConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description EmployeeCard
addEmployeeCard(EmployeeCard employeeCard)
Not available to non-Clover apps.void
addEmployeeCard(EmployeeCard employeeCard, EmployeeConnector.EmployeeCallback<EmployeeCard> callback)
Not available to non-Clover apps.void
addOnActiveEmployeeChangedListener(EmployeeConnector.OnActiveEmployeeChangedListener listener)
Register a listener to be called when the active employee changes, which coincides with the lockscreen being shown or dismissed.Employee
createEmployee(Employee employee)
void
createEmployee(Employee employee, EmployeeConnector.EmployeeCallback<Employee> callback)
void
deleteEmployee(String employeeId)
void
deleteEmployee(String employeeId, EmployeeConnector.EmployeeCallback<Void> callback)
void
deleteEmployeeCard(EmployeeCard employeeCard)
Not available to non-Clover apps.void
deleteEmployeeCard(EmployeeCard employeeCard, EmployeeConnector.EmployeeCallback<Void> callback)
Not available to non-Clover apps.void
deleteFingerprintId(String employeeId)
Not available to non-Clover apps.void
disconnect()
Employee
getEmployee()
void
getEmployee(EmployeeConnector.EmployeeCallback<Employee> callback)
Employee
getEmployee(String id)
void
getEmployee(String id, EmployeeConnector.EmployeeCallback<Employee> callback)
List<EmployeeCard>
getEmployeeCards(String employeeId)
Not available to non-Clover apps.void
getEmployeeCards(String employeeId, EmployeeConnector.EmployeeCallback<List<EmployeeCard>> callback)
Not available to non-Clover apps.Employee
getEmployeeForCard(String cardNumber)
Not available to non-Clover apps.void
getEmployeeForCard(String cardNumber, EmployeeConnector.EmployeeCallback<Employee> callback)
Not available to non-Clover apps.String
getEmployeeId(int fingerprintId)
Not available to non-Clover apps.List<Employee>
getEmployees()
void
getEmployees(EmployeeConnector.EmployeeCallback<List<Employee>> callback)
int[]
getEnrolledFingerprints()
Not available to non-Clover apps.int
getFingerprintId(String employeeId)
Not available to non-Clover apps.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 IEmployeeService
getServiceInterface(IBinder iBinder)
void
login()
Deprecated.void
login(EmployeeConnector.EmployeeCallback<Void> callback)
Deprecated.void
logout()
Deprecated.Please useLockscreen.lock()
.void
logout(EmployeeConnector.EmployeeCallback<Void> callback)
Deprecated.Please useLockscreen.lock()
.void
removeOnActiveEmployeeChangedListener(EmployeeConnector.OnActiveEmployeeChangedListener listener)
Unregister a previously registered employee changed listener.Employee
setEmployeePin(String id, String pin)
Deprecated.Use#updateEmployee(Employee, ResultStatus)
instead.void
setEmployeePin(String id, String pin, EmployeeConnector.EmployeeCallback<Employee> callback)
Deprecated.Use#updateEmployee(Employee, ResultStatus)
instead.void
setFingerprintId(String employeeId, String fingerprintId)
Not available to non-Clover apps.Employee
updateEmployee(Employee employee)
void
updateEmployee(Employee employee, EmployeeConnector.EmployeeCallback<Employee> callback)
-
Methods inherited from class com.clover.sdk.v1.ServiceConnector
connect, 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
-
EmployeeConnector
public EmployeeConnector(Context context, Account account, ServiceConnector.OnServiceConnectedListener client)
-
-
Method Detail
-
getServiceIntentAction
protected String getServiceIntentAction()
- Specified by:
getServiceIntentAction
in classServiceConnector<IEmployeeService>
-
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<IEmployeeService>
-
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<IEmployeeService>
-
getServiceInterface
protected IEmployeeService getServiceInterface(IBinder iBinder)
- Specified by:
getServiceInterface
in classServiceConnector<IEmployeeService>
-
disconnect
public void disconnect()
- Overrides:
disconnect
in classServiceConnector<IEmployeeService>
-
getEmployee
public void getEmployee(EmployeeConnector.EmployeeCallback<Employee> callback)
-
getEmployee
public Employee getEmployee() throws RemoteException, ClientException, ServiceException, BindingException
-
getEmployee
public void getEmployee(String id, EmployeeConnector.EmployeeCallback<Employee> callback)
-
getEmployee
public Employee getEmployee(String id) throws RemoteException, ClientException, ServiceException, BindingException
-
getEmployees
public void getEmployees(EmployeeConnector.EmployeeCallback<List<Employee>> callback)
-
getEmployees
public List<Employee> getEmployees() throws RemoteException, ClientException, ServiceException, BindingException
-
createEmployee
public Employee createEmployee(Employee employee) throws RemoteException, ClientException, ServiceException, BindingException
-
createEmployee
public void createEmployee(Employee employee, EmployeeConnector.EmployeeCallback<Employee> callback)
-
updateEmployee
public Employee updateEmployee(Employee employee) throws RemoteException, ClientException, ServiceException, BindingException
-
setEmployeePin
@Deprecated public void setEmployeePin(String id, String pin, EmployeeConnector.EmployeeCallback<Employee> callback)
Deprecated.Use#updateEmployee(Employee, ResultStatus)
instead.
-
setEmployeePin
@Deprecated public Employee setEmployeePin(String id, String pin) throws RemoteException, ClientException, ServiceException, BindingException
Deprecated.Use#updateEmployee(Employee, ResultStatus)
instead.
-
setFingerprintId
public void setFingerprintId(String employeeId, String fingerprintId) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
deleteFingerprintId
public void deleteFingerprintId(String employeeId) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
updateEmployee
public void updateEmployee(Employee employee, EmployeeConnector.EmployeeCallback<Employee> callback)
-
deleteEmployee
public void deleteEmployee(String employeeId) throws RemoteException, ClientException, ServiceException, BindingException
-
deleteEmployee
public void deleteEmployee(String employeeId, EmployeeConnector.EmployeeCallback<Void> callback)
-
getFingerprintId
public int getFingerprintId(String employeeId) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
getEnrolledFingerprints
public int[] getEnrolledFingerprints() throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
getEmployeeId
public String getEmployeeId(int fingerprintId) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
addEmployeeCard
public EmployeeCard addEmployeeCard(EmployeeCard employeeCard) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
addEmployeeCard
public void addEmployeeCard(EmployeeCard employeeCard, EmployeeConnector.EmployeeCallback<EmployeeCard> callback)
Not available to non-Clover apps.
-
deleteEmployeeCard
public void deleteEmployeeCard(EmployeeCard employeeCard) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
deleteEmployeeCard
public void deleteEmployeeCard(EmployeeCard employeeCard, EmployeeConnector.EmployeeCallback<Void> callback)
Not available to non-Clover apps.
-
getEmployeeCards
public List<EmployeeCard> getEmployeeCards(String employeeId) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
getEmployeeCards
public void getEmployeeCards(String employeeId, EmployeeConnector.EmployeeCallback<List<EmployeeCard>> callback)
Not available to non-Clover apps.
-
getEmployeeForCard
public Employee getEmployeeForCard(String cardNumber) throws RemoteException, ClientException, ServiceException, BindingException
Not available to non-Clover apps.
-
getEmployeeForCard
public void getEmployeeForCard(String cardNumber, EmployeeConnector.EmployeeCallback<Employee> callback)
Not available to non-Clover apps.
-
login
public void login(EmployeeConnector.EmployeeCallback<Void> callback)
Deprecated.
-
login
@Deprecated public void login() throws RemoteException, ClientException, ServiceException, BindingException
Deprecated.
-
logout
@Deprecated public void logout(EmployeeConnector.EmployeeCallback<Void> callback)
Deprecated.Please useLockscreen.lock()
.
-
logout
@Deprecated public void logout() throws RemoteException, ClientException, ServiceException, BindingException
Deprecated.Please useLockscreen.lock()
.
-
addOnActiveEmployeeChangedListener
public void addOnActiveEmployeeChangedListener(EmployeeConnector.OnActiveEmployeeChangedListener listener)
Register a listener to be called when the active employee changes, which coincides with the lockscreen being shown or dismissed.
-
removeOnActiveEmployeeChangedListener
public void removeOnActiveEmployeeChangedListener(EmployeeConnector.OnActiveEmployeeChangedListener listener)
Unregister a previously registered employee changed listener.
-
-