ReplicationService class

Implemented types

Constructors

ReplicationService()

Properties

cloud ↔ CloudService
Cloud Service Enables Replication & Pairing
getter/setter pair
cloudEvents List<Event>
getter/setter pair
cloudNodeList List<Map>
getter/setter pair
cloudNodePath List<String>
getter/setter pair
companyEvents List<String>
getter/setter pair
companyInitialized bool
getter/setter pair
contentEvents List<String>
getter/setter pair
currentDeviceInitialized bool
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sharedScore String
getter/setter pair
sharedScoreDate String
getter/setter pair
userEvents List<String>
getter/setter pair
username String
getter/setter pair
usernameInitialized bool
getter/setter pair

Methods

addMessageHandler(MessageType type, Function handler) → void
addOrUpdateCloudConnected(CompanyEvent cloudEvent, String? pluginUUID, String? metricUUID, bool metrics) Future<void>
addOrUpdateRecommendation(CloudConnectedToolRecommendation cloudEvent, String? pluginUUID, String? metricUUID, bool metrics) Future<void>
addOrUpdateStatusRecommendation(CloudConnectedToolStatusRecommendation cloudEvent, String? pluginUUID, String? metricUUID, bool metrics) Future<void>
addSettingsConsent(String username, bool settingsValue) Future<void>
Adds first approach if settingsValue = true -> consent accepted if settingsValue = true -> consent rejected
override
checkCompany(String idCompany) Future<bool>
Check company
override
checkConnection() Future<bool>
Checks if the device is connected to the internet If not - No replication possible
override
checkConsent(Node node, String username) Future<bool>
Checks the consent of a user & if needed, asks for it
override
checkMutualMerge(String userOne, String userTwo, String agreement, String type) Future<void>
checkPairing(String qrUserId, String qrDeviceId, String typeOfPairing) Future<bool>
Check if the current device is paired with another device/employee
override
checkParents(String path) Future<bool>
checkReplication() Future<bool>
Checks if replication has took place If replication has been done -> TRUE If replication has not been done -> FALSE
override
checkReplicationTimingStrategy() Future<bool>
Checks if a user has replicated data in <30 days If replication <30 days -> TRUE If replication >30 days -> FALSE
override
cleanData(DateTime actual) Future<void>
cleanUp(List<Event> events) Future<void>
cloudToLocalReplication(String _username, DateTime _actual, DateTime _fromDate, bool _fullRep) Future<void>
convertJsonStringToNode(String content) → Node
convertNodeToJsonString(Node node) Future<Map>
createCloudConnected(Event event) Future<bool>
createCloudConnectedLocalStorage(String? pluginUUID, String? metricUUID, bool metrics) Future<void>
createCloudUser(String userId, [String? email, String? access, String? expires, String? name, String? publicKey]) Future<bool>
Creates a cloud user. Necessary for pairing & replication
override
createCompany(String companyName, [String? email, String? idCompany, String? location]) Future<String>
Create a company
override
createHandler(EventChange event) Future<void>
CREATE HANDLERS 4 EVENT TYPES: create, update, rename, delete
override
createPairingStructure(String qrUserId, String qrDeviceId, String publicKey, String type) Future<bool>
EXPERIMENTAL METHODS CHECK IF SOLVE THE SETPAIR/GETSHAREDNODES BEHAVIOUR
override
createRecommendation(Event event) Future<bool>
createStatusRecommendation(Event event) Future<bool>
decryptCloudData(Event event) Future<Map>
decryptCloudNode(Event score, Event key, String encryptionKey) Future<Map>
decryptSharedNode(Event event, String keyPath) Future<Map>
decryptWithUserKey(String key, String userKey) Future<String>
deleteHandler(EventChange event) Future<void>
override
deleteMutualMerge(String userOne, String userTwo, String typeOfPairing) Future<bool>
encryptCloudData(Node node) Future<Map>
encryptListenerCloudData(Node node) Future<Map>
encryptNodeToShare(Node node, String keyPath) Future<Map>
encryptWithUserKey(String key) Future<String>
endGeigerStorage() Future<void>
Flushes memory, ends storage...
override
geigerReplication(dynamic deleteHandler, dynamic createHandler, dynamic updateHandler, dynamic renameHandler) Future<bool>
Achieves full or partial replication INCLUDES GEIGERREPLICATIONLISTENER METHOD WITHOUT GLOBAL DATA
override
geigerReplicationListener(dynamic deleteHandler, dynamic createHandler, dynamic updateHandler, dynamic renameHandler) Future<void>
Achieves full or partial replication INCLUDES LISTENERS INCLUDES GLOBAL DATA
override
geigerReplicationListenerStart(dynamic deleteHandler, dynamic createHandler, dynamic updateHandler, dynamic renameHandler) Future<void>
Starts the geiger Replication listeners
override
geigerReplicationUpdate() Future<bool>
Achieves full or partial replication Once listeners are already active
override
getAllNodes(bool cleanup) Future<List<Node>>
getAllNodesLastModified(DateTime filter) Future<List<Node>>
getCurrentCompany() Future<void>
getCurrentDeviceUUID() Future<void>
getCurrentUserUUID() Future<void>
getDateDaysBefore(int daysBefore) Future<String>
getNode(String path) Future<Node>
getPartialJsonString(String content) Map
getRecursiveNodes(Node node, List<Node> list, bool cleanup) Future<List<Node>>
getSensorData() Future<bool>
override
getSharedNodes(String receiverUserId, String senderUserId) Future<bool>
TODO NO NEED FOR THIS getSharedNodes
override
getSpecificNodes() Future<List<Node>>
getTrainingData() Future<bool>
override
initGeigerStorage() Future<void>
UTILS IN THIS SECTION ARE REPETITIVE TASKS AVOID DUPLICATION CODE
override
listCompany() Future<String>
List company
override
localToCloudReplication(String _username, DateTime _actual, DateTime _fromDate, bool _fullRep) Future<void>
nodeExists(String path) Future<bool>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renameHandler(EventChange event) Future<void>
override
sendAMessageType({required MessageType messageType, required String targetId, String? id, GeigerUrl? pluginUrl}) Future<bool>
setPair(String qrUserId, String qrDeviceId, String publicKey, String agreement, String type) Future<bool>
INFO --- QR PAIRING USER --- qrUserId PAIR DeviceId --- qrDeviceId public key --- publicKey agreement --- {"in","out","both"} type --- device / employee
override
shareNode(String nodePath, String senderUserId, String receiverUserId) Future<bool>
TODO NO NEED FOR THIS shareNode
override
storeLanguage({required String value, required Node nodeName, required String nodeValueKey, required String language}) Future<void>
storeLanguages({required String value, required Node nodeName, required String nodeValueKey}) Future<void>
toString() String
A string representation of this object.
inherited
unpair(String qrUserId, String qrDeviceId, String typeOfPairing) Future<bool>
Unpair current device with another device/employee
override
updateCloudConnected(Event event) Future<bool>
updateGlobalData() Future<bool>
THIS METHOD INCLUDES ALL THE SUB-UPDATES METHODS UPDATE THREATS UPDATETHREATWEIGHTS UPDATERECOMMENDATIONS UPDATESECURITYDEFENDERSINFO includes: security defenders security defenders organizations security defenders location
override
updateHandler(EventChange event) Future<void>
override
updateLocalNodeWithCloudNode(Node eventNode, String username) Future<void>
updateLocalNodeWithNewNode(String path, Node node, DateTime cloud) Future<void>
updatePair(String userId1) Future<bool>
TO BE RUN BY THE DEVICE THAT GENERATES THE QR CODE
override
updatePairedEvent(String username, Event event) Future<void>
TODO NO NEED FOR THIS updatePairedEvent if a user receives a shared event but with a different owner checks pairing
updateRecommendation(Event event) Future<bool>
updateRecommendations() Future<void>
Updates Global Recommendations in a Cloud to Local way TO GET FULL DATA -> UPDATETHREATWEIGHTS IS REQUIRED PREVIOUSLY
override
updateReplicationNode(DateTime _actual) Future<void>
updateSecurityDefendersInfo() Future<void>
Updates Security Defenders Info
override
updateSensorData(List<String> types) Future<bool>
override
updateStatusRecommendation(Event event) Future<bool>
updateThreats() Future<void>
updates Geiger defined threats
override
updateThreatWeights() Future<void>
STORE :Global:threats
override
updateTLPWhiteEvents(bool _fullRep, DateTime _fromDate) Future<void>
updateTrainingData(List<String> types) Future<bool>
override
userExists(String userId) Future<bool>
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create() Future<ReplicationService>