public class DeviceHelper extends Object
| Constructor and Description |
|---|
DeviceHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addEndpointsToDevice(co.ecg.alpaca.toolkit.generated.AccessDevice device,
List<AccessDeviceUser> accessDeviceUsers)
Method to add a list of endpoints to a device.
|
static void |
backupDevice(AccessDeviceInformation<co.ecg.alpaca.toolkit.generated.GroupAccessDevice> gadInformation,
PrintStream out)
Helper Method to backup a GroupAccessDevice.
|
static List<DeviceFile> |
downloadFTPFiles(co.ecg.alpaca.toolkit.generated.AccessDevice device)
Helper Method to download device files that are stored on an FTP server.
|
static co.ecg.alpaca.toolkit.generated.AccessDevice |
getAccessDeviceFromUser(co.ecg.alpaca.toolkit.generated.User user)
Utility Method to retrieve the specific subclass AccessDevice from a User
|
static com.github.zafarkhaja.semver.Version |
getDeviceVersion(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice)
Retrieves the semantic version of the Access Device.
|
static AccessDeviceUser |
getPrimaryAccessDeviceUser(co.ecg.alpaca.toolkit.generated.GroupAccessDevice gad)
Helper Method to find the Primary Access Device User from a Group Access Device.
|
static String |
getRepositoryURL(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice,
String deviceType,
String macAddress,
String fileFormat,
String method)
Retrieves Repository URL for an access device file
|
static boolean |
isCompatibleDeviceType(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice,
AccessDeviceInformation<?> information,
String deviceType)
Checks if the given AccessDevice and AccessDeviceInformation are
compatible with the given device type.
|
static void |
rebuildAccessDeviceConfigurationFiles(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice)
Utility Method to rebuild an AccessDevice configuration files.
|
static void |
removeEndpointsFromDevice(co.ecg.alpaca.toolkit.generated.AccessDevice device,
List<AccessDeviceUser> accessDeviceUsers)
Method to remove endpoints from an AccessDevice.
|
static void |
replaceUserDevice(co.ecg.alpaca.toolkit.generated.User user,
co.ecg.alpaca.toolkit.generated.AccessDevice newDevice)
Method to replace an AccessDevice on a User with another.
|
static void |
resetAccessDevice(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice)
Method to reset an AccessDevice on a User.
|
static co.ecg.alpaca.toolkit.generated.AccessDevice |
retrieveUserAccessDeviceSubtype(co.ecg.alpaca.toolkit.generated.AccessDevice device,
co.ecg.alpaca.toolkit.generated.User user)
Helper Method to convert an AccessDevice to its more specific subtype.
|
public static void addEndpointsToDevice(co.ecg.alpaca.toolkit.generated.AccessDevice device,
List<AccessDeviceUser> accessDeviceUsers)
throws HelperException
device - The device to add the endpointsaccessDeviceUsers - The list of access device users to addHelperExceptionpublic static co.ecg.alpaca.toolkit.generated.AccessDevice getAccessDeviceFromUser(co.ecg.alpaca.toolkit.generated.User user)
throws HelperException
user - The User of the AccessDeviceHelperExceptionpublic static String getRepositoryURL(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice, String deviceType, String macAddress, String fileFormat, String method) throws HelperException
accessDevice - The access devicedeviceType - macAddress - fileFormat - method - GET or PUTHelperExceptionpublic static boolean isCompatibleDeviceType(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice,
AccessDeviceInformation<?> information,
String deviceType)
throws HelperException
accessDevice - The AccessDeviceinformation - The AccessDeviceInformation for the AccessDevicedeviceType - The device type to check for compatibilityHelperExceptionpublic static void rebuildAccessDeviceConfigurationFiles(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice)
throws HelperException
accessDevice - The access device to rebuildHelperExceptionpublic static void removeEndpointsFromDevice(co.ecg.alpaca.toolkit.generated.AccessDevice device,
List<AccessDeviceUser> accessDeviceUsers)
throws HelperException
device - The device to remove endpointsaccessDeviceUsers - The list of AccessDeviceUsers to removeHelperExceptionpublic static void replaceUserDevice(co.ecg.alpaca.toolkit.generated.User user,
co.ecg.alpaca.toolkit.generated.AccessDevice newDevice)
throws HelperException
user - The User to modifynewDevice - The device to assignco.ecg.alpaca.toolkit.exception.RequestException - Thrown if an issue is encountered during migrationHelperExceptionpublic static void resetAccessDevice(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice)
throws HelperException
accessDevice - The device to resetHelperException - Thrown if an issue is encountered during migrationpublic static com.github.zafarkhaja.semver.Version getDeviceVersion(co.ecg.alpaca.toolkit.generated.AccessDevice accessDevice)
throws HelperException
accessDevice - The access device subclass to retrieve the version.Version object or NULL if not found.HelperExceptionpublic static co.ecg.alpaca.toolkit.generated.AccessDevice retrieveUserAccessDeviceSubtype(co.ecg.alpaca.toolkit.generated.AccessDevice device,
co.ecg.alpaca.toolkit.generated.User user)
throws HelperException
device - The AccessDevice to determineuser - A User that is assigned to the AccessDeviceHelperExceptionpublic static AccessDeviceUser getPrimaryAccessDeviceUser(co.ecg.alpaca.toolkit.generated.GroupAccessDevice gad) throws HelperException
gad - The GroupAccessDevice to determineHelperExceptionpublic static void backupDevice(AccessDeviceInformation<co.ecg.alpaca.toolkit.generated.GroupAccessDevice> gadInformation, PrintStream out) throws HelperException, IOException
gadInformation - The AccessDeviceInformation for the AccessDeviceout - The Print Stream where device storage information is printedHelperExceptionIOExceptionpublic static List<DeviceFile> downloadFTPFiles(co.ecg.alpaca.toolkit.generated.AccessDevice device) throws HelperException, co.ecg.utilities.exception.AlpacaUtilityException, IOException
device - The access device that owns the files that are being retrieved.HelperExceptionco.ecg.utilities.exception.AlpacaUtilityExceptionIOExceptionCopyright © 2016. All rights reserved.