Package com.storedobject.iot
Class SuperUnit
java.lang.Object
com.storedobject.core.StoredObject
com.storedobject.core.Name
com.storedobject.iot.AbstractUnit
com.storedobject.iot.Unit
com.storedobject.iot.SuperUnit
- All Implemented Interfaces:
Displayable,HasName,StringFiller,HasChildren,HasId
-
Field Summary
Fields inherited from class com.storedobject.core.StoredObject
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprotected final DoublecomputeConsumption(int resource, long from, long to) Computes the resource consumption for a specific unit within a given time interval.final voidComputes and updates statistics for the given transaction manager based on the unit type and data classes associated with the unit.static SuperUnitintintprotected UnitgetUnitForStatistics(String name) static String[]links()static ObjectIterator<? extends SuperUnit> final voidRecomputes all statistics for the current unit by first deleting the existing statistics and then regenerating them.voidsaved()Overridden method that is invoked when the object's state has been saved successfully.voidvalidateChildAttach(StoredObject child, int linkType) Do validation when a child is attached.Methods inherited from class com.storedobject.iot.Unit
getBlock, getBlockId, getCode, getDailyStatistics, getDailyStatistics, getDailyStatistics, getHourlyStatistics, getHourlyStatistics, getHourlyStatistics, getLayoutStyle, getMonthlyStatistics, getMonthlyStatistics, getMonthlyStatistics, getOrdinality, getOrdinalityValue, getOrdinalityValue, getOrdinalityValues, getSite, getSiteId, getType, getWeeklyStatistics, getWeeklyStatistics, getWeeklyStatistics, getYearlyStatistics, getYearlyStatistics, getYearlyStatistics, hints, indices, listDailyStatistics, listDailyStatistics, listDailyStatistics, listHourlyStatistics, listHourlyStatistics, listHourlyStatistics, listMonthlyStatistics, listMonthlyStatistics, listMonthlyStatistics, listWeeklyStatistics, listWeeklyStatistics, listWeeklyStatistics, listYearlyStatistics, listYearlyStatistics, setBlock, setBlock, setBlock, setCode, setOrdinality, toDisplay, validateDataMethods inherited from class com.storedobject.iot.AbstractUnit
consumes, consumes, getActive, getConsumptionCalculator, getDailyConsumption, getDailyConsumption, getDailyConsumption, getHourlyConsumption, getHourlyConsumption, getHourlyConsumption, getMonthlyConsumption, getMonthlyConsumption, getMonthlyConsumption, getWeeklyConsumption, getWeeklyConsumption, getWeeklyConsumption, getYearlyConsumption, getYearlyConsumption, getYearlyConsumption, listDailyConsumption, listDailyConsumption, listDailyConsumption, listHourlyConsumption, listHourlyConsumption, listHourlyConsumption, listMonthlyConsumption, listMonthlyConsumption, listMonthlyConsumption, listWeeklyConsumption, listWeeklyConsumption, listWeeklyConsumption, listYearlyConsumption, listYearlyConsumption, setActiveMethods inherited from class com.storedobject.core.Name
getName, getUniqueCondition, setName, toStringMethods inherited from class com.storedobject.core.StoredObject
addLink, addLink, addLink, addLink, addLink, addLink, addLink, addLink, checkCurrency, checkCurrency, checkForDuplicate, checkForDuplicate, checkTimeZone, checkTransaction, clearObjectLinks, contemporary, copy, copy, count, count, count, count, count, count, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countLinks, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, countMasters, create, created, delete, delete, delete, deleted, directUpdate, equals, exists, exists, exists, exists, exists, existsFileData, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLink, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsLinks, existsMaster, existsMaster, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, existsMasters, family, family, family, family, fill, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, get, getActor, getAttachment, getAttachmentId, getChildren, getContemporaryOf, getDeleted, getDeleted, getExistsCondition, getExistsCondition, getFileData, getFileData, getHistorical, getId, getKeyIndex, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getMaster, getNotExistsCondition, getNotExistsCondition, getParent, getParent, getParent, getParentId, getParentId, getParentId, getRelated, getRelated, getTransaction, getTransactionId, getTransactionIP, getUnique, hashCode, inserted, isModified, isVirtual, list, list, list, list, list, list, list, list, list, list, list, list, list, listDeletedIds, listFileData, listFileData, listHistory, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listLinks, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listMasters, listTree, listTree, listTree, listTree, listViaQuery, listViaQuery, load, load, load, load, loadAttributesFrom, loaded, loading, makeNew, makeVirtual, migrate, moduleName, nextVersion, objectLink, objectLink, objectLink, objectLinks, objectLinks, old, person, previousVersion, previousVersion, query, query, query, query, query, query, query, query, query, query, query, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryLinks, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, queryMasters, reload, reload, reloaded, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeAllLinks, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeLink, removeReverseLinks, removeReverseLinks, save, save, save, save, save, save, save, save, save, save, save, save, save, save, save, saving, setMaster, setRawValue, setTransaction, stringify, tableName, timestamp, toCode, transacting, undelete, undelete, undeleted, updated, user, userId, validate, validateChildDetach, validateChildUpdate, validateDelete, validateInsert, validateParentAttach, validateParentDetach, validateParentUpdate, validateUndelete, validateUpdate, valueEquals
-
Constructor Details
-
SuperUnit
public SuperUnit()
-
-
Method Details
-
columns
-
links
-
get
-
list
-
validateChildAttach
Description copied from class:StoredObjectDo validation when a child is attached.Note: This method will be invoked only if this class implements
HasChildren.- Overrides:
validateChildAttachin classStoredObject- Parameters:
child- Child to validate.linkType- Link type.- Throws:
Exception- By raising an exception from this method, the current transaction can be abandoned.
-
listAllChildren
-
getTotalChildCount
public int getTotalChildCount() -
listImmediateChildren
-
getImmediateChildCount
public int getImmediateChildCount() -
computeConsumption
Description copied from class:AbstractUnitComputes the resource consumption for a specific unit within a given time interval.- Overrides:
computeConsumptionin classAbstractUnit- Parameters:
resource- the resource identifier to calculate consumption forfrom- the start time (in milliseconds since epoch) of the period for which consumption is to be computedto- the end time (in milliseconds since epoch) of the period for which consumption is to be computed- Returns:
- the calculated consumption as a Double, or null if no ConsumptionCalculator is available for the resource
-
recomputeStatistics
Description copied from class:UnitRecomputes all statistics for the current unit by first deleting the existing statistics and then regenerating them.- Overrides:
recomputeStatisticsin classUnit- Parameters:
tm- TheTransactionManagerinstance used for performing the necessary database transactions.
-
computeStatistics
Description copied from class:UnitComputes and updates statistics for the given transaction manager based on the unit type and data classes associated with the unit.- Overrides:
computeStatisticsin classUnit- Parameters:
tm- The transaction manager instance responsible for managing database transactions during the computation of statistics.
-
saved
public void saved()Description copied from class:UnitOverridden method that is invoked when the object's state has been saved successfully. This method calls the parent class's `saved()` method to ensure that any additional saving logic from the superclass is executed. After the superclass logic is executed, it triggers a refresh operation for the `DataSet` to ensure any associated data is updated and synchronized if applicable. -
getUnitForStatistics
-