public class UserDeviceControl
extends java.lang.Object
构造器和说明 |
---|
UserDeviceControl() |
限定符和类型 | 方法和说明 |
---|---|
boolean |
addUserDeviceInfo(UserDeviceInfo userDeviceInfo)
添加一个用户和硬件信息的绑定
|
void |
bind(java.lang.String username,
java.lang.String macAddress,
java.lang.String devName) |
boolean |
checkDeviceAuth(java.lang.String username,
java.lang.String macAddress)
检查设备权限
|
boolean |
containCache(java.lang.String username)
是否有设备信息缓存
|
void |
dealWithOldMacAddress(java.lang.String username,
java.lang.String oldMacAddress,
java.lang.String macAddress)
替换老的mac地址
|
java.util.Set<java.lang.String> |
findAllUsers() |
java.util.List<UserDeviceInfo> |
findDeviceInfoByMacAddress(java.lang.String macAddress)
根据设备的mac地址找到设备相关信息
|
UserDeviceInfo |
findDeviceInfoByUM(java.lang.String username,
java.lang.String macAddress)
根据用户名和设备的mac地址找到设备相关信息
|
java.util.List<UserDeviceInfo> |
findDeviceInfosByUsername(java.lang.String username) |
long |
getDeviceId(UserDeviceInfo info)
根据username和mac地址获取数据库中已入库的设备信息的id
|
JSONArray |
getDeviceJsonByUsername(java.lang.String username) |
static UserDeviceControl |
getInstance()
唯一实例化对象
|
JSONObject |
getSortedUserDeviceJSONObject() |
boolean |
removeUserDevice(java.lang.String username)
移除指定用户的所有可访问硬件信息
|
void |
unbind(java.lang.String username,
java.lang.String macAddress,
boolean passed) |
void |
updateByMacAddress(UserDeviceInfo info) |
public static UserDeviceControl getInstance()
public boolean addUserDeviceInfo(UserDeviceInfo userDeviceInfo) throws java.lang.Exception
userDeviceInfo
- 硬件信息java.lang.Exception
public boolean removeUserDevice(java.lang.String username) throws java.lang.Exception
username
- 用户名java.lang.Exception
public JSONObject getSortedUserDeviceJSONObject() throws JSONException
JSONException
public java.util.List<UserDeviceInfo> findDeviceInfoByMacAddress(java.lang.String macAddress)
macAddress
- 设备mac地址public UserDeviceInfo findDeviceInfoByUM(java.lang.String username, java.lang.String macAddress)
macAddress
- 设备mac地址public java.util.List<UserDeviceInfo> findDeviceInfosByUsername(java.lang.String username)
public JSONArray getDeviceJsonByUsername(java.lang.String username) throws JSONException
JSONException
public void updateByMacAddress(UserDeviceInfo info) throws java.lang.Exception
java.lang.Exception
public void unbind(java.lang.String username, java.lang.String macAddress, boolean passed) throws java.lang.Exception
java.lang.Exception
public void bind(java.lang.String username, java.lang.String macAddress, java.lang.String devName) throws java.lang.Exception
java.lang.Exception
public java.util.Set<java.lang.String> findAllUsers()
public void dealWithOldMacAddress(java.lang.String username, java.lang.String oldMacAddress, java.lang.String macAddress) throws java.lang.Exception
username
- 用户名oldMacAddress
- 设备的老mac地址macAddress
- 设备的mac地址java.lang.Exception
public boolean checkDeviceAuth(java.lang.String username, java.lang.String macAddress) throws java.lang.Exception
username
- 用户名macAddress
- 设备的mac地址java.lang.Exception
public boolean containCache(java.lang.String username)
username
- 用户名public long getDeviceId(UserDeviceInfo info)
info
- 设备信息