10
10
import static org .carlspring .strongbox .db .schema .Vertices .ARTIFACT_ID_GROUP ;
11
11
import static org .carlspring .strongbox .db .schema .Vertices .ARTIFACT_TAG ;
12
12
import static org .carlspring .strongbox .db .schema .Vertices .GENERIC_ARTIFACT_COORDINATES ;
13
- import static org .carlspring .strongbox .db .schema .Vertices .RAW_ARTIFACT_COORDINATES ;
14
13
import static org .carlspring .strongbox .db .schema .Vertices .MAVEN_ARTIFACT_COORDINATES ;
15
14
import static org .carlspring .strongbox .db .schema .Vertices .NPM_ARTIFACT_COORDINATES ;
16
15
import static org .carlspring .strongbox .db .schema .Vertices .NUGET_ARTIFACT_COORDINATES ;
17
16
import static org .carlspring .strongbox .db .schema .Vertices .PYPI_ARTIFACT_COORDINATES ;
17
+ import static org .carlspring .strongbox .db .schema .Vertices .RAW_ARTIFACT_COORDINATES ;
18
18
import static org .carlspring .strongbox .db .schema .Vertices .REMOTE_ARTIFACT ;
19
+ import static org .carlspring .strongbox .db .schema .Vertices .TRANSACTION_PROPAGATION ;
19
20
import static org .carlspring .strongbox .db .schema .Vertices .USER ;
20
21
import static org .janusgraph .core .Multiplicity .MANY2ONE ;
21
22
import static org .janusgraph .core .Multiplicity .MULTI ;
@@ -217,6 +218,7 @@ private void applySchemaChanges(JanusGraphManagement jgm)
217
218
createProperties (jgm );
218
219
219
220
// Vertices
221
+ makeVertexLabelIfDoesNotExist (jgm , TRANSACTION_PROPAGATION );
220
222
makeVertexLabelIfDoesNotExist (jgm , ARTIFACT );
221
223
makeVertexLabelIfDoesNotExist (jgm , REMOTE_ARTIFACT );
222
224
makeVertexLabelIfDoesNotExist (jgm , GENERIC_ARTIFACT_COORDINATES );
@@ -254,17 +256,34 @@ private void applyConnectionConstraints(JanusGraphManagement jgm)
254
256
jgm .getVertexLabel (ARTIFACT ),
255
257
jgm .getVertexLabel (ARTIFACT_TAG ));
256
258
259
+ jgm .addConnection (jgm .getEdgeLabel (ARTIFACT_GROUP_HAS_ARTIFACTS ),
260
+ jgm .getVertexLabel (ARTIFACT_ID_GROUP ),
261
+ jgm .getVertexLabel (ARTIFACT ));
262
+
257
263
jgm .addConnection (jgm .getEdgeLabel (REMOTE_ARTIFACT_INHERIT_ARTIFACT ),
258
264
jgm .getVertexLabel (REMOTE_ARTIFACT ),
259
265
jgm .getVertexLabel (ARTIFACT ));
260
266
261
267
jgm .addConnection (jgm .getEdgeLabel (ARTIFACT_COORDINATES_INHERIT_GENERIC_ARTIFACT_COORDINATES ),
262
- jgm .getVertexLabel (GENERIC_ARTIFACT_COORDINATES ),
268
+ jgm .getVertexLabel (RAW_ARTIFACT_COORDINATES ),
269
+ jgm .getVertexLabel (GENERIC_ARTIFACT_COORDINATES ));
270
+
271
+ jgm .addConnection (jgm .getEdgeLabel (ARTIFACT_COORDINATES_INHERIT_GENERIC_ARTIFACT_COORDINATES ),
272
+ jgm .getVertexLabel (NUGET_ARTIFACT_COORDINATES ),
273
+ jgm .getVertexLabel (GENERIC_ARTIFACT_COORDINATES ));
274
+
275
+ jgm .addConnection (jgm .getEdgeLabel (ARTIFACT_COORDINATES_INHERIT_GENERIC_ARTIFACT_COORDINATES ),
276
+ jgm .getVertexLabel (NPM_ARTIFACT_COORDINATES ),
277
+ jgm .getVertexLabel (GENERIC_ARTIFACT_COORDINATES ));
278
+
279
+ jgm .addConnection (jgm .getEdgeLabel (ARTIFACT_COORDINATES_INHERIT_GENERIC_ARTIFACT_COORDINATES ),
280
+ jgm .getVertexLabel (MAVEN_ARTIFACT_COORDINATES ),
281
+ jgm .getVertexLabel (GENERIC_ARTIFACT_COORDINATES ));
282
+
283
+ jgm .addConnection (jgm .getEdgeLabel (ARTIFACT_COORDINATES_INHERIT_GENERIC_ARTIFACT_COORDINATES ),
284
+ jgm .getVertexLabel (PYPI_ARTIFACT_COORDINATES ),
263
285
jgm .getVertexLabel (GENERIC_ARTIFACT_COORDINATES ));
264
286
265
- jgm .addConnection (jgm .getEdgeLabel (ARTIFACT_GROUP_HAS_ARTIFACTS ),
266
- jgm .getVertexLabel (ARTIFACT_ID_GROUP ),
267
- jgm .getVertexLabel (ARTIFACT ));
268
287
}
269
288
270
289
private void applyPropertyConstraints (JanusGraphManagement jgm )
@@ -286,22 +305,37 @@ private void applyPropertyConstraints(JanusGraphManagement jgm)
286
305
addVertexPropertyConstraints (jgm ,
287
306
REMOTE_ARTIFACT ,
288
307
"uuid" ,
289
- "cached" );
308
+ "cached" ,
309
+ "created" );
290
310
291
311
addVertexPropertyConstraints (jgm ,
292
312
GENERIC_ARTIFACT_COORDINATES ,
293
313
"uuid" ,
294
314
"version" ,
315
+ "coordinates.id" ,
295
316
"coordinates.extension" ,
296
- "coordinates.name" );
317
+ "coordinates.name" ,
318
+ "coordinates.path" ,
319
+ "coordinates.scope" ,
320
+ "coordinates.groupId" ,
321
+ "coordinates.artifactId" ,
322
+ "coordinates.classifier" ,
323
+ "coordinates.distribution" ,
324
+ "coordinates.build" ,
325
+ "coordinates.abi" ,
326
+ "coordinates.platform" ,
327
+ "coordinates.packaging" ,
328
+ "coordinates.languageImplementationVersion" ,
329
+ "created" );
297
330
298
331
addVertexPropertyConstraints (jgm ,
299
332
RAW_ARTIFACT_COORDINATES ,
300
333
"uuid" ,
301
334
"version" ,
302
335
"coordinates.extension" ,
303
336
"coordinates.name" ,
304
- "coordinates.path" );
337
+ "coordinates.path" ,
338
+ "created" );
305
339
306
340
addVertexPropertyConstraints (jgm ,
307
341
MAVEN_ARTIFACT_COORDINATES ,
@@ -311,23 +345,26 @@ private void applyPropertyConstraints(JanusGraphManagement jgm)
311
345
"coordinates.name" ,
312
346
"coordinates.groupId" ,
313
347
"coordinates.artifactId" ,
314
- "coordinates.classifier" );
348
+ "coordinates.classifier" ,
349
+ "created" );
315
350
316
351
addVertexPropertyConstraints (jgm ,
317
352
NPM_ARTIFACT_COORDINATES ,
318
353
"uuid" ,
319
354
"version" ,
320
355
"coordinates.extension" ,
321
356
"coordinates.name" ,
322
- "coordinates.scope" );
357
+ "coordinates.scope" ,
358
+ "created" );
323
359
324
360
addVertexPropertyConstraints (jgm ,
325
361
NUGET_ARTIFACT_COORDINATES ,
326
362
"uuid" ,
327
363
"version" ,
328
364
"coordinates.extension" ,
329
365
"coordinates.name" ,
330
- "coordinates.id" );
366
+ "coordinates.id" ,
367
+ "created" );
331
368
332
369
addVertexPropertyConstraints (jgm ,
333
370
PYPI_ARTIFACT_COORDINATES ,
@@ -338,30 +375,34 @@ private void applyPropertyConstraints(JanusGraphManagement jgm)
338
375
"coordinates.build" ,
339
376
"coordinates.abi" ,
340
377
"coordinates.platform" ,
341
- "coordinates.languageImplementationVersion" ,
342
378
"coordinates.packaging" ,
343
- "coordinates.distribution" );
379
+ "coordinates.distribution" ,
380
+ "coordinates.languageImplementationVersion" ,
381
+ "created" );
344
382
345
383
addVertexPropertyConstraints (jgm ,
346
384
ARTIFACT_TAG ,
347
- "uuid" );
385
+ "uuid" ,
386
+ "created" );
348
387
349
388
addVertexPropertyConstraints (jgm ,
350
389
ARTIFACT_ID_GROUP ,
351
390
"uuid" ,
352
391
"storageId" ,
353
392
"repositoryId" ,
354
- "name" );
393
+ "name" ,
394
+ "created" );
355
395
356
396
addVertexPropertyConstraints (jgm ,
357
397
USER ,
358
398
"uuid" ,
359
- "username" ,
360
399
"password" ,
361
400
"enabled" ,
362
401
"roles" ,
363
402
"securityTokenKey" ,
364
- "sourceId" );
403
+ "sourceId" ,
404
+ "created" ,
405
+ "lastUpdated" );
365
406
}
366
407
367
408
private void addVertexPropertyConstraints (JanusGraphManagement jgm ,
0 commit comments