object save optimization - object properties divided into groups and anly modified...
[public/netxms.git] / src / server / core / entirenet.cpp
1 /*
2 ** NetXMS - Network Management System
3 ** Copyright (C) 2003-2017 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 bool success = saveCommonProperties(hdb);
49 if (success)
50 success = saveACLToDB(hdb);
51
52 // Unlock object and clear modification flag
53 m_modified = 0;
54 unlockProperties();
55 return success;
56 }
57
58 /**
59 * Load properties from database
60 */
61 void Network::loadFromDatabase(DB_HANDLE hdb)
62 {
63 loadCommonProperties(hdb);
64 loadACLFromDB(hdb);
65 }
66
67 /**
68 * Called by client session handler to check if threshold summary should be shown for this object.
69 */
70 bool Network::showThresholdSummary()
71 {
72 return true;
73 }