~ubuntu-branches/ubuntu/raring/eucalyptus/raring

« back to all changes in this revision

Viewing changes to clc/modules/reporting/src/main/java/com/eucalyptus/reporting/modules/instance/UsageSnapshot.java

  • Committer: Package Import Robot
  • Author(s): Brian Thomason
  • Date: 2011-11-29 13:17:52 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 185.
  • Revision ID: package-import@ubuntu.com-20111129131752-rq31al3ntutv2vvl
Tags: upstream-3.0.999beta1
ImportĀ upstreamĀ versionĀ 3.0.999beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package com.eucalyptus.reporting.modules.instance;
 
2
 
 
3
/**
 
4
 * UsageSnapshot of the resource usage of some instance at some point in time.
 
5
 * Contains <i>cumulative</i> usage data so it's populated with
 
6
 * all resource usage which has occurred up until this snapshot was
 
7
 * instantiated. 
 
8
 * 
 
9
 * @author tom.werges
 
10
 */
 
11
class UsageSnapshot
 
12
{
 
13
        private final Long timestampMs;
 
14
        private final InstanceUsageData cumulativeUsageData;
 
15
 
 
16
        /**
 
17
         * For hibernate usage only; don't extend this class
 
18
         */
 
19
        protected UsageSnapshot()
 
20
        {
 
21
                this.timestampMs = null;
 
22
                this.cumulativeUsageData = null;
 
23
        }
 
24
 
 
25
        public UsageSnapshot(long timestampMs, InstanceUsageData cumulativeUsageData)
 
26
        {
 
27
                this.timestampMs = new Long(timestampMs);
 
28
                this.cumulativeUsageData = cumulativeUsageData;
 
29
        }
 
30
 
 
31
        public long getTimestampMs()
 
32
        {
 
33
                assert this.timestampMs != null;
 
34
                return this.timestampMs.longValue();
 
35
        }
 
36
 
 
37
        public InstanceUsageData getCumulativeUsageData()
 
38
        {
 
39
                return this.cumulativeUsageData;
 
40
        }
 
41
 
 
42
}