Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3255504
D5164.id16774.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D5164.id16774.diff
View Options
diff --git a/services/tunnelbroker/src/Database/DeviceSessionItem.h b/services/tunnelbroker/src/Database/DeviceSessionItem.h
--- a/services/tunnelbroker/src/Database/DeviceSessionItem.h
+++ b/services/tunnelbroker/src/Database/DeviceSessionItem.h
@@ -17,6 +17,7 @@
std::string appVersion;
std::string deviceOs;
int64_t checkpointTime = 0;
+ bool isOnline = false;
void validate() const override;
@@ -30,6 +31,7 @@
static const std::string FIELD_DEVICE_OS;
static const std::string FIELD_CHECKPOINT_TIME;
static const std::string FIELD_EXPIRE;
+ static const std::string FIELD_IS_ONLINE;
PrimaryKeyDescriptor getPrimaryKeyDescriptor() const override;
PrimaryKeyValue getPrimaryKeyValue() const override;
@@ -42,6 +44,7 @@
std::string getAppVersion() const;
std::string getDeviceOs() const;
int64_t getCheckpointTime() const;
+ bool getIsOnline() const;
DeviceSessionItem() {
}
diff --git a/services/tunnelbroker/src/Database/DeviceSessionItem.cpp b/services/tunnelbroker/src/Database/DeviceSessionItem.cpp
--- a/services/tunnelbroker/src/Database/DeviceSessionItem.cpp
+++ b/services/tunnelbroker/src/Database/DeviceSessionItem.cpp
@@ -17,6 +17,7 @@
const std::string DeviceSessionItem::FIELD_DEVICE_OS = "DeviceOS";
const std::string DeviceSessionItem::FIELD_CHECKPOINT_TIME = "CheckpointTime";
const std::string DeviceSessionItem::FIELD_EXPIRE = "Expire";
+const std::string DeviceSessionItem::FIELD_IS_ONLINE = "IsOnline";
DeviceSessionItem::DeviceSessionItem(
const std::string sessionID,
@@ -71,6 +72,8 @@
std::string(
itemFromDB.at(DeviceSessionItem::FIELD_CHECKPOINT_TIME).GetS())
.c_str());
+ this->isOnline =
+ itemFromDB.at(DeviceSessionItem::FIELD_IS_ONLINE).GetBool();
} catch (std::logic_error &e) {
throw std::runtime_error(
"Invalid device session database value " + std::string(e.what()));
@@ -123,6 +126,10 @@
return this->checkpointTime;
}
+bool DeviceSessionItem::getIsOnline() const {
+ return this->isOnline;
+}
+
} // namespace database
} // namespace network
} // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 8:22 PM (19 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2502573
Default Alt Text
D5164.id16774.diff (2 KB)
Attached To
Mode
D5164: [services] Tunnelbroker - Update `SessionItem` database entity with the `IsOnline` field
Attached
Detach File
Event Timeline
Log In to Comment