/** * Get the device type identifier. * * @param deviceType * @return */ protected static String getDeviceTypeIdentifier(IDeviceType deviceType) { return "Spec_" + deviceType.getToken(); }
@Override public URI getDeviceTypeIdentifier(IDeviceType deviceType) throws SiteWhereException { return createUri(SITEWHERE_PROTOCOL + "devicetype/" + deviceType.getToken()); }
@Override public boolean appliesTo(IDeviceContext<T> criteria) { if (criteria.getDeviceType().getToken().equals(getDeviceTypeToken())) { return true; } return false; }
/** * Common logic executed before deleting a device type. * * @param deviceType * @param deviceManagement * @throws SiteWhereException */ public static void deviceTypeDeleteLogic(IDeviceType deviceType, IDeviceManagement deviceManagement) throws SiteWhereException { DeviceSearchCriteria criteria = new DeviceSearchCriteria(1, 1, null, null); criteria.setDeviceTypeToken(deviceType.getToken()); ISearchResults<IDevice> devices = deviceManagement.listDevices(criteria); if (devices.getNumResults() > 0) { throw new SiteWhereSystemException(ErrorCode.DeviceTypeInUseByDevices, ErrorLevel.ERROR); } }
IDeviceContext<T> context = buildContext(metadata); getLogger().debug("Built context: Device: " + context.getDevice().getToken() + " Device type: " + context.getDeviceType().getToken());
+ area.getName() + "</a>"; html += " with device type <a href=\"" + relativePath + "/devicetypes/" + deviceType.getToken() + ".html\">" + deviceType.getName() + "</a>"; if (!StringUtils.isEmpty(criteria.getGroupToken())) {
nested.getPath()); headBuilder.setField(header.findFieldByName(ProtobufNaming.HEADER_NESTED_TYPE_FIELD_NAME), nestedType.getToken());