public class DeviceHelper extends Object
Constructor and Description |
---|
DeviceHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addEndpointsToDevice(AccessDevice device,
List<AccessDeviceUser> accessDeviceUsers)
Method to add a list of endpoints to a device.
|
static void |
backupDevice(AccessDeviceInformation<GroupAccessDevice> gadInformation,
PrintStream out)
Helper Method to backup a GroupAccessDevice.
|
static AccessDevice |
getAccessDeviceFromUser(User user)
Utility Method to retrieve the specific subclass AccessDevice from a User
|
static com.github.zafarkhaja.semver.Version |
getDeviceVersion(AccessDevice accessDevice)
Retrieves the semantic version of the Access Device.
|
static AccessDeviceUser |
getPrimaryAccessDeviceUser(GroupAccessDevice gad)
Helper Method to find the Primary Access Device User from a Group Access Device.
|
static boolean |
isCompatibleDeviceType(AccessDevice accessDevice,
AccessDeviceInformation<?> information,
String deviceType)
Checks if the given AccessDevice and AccessDeviceInformation are
compatible with the given device type.
|
static void |
removeEndpointsFromDevice(AccessDevice device,
List<AccessDeviceUser> accessDeviceUsers)
Method to remove endpoints from an AccessDevice.
|
static void |
replaceUserDevice(User user,
AccessDevice newDevice)
Method to replace an AccessDevice on a User with another.
|
static void |
resetAccessDevice(AccessDevice accessDevice)
Method to reset an AccessDevice on a User.
|
static AccessDevice |
retrieveUserAccessDeviceSubtype(AccessDevice device,
User user)
Helper Method to convert an AccessDevice to its more specific subtype.
|
public static void addEndpointsToDevice(AccessDevice device, List<AccessDeviceUser> accessDeviceUsers) throws HelperException
device
- The device to add the endpointsaccessDeviceUsers
- The list of access device users to addHelperException
- Thrown if an error occurs during the processpublic static AccessDevice getAccessDeviceFromUser(User user) throws HelperException
user
- The User of the AccessDeviceHelperException
- Thrown if an error occurs while retrieving the AccessDevicepublic static boolean isCompatibleDeviceType(AccessDevice accessDevice, AccessDeviceInformation<?> information, String deviceType) throws HelperException
accessDevice
- The AccessDeviceinformation
- The AccessDeviceInformation for the AccessDevicedeviceType
- The device type to check for compatibilityHelperException
- Thrown if an error occurs while retrieving device type.public static void removeEndpointsFromDevice(AccessDevice device, List<AccessDeviceUser> accessDeviceUsers) throws HelperException
device
- The device to remove endpointsaccessDeviceUsers
- The list of AccessDeviceUsers to removeHelperException
- Thrown if an error occurs while removing devices.public static void replaceUserDevice(User user, AccessDevice newDevice) throws HelperException
user
- The User to modifynewDevice
- The device to assignHelperException
- Thrown if an issue is encountered during migrationpublic static void resetAccessDevice(AccessDevice accessDevice) throws HelperException
accessDevice
- The device to resetHelperException
- Thrown if an issue is encountered during migrationpublic static com.github.zafarkhaja.semver.Version getDeviceVersion(AccessDevice accessDevice) throws HelperException
accessDevice
- The access device subclass to retrieve the version.Version
object or NULL if not found.HelperException
- Thrown if unable to retrieve the access device version.public static AccessDevice retrieveUserAccessDeviceSubtype(AccessDevice device, User user) throws HelperException
device
- The AccessDevice to determineuser
- A User that is assigned to the AccessDeviceHelperException
- Thrown for all issues while retrieving the subtypepublic static AccessDeviceUser getPrimaryAccessDeviceUser(GroupAccessDevice gad) throws HelperException
gad
- The GroupAccessDevice to determineHelperException
- Thrown if there is any issue with retrieving the access device userpublic static void backupDevice(AccessDeviceInformation<GroupAccessDevice> gadInformation, PrintStream out) throws HelperException, IOException
gadInformation
- The AccessDeviceInformation for the AccessDeviceout
- The Print Stream where device storage information is printedHelperException
- Thrown if there is an error with the FileManagerIOException
- Thrown if there is an IO error while writing the backupCopyright © 2017 ECG. All rights reserved.