| 171 | } |
| 172 | |
| 173 | void DbObject::SendStatusUpdate() |
| 174 | { |
| 175 | /* status attributes */ |
| 176 | Dictionary::Ptr fields = GetStatusFields(); |
| 177 | |
| 178 | if (!fields) |
| 179 | return; |
| 180 | |
| 181 | DbQuery query; |
| 182 | query.Table = GetType()->GetTable() + "status"; |
| 183 | query.Type = DbQueryInsert | DbQueryUpdate; |
| 184 | query.Category = DbCatState; |
| 185 | query.Fields = fields; |
| 186 | query.Fields->Set(GetType()->GetIDColumn(), GetObject()); |
| 187 | |
| 188 | /* do not override endpoint_object_id for endpoints & zones */ |
| 189 | if (query.Table != "endpointstatus" && query.Table != "zonestatus") { |
| 190 | String node = IcingaApplication::GetInstance()->GetNodeName(); |
| 191 | |
| 192 | Endpoint::Ptr endpoint = Endpoint::GetByName(node); |
| 193 | if (endpoint) |
| 194 | query.Fields->Set("endpoint_object_id", endpoint); |
| 195 | } |
| 196 | |
| 197 | query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */ |
| 198 | |
| 199 | query.Fields->Set("status_update_time", DbValue::FromTimestamp(Utility::GetTime())); |
| 200 | query.WhereCriteria = new Dictionary({ |
| 201 | { GetType()->GetIDColumn(), GetObject() } |
| 202 | }); |
| 203 | query.Object = this; |
| 204 | query.StatusUpdate = true; |
| 205 | OnQuery(query); |
| 206 | |
| 207 | m_LastStatusUpdate = Utility::GetTime(); |
| 208 | |
| 209 | OnStatusUpdate(); |
| 210 | } |
| 211 | |
| 212 | void DbObject::SendVarsConfigUpdateHeavy() |
| 213 | { |
no test coverage detected