Package net.solarnetwork.central.dao
Class AuditUserServiceEntity
java.lang.Object
net.solarnetwork.dao.BasicIdentity<net.solarnetwork.domain.datum.DatumId>
net.solarnetwork.central.dao.AuditUserServiceEntity
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<net.solarnetwork.domain.datum.DatumId>,AuditUserServiceValue,UserIdRelated,net.solarnetwork.domain.Differentiable<AuditUserServiceValue>,net.solarnetwork.domain.Identity<net.solarnetwork.domain.datum.DatumId>
public class AuditUserServiceEntity
extends net.solarnetwork.dao.BasicIdentity<net.solarnetwork.domain.datum.DatumId>
implements AuditUserServiceValue, Cloneable, Serializable, net.solarnetwork.domain.Differentiable<AuditUserServiceValue>
Audit user service entity.
Although DatumId is used as a primary key for this entity, and
DatumId.getKind() will be set to
ObjectDatumKind.Node, this entity is
not node related, and the DatumId.getObjectId() actually
refers to a user entity.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAuditUserServiceEntity(net.solarnetwork.domain.datum.DatumId id, net.solarnetwork.domain.datum.Aggregation aggregation, long count) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic AuditUserServiceEntityaccumulativeAuditUserService(Long userId, String service, Instant timestamp, long count) Create an accumulative "running total" audit datum.static AuditUserServiceEntitydailyAuditUserService(Long userId, String service, Instant timestamp, long count) Create a daily audit datum.booleandiffersFrom(AuditUserServiceValue other) net.solarnetwork.domain.datum.AggregationGet time period associated with this audit value.longgetCount()Get the count value properties.Get the associated timestamp of this audit value.static AuditUserServiceEntityhourlyAuditUserService(Long userId, String service, Instant timestamp, long count) Create a hourly audit datum.booleanisSameAs(AuditUserServiceValue other) Test if the properties of another object are the same as in this instance.static AuditUserServiceEntitymonthlyAuditUserService(Long userId, String service, Instant timestamp, long count) Create a monthly audit datum.toString()Methods inherited from class net.solarnetwork.dao.BasicIdentity
clone, compareTo, equals, getId, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.solarnetwork.central.domain.AuditUserServiceValue
getService, getUserIdMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.solarnetwork.domain.Identity
getId, hasId
-
Constructor Details
-
AuditUserServiceEntity
public AuditUserServiceEntity(net.solarnetwork.domain.datum.DatumId id, net.solarnetwork.domain.datum.Aggregation aggregation, long count) Constructor.- Parameters:
id- the IDaggregation- the aggregationcount- the count
-
-
Method Details
-
hourlyAuditUserService
public static AuditUserServiceEntity hourlyAuditUserService(Long userId, String service, Instant timestamp, long count) Create a hourly audit datum.- Parameters:
userId- the user IDservice- the service nametimestamp- the timecount- the count- Returns:
- the audit entity
-
dailyAuditUserService
public static AuditUserServiceEntity dailyAuditUserService(Long userId, String service, Instant timestamp, long count) Create a daily audit datum.- Parameters:
userId- the user IDservice- the service nametimestamp- the timecount- the count- Returns:
- the audit entity
-
monthlyAuditUserService
public static AuditUserServiceEntity monthlyAuditUserService(Long userId, String service, Instant timestamp, long count) Create a monthly audit datum.- Parameters:
userId- the user IDservice- the service nametimestamp- the timecount- the count- Returns:
- the audit entity
-
accumulativeAuditUserService
public static AuditUserServiceEntity accumulativeAuditUserService(Long userId, String service, Instant timestamp, long count) Create an accumulative "running total" audit datum.- Parameters:
userId- the user IDservice- the service nametimestamp- the timecount- the count- Returns:
- the audit entity
-
toString
-
isSameAs
Test if the properties of another object are the same as in this instance.- Parameters:
other- the other entity to compare to- Returns:
- true if the properties of this instance are equal to the other
-
differsFrom
- Specified by:
differsFromin interfacenet.solarnetwork.domain.Differentiable<AuditUserServiceValue>
-
getTimestamp
Description copied from interface:AuditUserServiceValueGet the associated timestamp of this audit value.This value represents the point in time the count associated with this service were observed, collected, inferred, predicted, etc.
This is a shortcut for
getId().getTimestamp().- Specified by:
getTimestampin interfaceAuditUserServiceValue- Returns:
- the timestamp for this datum
-
getAggregation
public net.solarnetwork.domain.datum.Aggregation getAggregation()Description copied from interface:AuditUserServiceValueGet time period associated with this audit value.- Specified by:
getAggregationin interfaceAuditUserServiceValue- Returns:
- the aggregation
-
getCount
public long getCount()Description copied from interface:AuditUserServiceValueGet the count value properties.- Specified by:
getCountin interfaceAuditUserServiceValue- Returns:
- the count
-