58
58
$(SIGNATURES)
59
59
Efficient shortcut method to create the user, robot, and session if it doesn't already exist.
60
60
"""
61
- function createDfgSessionIfNotExist (dfg:: CloudGraphsDFG )
61
+ function createDfgSessionIfNotExist (dfg:: Neo4jDFG )
62
62
strip (dfg. userId) == " " && error (" User ID is not populated in DFG." )
63
63
strip (dfg. robotId) == " " && error (" Robot ID is not populated in DFG." )
64
64
strip (dfg. sessionId) == " " && error (" Session ID is not populated in DFG." )
@@ -91,7 +91,7 @@ Returns nothing if it isn't found.
91
91
Notes
92
92
- Returns `Vector{Session}`
93
93
"""
94
- function lsSessions (dfg:: CloudGraphsDFG )
94
+ function lsSessions (dfg:: Neo4jDFG )
95
95
sessionNodes = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:SESSION:`$(dfg. robotId) `:`$(dfg. userId) `)" )
96
96
return map (s -> _convertDictToSession (Neo4j. getnodeproperties (s)), sessionNodes)
97
97
end
@@ -104,7 +104,7 @@ Returns nothing if it isn't found.
104
104
Notes
105
105
- Returns `::Vector{Robot}`
106
106
"""
107
- function lsRobots (dfg:: CloudGraphsDFG )
107
+ function lsRobots (dfg:: Neo4jDFG )
108
108
robotNodes = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:ROBOT:`$(dfg. userId) `)" )
109
109
return map (s -> _convertDictToRobot (Neo4j. getnodeproperties (s)), robotNodes)
110
110
end
@@ -117,7 +117,7 @@ Returns nothing if it isn't found.
117
117
Notes
118
118
- Returns `::Vector{User}`
119
119
"""
120
- function lsUsers (dfg:: CloudGraphsDFG )
120
+ function lsUsers (dfg:: Neo4jDFG )
121
121
userNodes = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:USER)" )
122
122
return map (s -> _convertDictToUser (Neo4j. getnodeproperties (s)), userNodes)
123
123
end
@@ -130,7 +130,7 @@ Returns nothing if it isn't found.
130
130
Notes
131
131
- Returns either `::Union{Session, Nothing}`
132
132
"""
133
- function getSession (dfg:: CloudGraphsDFG , userId:: Symbol , robotId:: Symbol , sessionId:: Symbol )
133
+ function getSession (dfg:: Neo4jDFG , userId:: Symbol , robotId:: Symbol , sessionId:: Symbol )
134
134
! isValidLabel (userId) && error (" Can't retrieve session with user ID '$(userId) '." )
135
135
! isValidLabel (robotId) && error (" Can't retrieve session with robot ID '$(robotId) '." )
136
136
! isValidLabel (sessionId) && error (" Can't retrieve session with session ID '$(sessionId) '." )
@@ -148,8 +148,7 @@ Returns nothing if it isn't found.
148
148
Notes
149
149
- Returns either `::Union{Nothing, Session}`
150
150
"""
151
- <<<<<< < HEAD: src/ CloudGraphsDFG/ services/ CGStructure. jl
152
- function getSession (dfg:: CloudGraphsDFG )
151
+ function getSession (dfg:: Neo4jDFG )
153
152
return getSession (dfg, Symbol (dfg. userId), Symbol (dfg. robotId), Symbol (dfg. sessionId))
154
153
end
155
154
@@ -161,7 +160,7 @@ Returns nothing if it isn't found.
161
160
Notes
162
161
- Returns either `::Union{Robot, Nothing}`
163
162
"""
164
- function getRobot (dfg:: CloudGraphsDFG , userId:: Symbol , robotId:: Symbol )
163
+ function getRobot (dfg:: Neo4jDFG , userId:: Symbol , robotId:: Symbol )
165
164
! isValidLabel (userId) && error (" Can't retrieve robot with user ID '$(userId) '." )
166
165
! isValidLabel (robotId) && error (" Can't retrieve robot with robot ID '$(robotId) '." )
167
166
robotNode = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:ROBOT:`$(robotId) `:`$(userId) `)" )
@@ -178,7 +177,7 @@ Returns nothing if it isn't found.
178
177
Notes
179
178
- Returns either `::Union{Nothing, Robot}`
180
179
"""
181
- function getRobot (dfg:: CloudGraphsDFG )
180
+ function getRobot (dfg:: Neo4jDFG )
182
181
return getRobot (dfg, Symbol (dfg. userId), Symbol (dfg. robotId))
183
182
end
184
183
@@ -190,7 +189,7 @@ Returns nothing if it isn't found.
190
189
Notes
191
190
- Returns either `::Union{User, Nothing}`
192
191
"""
193
- function getUser (dfg:: CloudGraphsDFG , userId:: Symbol )
192
+ function getUser (dfg:: Neo4jDFG , userId:: Symbol )
194
193
! isValidLabel (userId) && error (" Can't retrieve user with user ID '$(userId) '." )
195
194
userNode = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:USER:`$(userId) `)" )
196
195
length (userNode) == 0 && return nothing
@@ -206,7 +205,7 @@ Returns nothing if it isn't found.
206
205
Notes
207
206
- Returns either `::Union{Nothing, User}`
208
207
"""
209
- function getUser (dfg:: CloudGraphsDFG )
208
+ function getUser (dfg:: Neo4jDFG )
210
209
return getUser (dfg, Symbol (dfg. userId))
211
210
end
212
211
@@ -218,7 +217,7 @@ DANGER: Clears the whole session from the database.
218
217
Notes
219
218
- Returns `::Nothing`
220
219
"""
221
- function clearSession!! (dfg:: CloudGraphsDFG )
220
+ function clearSession!! (dfg:: Neo4jDFG )
222
221
# Perform detach+deletion
223
222
_queryNeo4j (dfg. neo4jInstance, " match (node:`$(dfg. userId) `:`$(dfg. robotId) `:`$(dfg. sessionId) `) detach delete node " )
224
223
@@ -234,7 +233,7 @@ DANGER: Clears the whole robot + sessions from the database.
234
233
Notes
235
234
- Returns `::Nothing`
236
235
"""
237
- function clearRobot!! (dfg:: CloudGraphsDFG )
236
+ function clearRobot!! (dfg:: Neo4jDFG )
238
237
# Perform detach+deletion
239
238
_queryNeo4j (dfg. neo4jInstance, " match (node:`$(dfg. userId) `:`$(dfg. robotId) `) detach delete node " )
240
239
@@ -250,7 +249,7 @@ DANGER: Clears the whole user + robot + sessions from the database.
250
249
Notes
251
250
- Returns `::Nothing`
252
251
"""
253
- function clearUser!! (dfg:: CloudGraphsDFG )
252
+ function clearUser!! (dfg:: Neo4jDFG )
254
253
# Perform detach+deletion
255
254
_queryNeo4j (dfg. neo4jInstance, " match (node:`$(dfg. userId) `) detach delete node " )
256
255
@@ -265,9 +264,9 @@ DANGER: Copies and overwrites the destination session.
265
264
If no destination specified then it creates a unique one.
266
265
267
266
Notes
268
- - Returns `::CloudGraphsDFG `
267
+ - Returns `::Neo4jDFG `
269
268
"""
270
- function copySession! (sourceDFG:: CloudGraphsDFG , destDFG:: Union{Nothing, <:Neo4jDFG} )
269
+ function copySession! (sourceDFG:: Neo4jDFG , destDFG:: Union{Nothing, <:Neo4jDFG} )
271
270
if destDFG === nothing
272
271
destDFG = _getDuplicatedEmptyDFG (sourceDFG)
273
272
end
279
278
DANGER: Copies the source to a new unique destination.
280
279
281
280
Notes
282
- - Returns `::CloudGraphsDFG `
281
+ - Returns `::Neo4jDFG `
283
282
"""
284
- copySession! (sourceDFG:: CloudGraphsDFG ) = copySession! (sourceDFG, nothing )
283
+ copySession! (sourceDFG:: Neo4jDFG ) = copySession! (sourceDFG, nothing )
0 commit comments