@@ -54,7 +54,7 @@ function _convertDictToUser(dict::Dict{String, Any})::User
54
54
return user
55
55
end
56
56
57
- function createUser (dfg:: CloudGraphsDFG , user:: User ):: User
57
+ function createUser (dfg:: Neo4jDFG , user:: User ):: User
58
58
Symbol (dfg. userId) != user. id && error (" DFG user ID must match user's ID" )
59
59
! isValidLabel (user) && error (" Node cannot have an ID '$(user. id) '." )
60
60
@@ -64,7 +64,7 @@ function createUser(dfg::CloudGraphsDFG, user::User)::User
64
64
return user
65
65
end
66
66
67
- function createRobot (dfg:: CloudGraphsDFG , robot:: Robot ):: Robot
67
+ function createRobot (dfg:: Neo4jDFG , robot:: Robot ):: Robot
68
68
Symbol (dfg. robotId) != robot. id && error (" DFG robot ID must match robot's ID" )
69
69
Symbol (dfg. userId) != robot. userId && error (" DFG user ID must match robot's user ID" )
70
70
! isValidLabel (robot) && error (" Node cannot have an ID '$(robot. id) '." )
@@ -84,7 +84,7 @@ function createRobot(dfg::CloudGraphsDFG, robot::Robot)::Robot
84
84
return robot
85
85
end
86
86
87
- function createSession (dfg:: CloudGraphsDFG , session:: Session ):: Session
87
+ function createSession (dfg:: Neo4jDFG , session:: Session ):: Session
88
88
Symbol (dfg. robotId) != session. robotId && error (" DFG robot ID must match session's robot ID" )
89
89
Symbol (dfg. userId) != session. userId && error (" DFG user ID must match session's->robot's->user ID" )
90
90
! isValidLabel (session) && error (" Node cannot have an ID '$(session. id) '." )
108
108
$(SIGNATURES)
109
109
Shortcut method to create the user, robot, and session if it doesn't already exist.
110
110
"""
111
- function createDfgSessionIfNotExist (dfg:: CloudGraphsDFG ):: Session
111
+ function createDfgSessionIfNotExist (dfg:: Neo4jDFG ):: Session
112
112
strip (dfg. userId) == " " && error (" User ID is not populated in DFG." )
113
113
strip (dfg. robotId) == " " && error (" Robot ID is not populated in DFG." )
114
114
strip (dfg. sessionId) == " " && error (" Session ID is not populated in DFG." )
@@ -130,7 +130,7 @@ $(SIGNATURES)
130
130
List all sessions for the specified DFG's robot and user.
131
131
Returns nothing if it isn't found.
132
132
"""
133
- function lsSessions (dfg:: CloudGraphsDFG ):: Vector{Session}
133
+ function lsSessions (dfg:: Neo4jDFG ):: Vector{Session}
134
134
sessionNodes = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:SESSION:$(dfg. robotId) :$(dfg. userId) )" )
135
135
return map (s -> _convertDictToSession (Neo4j. getnodeproperties (s)), sessionNodes)
136
136
end
@@ -140,7 +140,7 @@ $(SIGNATURES)
140
140
List all robots for the specified DFG's user.
141
141
Returns nothing if it isn't found.
142
142
"""
143
- function lsRobots (dfg:: CloudGraphsDFG ):: Vector{Robot}
143
+ function lsRobots (dfg:: Neo4jDFG ):: Vector{Robot}
144
144
robotNodes = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:ROBOT:$(dfg. userId) )" )
145
145
return map (s -> _convertDictToRobot (Neo4j. getnodeproperties (s)), robotNodes)
146
146
end
@@ -150,7 +150,7 @@ $(SIGNATURES)
150
150
List all users.
151
151
Returns nothing if it isn't found.
152
152
"""
153
- function lsUsers (dfg:: CloudGraphsDFG ):: Vector{User}
153
+ function lsUsers (dfg:: Neo4jDFG ):: Vector{User}
154
154
userNodes = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:USER)" )
155
155
return map (s -> _convertDictToUser (Neo4j. getnodeproperties (s)), userNodes)
156
156
end
@@ -160,7 +160,7 @@ $(SIGNATURES)
160
160
Get a session specified by userId:robotId:sessionId.
161
161
Returns nothing if it isn't found.
162
162
"""
163
- function getSession (dfg:: CloudGraphsDFG , userId:: Symbol , robotId:: Symbol , sessionId:: Symbol ):: Union{Session, Nothing}
163
+ function getSession (dfg:: Neo4jDFG , userId:: Symbol , robotId:: Symbol , sessionId:: Symbol ):: Union{Session, Nothing}
164
164
! isValidLabel (userId) && error (" Can't retrieve session with user ID '$(userId) '." )
165
165
! isValidLabel (robotId) && error (" Can't retrieve session with robot ID '$(robotId) '." )
166
166
! isValidLabel (sessionId) && error (" Can't retrieve session with session ID '$(sessionId) '." )
@@ -175,7 +175,7 @@ $(SIGNATURES)
175
175
Get the session specified by the DFG object.
176
176
Returns nothing if it isn't found.
177
177
"""
178
- function getSession (dfg:: CloudGraphsDFG ):: Union{Nothing, Session}
178
+ function getSession (dfg:: Neo4jDFG ):: Union{Nothing, Session}
179
179
return getSession (dfg, Symbol (dfg. userId), Symbol (dfg. robotId), Symbol (dfg. sessionId))
180
180
end
181
181
@@ -184,7 +184,7 @@ $(SIGNATURES)
184
184
Get a robot specified by userId:robotId.
185
185
Returns nothing if it isn't found.
186
186
"""
187
- function getRobot (dfg:: CloudGraphsDFG , userId:: Symbol , robotId:: Symbol ):: Union{Robot, Nothing}
187
+ function getRobot (dfg:: Neo4jDFG , userId:: Symbol , robotId:: Symbol ):: Union{Robot, Nothing}
188
188
! isValidLabel (userId) && error (" Can't retrieve robot with user ID '$(userId) '." )
189
189
! isValidLabel (robotId) && error (" Can't retrieve robot with robot ID '$(robotId) '." )
190
190
robotNode = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:ROBOT:$(robotId) :$(userId) )" )
@@ -198,7 +198,7 @@ $(SIGNATURES)
198
198
Get the robot specified by the DFG object.
199
199
Returns nothing if it isn't found.
200
200
"""
201
- function getRobot (dfg:: CloudGraphsDFG ):: Union{Nothing, Robot}
201
+ function getRobot (dfg:: Neo4jDFG ):: Union{Nothing, Robot}
202
202
return getRobot (dfg, Symbol (dfg. userId), Symbol (dfg. robotId))
203
203
end
204
204
@@ -207,7 +207,7 @@ $(SIGNATURES)
207
207
Get a user specified by userId.
208
208
Returns nothing if it isn't found.
209
209
"""
210
- function getUser (dfg:: CloudGraphsDFG , userId:: Symbol ):: Union{User, Nothing}
210
+ function getUser (dfg:: Neo4jDFG , userId:: Symbol ):: Union{User, Nothing}
211
211
! isValidLabel (userId) && error (" Can't retrieve user with user ID '$(userId) '." )
212
212
userNode = _getNeoNodesFromCyphonQuery (dfg. neo4jInstance, " (node:USER:$(userId) )" )
213
213
length (userNode) == 0 && return nothing
@@ -220,7 +220,7 @@ $(SIGNATURES)
220
220
Get the user specified by the DFG object.
221
221
Returns nothing if it isn't found.
222
222
"""
223
- function getUser (dfg:: CloudGraphsDFG ):: Union{Nothing, User}
223
+ function getUser (dfg:: Neo4jDFG ):: Union{Nothing, User}
224
224
return getUser (dfg, Symbol (dfg. userId))
225
225
end
226
226
229
229
$(SIGNATURES)
230
230
DANGER: Clears the whole session from the database.
231
231
"""
232
- function clearSession!! (dfg:: CloudGraphsDFG ):: Nothing
232
+ function clearSession!! (dfg:: Neo4jDFG ):: Nothing
233
233
# Perform detach+deletion
234
234
_queryNeo4j (dfg. neo4jInstance, " match (node:$(dfg. userId) :$(dfg. robotId) :$(dfg. sessionId) ) detach delete node " )
235
235
242
242
$(SIGNATURES)
243
243
DANGER: Clears the whole robot + sessions from the database.
244
244
"""
245
- function clearRobot!! (dfg:: CloudGraphsDFG ):: Nothing
245
+ function clearRobot!! (dfg:: Neo4jDFG ):: Nothing
246
246
# Perform detach+deletion
247
247
_queryNeo4j (dfg. neo4jInstance, " match (node:$(dfg. userId) :$(dfg. robotId) ) detach delete node " )
248
248
255
255
$(SIGNATURES)
256
256
DANGER: Clears the whole user + robot + sessions from the database.
257
257
"""
258
- function clearUser!! (dfg:: CloudGraphsDFG ):: Nothing
258
+ function clearUser!! (dfg:: Neo4jDFG ):: Nothing
259
259
# Perform detach+deletion
260
260
_queryNeo4j (dfg. neo4jInstance, " match (node:$(dfg. userId) ) detach delete node " )
261
261
269
269
DANGER: Copies and overwrites the destination session.
270
270
If no destination specified then it creates a unique one.
271
271
"""
272
- function copySession! (sourceDFG:: CloudGraphsDFG , destDFG:: Union{Nothing, CloudGraphsDFG } ):: CloudGraphsDFG
272
+ function copySession! (sourceDFG:: Neo4jDFG , destDFG:: Union{Nothing, Neo4jDFG } ):: Neo4jDFG
273
273
if destDFG == nothing
274
274
destDFG = _getDuplicatedEmptyDFG (sourceDFG)
275
275
end
280
280
$(SIGNATURES)
281
281
DANGER: Copies the source to a new unique destination.
282
282
"""
283
- copySession! (sourceDFG:: CloudGraphsDFG ):: CloudGraphsDFG = copySession! (sourceDFG, nothing )
283
+ copySession! (sourceDFG:: Neo4jDFG ):: Neo4jDFG = copySession! (sourceDFG, nothing )
0 commit comments