public class Unit extends ItemIcon
Modifier and Type | Class and Description |
---|---|
static class |
Unit.accessFlag
ACL flags constants
|
static class |
Unit.calcFlag
Calculation flags constants
|
static class |
Unit.dataFlag
Data flags constants
|
static class |
Unit.events
Events
|
static class |
Unit.execCmdFlag
Commands flags
|
static class |
Unit.logMessageAction
Log message action constants
|
Item.ItemType, Item.measureUnitsFlag, Item.measureUnitsType, Item.UpdateItemProperty
Constructor and Description |
---|
Unit() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAccessPassword()
Unit access password
|
java.lang.Long |
getCalcFlags()
Unit calculation flags
|
ItemProperties |
getCommandDefinitionsPlugin() |
java.util.List |
getCommands()
Unit commands list
|
java.lang.Long |
getDeviceTypeId()
Unit device type ID
|
java.lang.Long |
getEngineHoursCounter()
Unit engine hours counter, in hours
|
UnitData |
getLastMessage()
Unit last message
|
java.util.Map<java.lang.String,java.lang.Object> |
getMessageParams()
Message parameters change
|
java.lang.Long |
getMileageCounter()
Unit mileage counter
|
java.lang.String |
getPhoneNumber()
Unit phone number
|
java.lang.String |
getPhoneNumber2()
Secondary unit phone number
|
UnitData.Position |
getPosition()
Unit position
|
Sensor |
getSensorPlugin() |
java.lang.Long |
getTrafficCounter()
Unit GPRS traffic counter, in KB
|
java.lang.String |
getUniqueId()
Unit unique ID
|
void |
handleMessage(Message message)
Handle new message from server for this unit.
|
void |
remoteCommand(java.lang.String commandName,
java.lang.String linkType,
java.lang.String param,
int timeout,
long flags,
ResponseHandler callback)
Schedule remote command to unit, require ACL of current user not lower then specified in command properties
|
void |
updateAccessPassword(java.lang.String accessPassword,
ResponseHandler callback)
Update unit access password, require ACL bit Unit.accessFlag.editDevice over item
|
void |
updateCalcFlags(java.lang.Long newValue,
ResponseHandler callback)
Update calculation flags, see Unit.calcFlags for possible flags, require ACL bit Unit.accessFlag.editCounters over item
|
void |
updateDeviceSettings(long deviceTypeId,
java.lang.String uniqueId,
ResponseHandler callback)
Update unit device type configuration, require ACL bit Unit.accessFlag.editDevice over item
|
void |
updateEngineHoursCounter(java.lang.Long newValue,
ResponseHandler callback)
Update engine hours counter, require ACL bit Unit.accessFlag.editCounters over item
|
boolean |
updateItemData(java.lang.String key,
com.google.gson.JsonElement data) |
void |
updateMileageCounter(java.lang.Long newValue,
ResponseHandler callback)
Update mileage counter, require ACL bit Unit.accessFlag.editCounters over item
|
void |
updatePhoneNumber(java.lang.String phoneNumber,
ResponseHandler callback)
Update unit phone number, require ACL bit Unit.accessFlag.editDevice over item
|
void |
updatePhoneNumber2(java.lang.String phoneNumber,
ResponseHandler callback)
Update secondary unit phone number, require ACL bit Unit.accessFlag.editDevice over item
|
void |
updateTrafficCounter(java.lang.Long newValue,
boolean regReset,
ResponseHandler callback)
Update traffic counter, require ACL bit Unit.accessFlag.editCounters over item
|
downloadIcon, getIconUrl, updateIcon
addLogRecord, fireItemPropertyEvent, getAccountId, getAdminFieldsPlugin, getCreatorId, getCustomFieldsPlugin, getCustomProperty, getDataFlags, getId, getItemType, getMeasureUnits, getName, getOnUpdatePropertiesCallback, getUserAccess, onUpdateProperties, registerItemPropertyHandler, setDataFlags, updateCustomProperty, updateMeasureUnits, updateName
addListener, clearListeners, fireEvent, removeListener, removeListeners
public ItemProperties getCommandDefinitionsPlugin()
public Sensor getSensorPlugin()
public java.lang.String getUniqueId()
public java.lang.Long getDeviceTypeId()
public java.lang.String getPhoneNumber()
public java.lang.String getPhoneNumber2()
public java.lang.String getAccessPassword()
public java.util.List getCommands()
public java.lang.Long getCalcFlags()
public java.lang.Long getMileageCounter()
public java.lang.Long getEngineHoursCounter()
public java.lang.Long getTrafficCounter()
public java.util.Map<java.lang.String,java.lang.Object> getMessageParams()
public UnitData.Position getPosition()
public UnitData getLastMessage()
public void remoteCommand(java.lang.String commandName, java.lang.String linkType, java.lang.String param, int timeout, long flags, ResponseHandler callback)
commandName
- command namelinkType
- link type, can be empty for auto-select or one of: gsm, tcp, udp, vrtparam
- optional command textual parametertimeout
- timeout for command to wait in commands queue, in secondsflags
- additional flagscallback
- callback that get result of command schedulingpublic void updateDeviceSettings(long deviceTypeId, java.lang.String uniqueId, ResponseHandler callback)
deviceTypeId
- ID of device typeuniqueId
- unique id for unit (IMEI, etc)callback
- callback that get result of server operationpublic void updatePhoneNumber(java.lang.String phoneNumber, ResponseHandler callback)
phoneNumber
- new phone numbercallback
- callback that get result of server operationpublic void updatePhoneNumber2(java.lang.String phoneNumber, ResponseHandler callback)
phoneNumber
- new phone numbercallback
- callback that get result of server operationpublic void updateAccessPassword(java.lang.String accessPassword, ResponseHandler callback)
accessPassword
- new access passwordcallback
- callback that get result of server operationpublic void updateMileageCounter(java.lang.Long newValue, ResponseHandler callback)
newValue
- new value for counter, in kmcallback
- callback that get result of server operationpublic void updateEngineHoursCounter(java.lang.Long newValue, ResponseHandler callback)
newValue
- new value for counter, in hourscallback
- callback that get result of server operationpublic void updateTrafficCounter(java.lang.Long newValue, boolean regReset, ResponseHandler callback)
newValue
- new value for counter, in kbregReset
- Register reset traffic counter message in unit eventscallback
- callback that get result of server operationpublic void updateCalcFlags(java.lang.Long newValue, ResponseHandler callback)
newValue
- new value for calculation flagscallback
- callback that get result of server operationpublic void handleMessage(Message message)
handleMessage
in class Item
message
- Message datapublic boolean updateItemData(java.lang.String key, com.google.gson.JsonElement data)
updateItemData
in class ItemIcon