4b0a970ac3640e19386627ccc1eca675d3813f8c
[public/netxms.git] / src / server / core / entirenet.cpp
1 /*
2 ** NetXMS - Network Management System
3 ** Copyright (C) 2003-2013 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 ** File: entirenet.cpp
20 **/
21
22 #include "nxcore.h"
23
24 /**
25 * Network class default constructor
26 */
27 Network::Network() : NetObj()
28 {
29 m_id = BUILTIN_OID_NETWORK;
30 _tcscpy(m_name, _T("Entire Network"));
31 m_guid = uuid::generate();
32 }
33
34 /**
35 * Network class destructor
36 */
37 Network::~Network()
38 {
39 }
40
41 /**
42 * Save object to database
43 */
44 bool Network::saveToDatabase(DB_HANDLE hdb)
45 {
46 lockProperties();
47
48 saveCommonProperties(hdb);
49 saveACLToDB(hdb);
50
51 // Unlock object and clear modification flag
52 m_isModified = false;
53 unlockProperties();
54 return true;
55 }
56
57 /**
58 * Load properties from database
59 */
60 void Network::loadFromDatabase(DB_HANDLE hdb)
61 {
62 loadCommonProperties(hdb);
63 loadACLFromDB(hdb);
64 }
65
66 /**
67 * Called by client session handler to check if threshold summary should be shown for this object.
68 */
69 bool Network::showThresholdSummary()
70 {
71 return true;
72 }