|
|
@ -34,15 +34,23 @@ public interface DeviceDAO {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to add a device.
|
|
|
|
* This method is used to add a device.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param typeId device type id.
|
|
|
|
* @param typeId device type id.
|
|
|
|
* @param device device object.
|
|
|
|
* @param device device object.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns the id of the persisted device record.
|
|
|
|
* @return returns the id of the persisted device record.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
int addDevice(int typeId, Device device, int tenantId) throws DeviceManagementDAOException;
|
|
|
|
int addDevice(int typeId, Device device, int tenantId) throws DeviceManagementDAOException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* This method is used to update a given device.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param typeId device type id.
|
|
|
|
|
|
|
|
* @param device device object.
|
|
|
|
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
|
|
|
|
* @return returns the id of updated device.
|
|
|
|
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
|
|
|
|
*/
|
|
|
|
boolean updateDevice(int typeId, Device device, int tenantId) throws DeviceManagementDAOException;
|
|
|
|
boolean updateDevice(int typeId, Device device, int tenantId) throws DeviceManagementDAOException;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -95,7 +103,7 @@ public interface DeviceDAO {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to retrieve all the devices of a given tenant and device type.
|
|
|
|
* This method is used to retrieve all the devices of a given tenant and device type.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param type device type.
|
|
|
|
* @param type device type.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns list of devices.
|
|
|
|
* @return returns list of devices.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
@ -104,6 +112,7 @@ public interface DeviceDAO {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to retrieve devices of a given user.
|
|
|
|
* This method is used to retrieve devices of a given user.
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param username user name.
|
|
|
|
* @param username user name.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns list of devices.
|
|
|
|
* @return returns list of devices.
|
|
|
@ -122,8 +131,9 @@ public interface DeviceDAO {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to retrieve devices of a given device name.
|
|
|
|
* This method is used to retrieve devices of a given device name.
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param deviceName device name.
|
|
|
|
* @param deviceName device name.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns list of devices.
|
|
|
|
* @return returns list of devices.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -132,7 +142,7 @@ public interface DeviceDAO {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to add an enrollment information of a given device.
|
|
|
|
* This method is used to add an enrollment information of a given device.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param device device object.
|
|
|
|
* @param device device object.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns the id of the enrollment.
|
|
|
|
* @return returns the id of the enrollment.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
@ -142,22 +152,22 @@ public interface DeviceDAO {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to set the current enrollment status of given device and user.
|
|
|
|
* This method is used to set the current enrollment status of given device and user.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param currentOwner current user name.
|
|
|
|
* @param currentOwner current user name.
|
|
|
|
* @param status device status.
|
|
|
|
* @param status device status.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns true if success.
|
|
|
|
* @return returns true if success.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
boolean setEnrolmentStatus(DeviceIdentifier deviceId, String currentOwner, Status status,
|
|
|
|
boolean setEnrolmentStatus(DeviceIdentifier deviceId, String currentOwner, Status status,
|
|
|
|
int tenantId) throws DeviceManagementDAOException;
|
|
|
|
int tenantId) throws DeviceManagementDAOException;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to get the status of current enrollment of a given user and device.
|
|
|
|
* This method is used to get the status of current enrollment of a given user and device.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param currentOwner device owner.
|
|
|
|
* @param currentOwner device owner.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns current enrollment status.
|
|
|
|
* @return returns current enrollment status.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -167,9 +177,9 @@ public interface DeviceDAO {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to retrieve current enrollment of a given device and user.
|
|
|
|
* This method is used to retrieve current enrollment of a given device and user.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param currentUser user name.
|
|
|
|
* @param currentUser user name.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns EnrolmentInfo object.
|
|
|
|
* @return returns EnrolmentInfo object.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -179,7 +189,7 @@ public interface DeviceDAO {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This method is used to retrieve devices of a given enrollment status.
|
|
|
|
* This method is used to retrieve devices of a given enrollment status.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param status enrollment status.
|
|
|
|
* @param status enrollment status.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns list of devices.
|
|
|
|
* @return returns list of devices.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
@ -190,12 +200,24 @@ public interface DeviceDAO {
|
|
|
|
* This method is used to retrieve the enrollment id of a given device and status.
|
|
|
|
* This method is used to retrieve the enrollment id of a given device and status.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param deviceId device id.
|
|
|
|
* @param status enrollment status.
|
|
|
|
* @param status enrollment status.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
* @return returns the id of current enrollment.
|
|
|
|
* @return returns the id of current enrollment.
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
int getEnrolmentByStatus(DeviceIdentifier deviceId, Status status,
|
|
|
|
int getEnrolmentByStatus(DeviceIdentifier deviceId, Status status,
|
|
|
|
int tenantId) throws DeviceManagementDAOException;
|
|
|
|
int tenantId) throws DeviceManagementDAOException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* This method is used to retrieve the enrollment info of a given list of devices and status.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param deviceIds A list of device identifiers.
|
|
|
|
|
|
|
|
* @param status enrollment status.
|
|
|
|
|
|
|
|
* @param tenantId tenant id.
|
|
|
|
|
|
|
|
* @return returns a list of enrolment info objects.
|
|
|
|
|
|
|
|
* @throws DeviceManagementDAOException
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
List<EnrolmentInfo> getEnrolmentsByStatus(List<DeviceIdentifier> deviceIds, Status status,
|
|
|
|
|
|
|
|
int tenantId) throws DeviceManagementDAOException;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|