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 Details

    • AuditUserServiceEntity

      public AuditUserServiceEntity(net.solarnetwork.domain.datum.DatumId id, net.solarnetwork.domain.datum.Aggregation aggregation, long count)
      Constructor.
      Parameters:
      id - the ID
      aggregation - the aggregation
      count - 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 ID
      service - the service name
      timestamp - the time
      count - 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 ID
      service - the service name
      timestamp - the time
      count - 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 ID
      service - the service name
      timestamp - the time
      count - 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 ID
      service - the service name
      timestamp - the time
      count - the count
      Returns:
      the audit entity
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isSameAs

      public boolean isSameAs(AuditUserServiceValue other)
      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

      public boolean differsFrom(AuditUserServiceValue other)
      Specified by:
      differsFrom in interface net.solarnetwork.domain.Differentiable<AuditUserServiceValue>
    • getTimestamp

      public Instant getTimestamp()
      Description copied from interface: AuditUserServiceValue
      Get 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:
      getTimestamp in interface AuditUserServiceValue
      Returns:
      the timestamp for this datum
    • getAggregation

      public net.solarnetwork.domain.datum.Aggregation getAggregation()
      Description copied from interface: AuditUserServiceValue
      Get time period associated with this audit value.
      Specified by:
      getAggregation in interface AuditUserServiceValue
      Returns:
      the aggregation
    • getCount

      public long getCount()
      Description copied from interface: AuditUserServiceValue
      Get the count value properties.
      Specified by:
      getCount in interface AuditUserServiceValue
      Returns:
      the count