958aee969277ce34cfda8b1018c3825e241067b1
[public/netxms.git] / src / java / netxms-client / src / main / java / org / netxms / client / objects / ServiceContainer.java
1 /**
2 * NetXMS - open source network management system
3 * Copyright (C) 2003-2011 Victor Kirhenshtein
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 package org.netxms.client.objects;
20
21 import org.netxms.base.NXCPCodes;
22 import org.netxms.base.NXCPMessage;
23 import org.netxms.client.NXCSession;
24
25 /**
26 * Abstract base class for different SLM objects
27 */
28 public abstract class ServiceContainer extends GenericObject
29 {
30 private double uptimeForDay;
31 private double uptimeForWeek;
32 private double uptimeForMonth;
33
34 public ServiceContainer(NXCPMessage msg, NXCSession session)
35 {
36 super(msg, session);
37 uptimeForDay = msg.getVariableAsReal(NXCPCodes.VID_UPTIME_DAY);
38 uptimeForWeek = msg.getVariableAsReal(NXCPCodes.VID_UPTIME_WEEK);
39 uptimeForMonth = msg.getVariableAsReal(NXCPCodes.VID_UPTIME_MONTH);
40 }
41
42 /**
43 * @return the uptimeForDay
44 */
45 public double getUptimeForDay()
46 {
47 return uptimeForDay;
48 }
49
50 /**
51 * @return the uptimeForWeek
52 */
53 public double getUptimeForWeek()
54 {
55 return uptimeForWeek;
56 }
57
58 /**
59 * @return the uptimeForMonth
60 */
61 public double getUptimeForMonth()
62 {
63 return uptimeForMonth;
64 }
65 }