-
-
Notifications
You must be signed in to change notification settings - Fork 598
/
Copy pathQueryManager.java
1283 lines (1040 loc) · 55.2 KB
/
QueryManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* This file is part of Dependency-Track.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
* Copyright (c) Steve Springett. All Rights Reserved.
*/
package org.dependencytrack.persistence;
import alpine.common.util.BooleanUtil;
import alpine.event.framework.Event;
import alpine.model.ApiKey;
import alpine.model.ConfigProperty;
import alpine.model.Team;
import alpine.model.UserPrincipal;
import alpine.notification.NotificationLevel;
import alpine.persistence.AlpineQueryManager;
import alpine.persistence.PaginatedResult;
import alpine.resources.AlpineRequest;
import com.github.packageurl.PackageURL;
import org.datanucleus.api.jdo.JDOQuery;
import org.dependencytrack.event.IndexEvent;
import org.dependencytrack.model.AffectedVersionAttribution;
import org.dependencytrack.model.Analysis;
import org.dependencytrack.model.AnalysisComment;
import org.dependencytrack.model.AnalysisJustification;
import org.dependencytrack.model.AnalysisResponse;
import org.dependencytrack.model.AnalysisState;
import org.dependencytrack.model.Bom;
import org.dependencytrack.model.Classifier;
import org.dependencytrack.model.Component;
import org.dependencytrack.model.ComponentAnalysisCache;
import org.dependencytrack.model.ComponentIdentity;
import org.dependencytrack.model.ConfigPropertyConstants;
import org.dependencytrack.model.Cpe;
import org.dependencytrack.model.Cwe;
import org.dependencytrack.model.DependencyMetrics;
import org.dependencytrack.model.Finding;
import org.dependencytrack.model.FindingAttribution;
import org.dependencytrack.model.License;
import org.dependencytrack.model.LicenseGroup;
import org.dependencytrack.model.NotificationPublisher;
import org.dependencytrack.model.NotificationRule;
import org.dependencytrack.model.Policy;
import org.dependencytrack.model.PolicyCondition;
import org.dependencytrack.model.PolicyViolation;
import org.dependencytrack.model.PortfolioMetrics;
import org.dependencytrack.model.Project;
import org.dependencytrack.model.ProjectMetrics;
import org.dependencytrack.model.ProjectProperty;
import org.dependencytrack.model.Repository;
import org.dependencytrack.model.RepositoryMetaComponent;
import org.dependencytrack.model.RepositoryType;
import org.dependencytrack.model.ServiceComponent;
import org.dependencytrack.model.Tag;
import org.dependencytrack.model.Vex;
import org.dependencytrack.model.ViolationAnalysis;
import org.dependencytrack.model.ViolationAnalysisComment;
import org.dependencytrack.model.ViolationAnalysisState;
import org.dependencytrack.model.Vulnerability;
import org.dependencytrack.model.VulnerabilityAlias;
import org.dependencytrack.model.VulnerabilityMetrics;
import org.dependencytrack.model.VulnerableSoftware;
import org.dependencytrack.notification.NotificationScope;
import org.dependencytrack.notification.publisher.Publisher;
import org.dependencytrack.tasks.scanners.AnalyzerIdentity;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.jdo.Transaction;
import javax.json.JsonObject;
import java.security.Principal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* This QueryManager provides a concrete extension of {@link AlpineQueryManager} by
* providing methods that operate on the Dependency-Track specific models.
*
* @author Steve Springett
* @since 3.0.0
*/
@SuppressWarnings({"UnusedReturnValue", "unused"})
public class QueryManager extends AlpineQueryManager {
private AlpineRequest request;
private BomQueryManager bomQueryManager;
private CacheQueryManager cacheQueryManager;
private ComponentQueryManager componentQueryManager;
private FindingsQueryManager findingsQueryManager;
private LicenseQueryManager licenseQueryManager;
private MetricsQueryManager metricsQueryManager;
private NotificationQueryManager notificationQueryManager;
private PolicyQueryManager policyQueryManager;
private ProjectQueryManager projectQueryManager;
private RepositoryQueryManager repositoryQueryManager;
private ServiceComponentQueryManager serviceComponentQueryManager;
private VexQueryManager vexQueryManager;
private VulnerabilityQueryManager vulnerabilityQueryManager;
private VulnerableSoftwareQueryManager vulnerableSoftwareQueryManager;
private TagQueryManager tagQueryManager;
/**
* Default constructor.
*/
public QueryManager() {
super();
}
/**
* Constructs a new QueryManager.
* @param pm a PersistenceManager object
*/
public QueryManager(final PersistenceManager pm) {
super(pm);
}
/**
* Constructs a new QueryManager.
* @param request an AlpineRequest object
*/
public QueryManager(final AlpineRequest request) {
super(request);
this.request = request;
}
/**
* Constructs a new QueryManager.
* @param request an AlpineRequest object
*/
public QueryManager(final PersistenceManager pm, final AlpineRequest request) {
super(pm, request);
this.request = request;
}
/**
* Lazy instantiation of ProjectQueryManager.
* @return a ProjectQueryManager object
*/
private ProjectQueryManager getProjectQueryManager() {
if (projectQueryManager == null) {
projectQueryManager = (request == null) ? new ProjectQueryManager(getPersistenceManager()) : new ProjectQueryManager(getPersistenceManager(), request);
}
return projectQueryManager;
}
/**
* Lazy instantiation of TagQueryManager.
* @return a TagQueryManager object
*/
private TagQueryManager getTagQueryManager() {
if (tagQueryManager == null) {
tagQueryManager = (request == null) ? new TagQueryManager(getPersistenceManager()) : new TagQueryManager(getPersistenceManager(), request);
}
return tagQueryManager;
}
/**
* Lazy instantiation of ComponentQueryManager.
* @return a ComponentQueryManager object
*/
private ComponentQueryManager getComponentQueryManager() {
if (componentQueryManager == null) {
componentQueryManager = (request == null) ? new ComponentQueryManager(getPersistenceManager()) : new ComponentQueryManager(getPersistenceManager(), request);
}
return componentQueryManager;
}
/**
* Lazy instantiation of LicenseQueryManager.
* @return a LicenseQueryManager object
*/
private LicenseQueryManager getLicenseQueryManager() {
if (licenseQueryManager == null) {
licenseQueryManager = (request == null) ? new LicenseQueryManager(getPersistenceManager()) : new LicenseQueryManager(getPersistenceManager(), request);
}
return licenseQueryManager;
}
/**
* Lazy instantiation of BomQueryManager.
* @return a BomQueryManager object
*/
private BomQueryManager getBomQueryManager() {
if (bomQueryManager == null) {
bomQueryManager = (request == null) ? new BomQueryManager(getPersistenceManager()) : new BomQueryManager(getPersistenceManager(), request);
}
return bomQueryManager;
}
/**
* Lazy instantiation of VexQueryManager.
* @return a VexQueryManager object
*/
private VexQueryManager getVexQueryManager() {
if (vexQueryManager == null) {
vexQueryManager = (request == null) ? new VexQueryManager(getPersistenceManager()) : new VexQueryManager(getPersistenceManager(), request);
}
return vexQueryManager;
}
/**
* Lazy instantiation of PolicyQueryManager.
* @return a PolicyQueryManager object
*/
private PolicyQueryManager getPolicyQueryManager() {
if (policyQueryManager == null) {
policyQueryManager = (request == null) ? new PolicyQueryManager(getPersistenceManager()) : new PolicyQueryManager(getPersistenceManager(), request);
}
return policyQueryManager;
}
/**
* Lazy instantiation of VulnerabilityQueryManager.
* @return a VulnerabilityQueryManager object
*/
private VulnerabilityQueryManager getVulnerabilityQueryManager() {
if (vulnerabilityQueryManager == null) {
vulnerabilityQueryManager = (request == null) ? new VulnerabilityQueryManager(getPersistenceManager()) : new VulnerabilityQueryManager(getPersistenceManager(), request);
}
return vulnerabilityQueryManager;
}
/**
* Lazy instantiation of VulnerableSoftwareQueryManager.
* @return a VulnerableSoftwareQueryManager object
*/
private VulnerableSoftwareQueryManager getVulnerableSoftwareQueryManager() {
if (vulnerableSoftwareQueryManager == null) {
vulnerableSoftwareQueryManager = (request == null) ? new VulnerableSoftwareQueryManager(getPersistenceManager()) : new VulnerableSoftwareQueryManager(getPersistenceManager(), request);
}
return vulnerableSoftwareQueryManager;
}
/**
* Lazy instantiation of ServiceComponentQueryManager.
* @return a ServiceComponentQueryManager object
*/
private ServiceComponentQueryManager getServiceComponentQueryManager() {
if (serviceComponentQueryManager == null) {
serviceComponentQueryManager = (request == null) ? new ServiceComponentQueryManager(getPersistenceManager()) : new ServiceComponentQueryManager(getPersistenceManager(), request);
}
return serviceComponentQueryManager;
}
/**
* Lazy instantiation of FindingsQueryManager.
* @return a FindingsQueryManager object
*/
private FindingsQueryManager getFindingsQueryManager() {
if (findingsQueryManager == null) {
findingsQueryManager = (request == null) ? new FindingsQueryManager(getPersistenceManager()) : new FindingsQueryManager(getPersistenceManager(), request);
}
return findingsQueryManager;
}
/**
* Lazy instantiation of MetricsQueryManager.
* @return a MetricsQueryManager object
*/
private MetricsQueryManager getMetricsQueryManager() {
if (metricsQueryManager == null) {
metricsQueryManager = (request == null) ? new MetricsQueryManager(getPersistenceManager()) : new MetricsQueryManager(getPersistenceManager(), request);
}
return metricsQueryManager;
}
/**
* Lazy instantiation of RepositoryQueryManager.
* @return a RepositoryQueryManager object
*/
private RepositoryQueryManager getRepositoryQueryManager() {
if (repositoryQueryManager == null) {
repositoryQueryManager = (request == null) ? new RepositoryQueryManager(getPersistenceManager()) : new RepositoryQueryManager(getPersistenceManager(), request);
}
return repositoryQueryManager;
}
/**
* Lazy instantiation of NotificationQueryManager.
* @return a NotificationQueryManager object
*/
private NotificationQueryManager getNotificationQueryManager() {
if (notificationQueryManager == null) {
notificationQueryManager = (request == null) ? new NotificationQueryManager(getPersistenceManager()) : new NotificationQueryManager(getPersistenceManager(), request);
}
return notificationQueryManager;
}
/**
* Lazy instantiation of CacheQueryManager.
* @return a CacheQueryManager object
*/
private CacheQueryManager getCacheQueryManager() {
if (cacheQueryManager == null) {
cacheQueryManager = (request == null) ? new CacheQueryManager(getPersistenceManager()) : new CacheQueryManager(getPersistenceManager(), request);
}
return cacheQueryManager;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// BEGIN WRAPPER METHODS ////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public PaginatedResult getProjects(final boolean includeMetrics, final boolean excludeInactive, final boolean onlyRoot) {
return getProjectQueryManager().getProjects(includeMetrics, excludeInactive, onlyRoot);
}
public PaginatedResult getProjects(final boolean includeMetrics) {
return getProjectQueryManager().getProjects(includeMetrics);
}
public PaginatedResult getProjects() {
return getProjectQueryManager().getProjects();
}
public List<Project> getAllProjects() {
return getProjectQueryManager().getAllProjects();
}
public List<Project> getAllProjects(boolean excludeInactive) {
return getProjectQueryManager().getAllProjects(excludeInactive);
}
public PaginatedResult getProjects(final String name, final boolean excludeInactive, final boolean onlyRoot) {
return getProjectQueryManager().getProjects(name, excludeInactive, onlyRoot);
}
public Project getProject(final String name, final String version) {
return getProjectQueryManager().getProject(name, version);
}
public PaginatedResult getProjects(final Team team, final boolean excludeInactive, final boolean bypass, final boolean onlyRoot) {
return getProjectQueryManager().getProjects(team, excludeInactive, bypass, onlyRoot);
}
public PaginatedResult getProjectsWithoutDescendantsOf(final boolean excludeInactive, final Project project){
return getProjectQueryManager().getProjectsWithoutDescendantsOf(excludeInactive, project);
}
public PaginatedResult getProjectsWithoutDescendantsOf(final String name, final boolean excludeInactive, final Project project){
return getProjectQueryManager().getProjectsWithoutDescendantsOf(name, excludeInactive, project);
}
public boolean hasAccess(final Principal principal, final Project project) {
return getProjectQueryManager().hasAccess(principal, project);
}
public PaginatedResult getProjects(final Tag tag, final boolean includeMetrics, final boolean excludeInactive, final boolean onlyRoot) {
return getProjectQueryManager().getProjects(tag, includeMetrics, excludeInactive, onlyRoot);
}
public PaginatedResult getProjects(final Classifier classifier, final boolean includeMetrics, final boolean excludeInactive, final boolean onlyRoot) {
return getProjectQueryManager().getProjects(classifier, includeMetrics, excludeInactive, onlyRoot);
}
public PaginatedResult getChildrenProjects(final UUID uuid, final boolean includeMetrics, final boolean excludeInactive){
return getProjectQueryManager().getChildrenProjects(uuid, includeMetrics, excludeInactive);
}
public PaginatedResult getChildrenProjects(final Tag tag, final UUID uuid, final boolean includeMetrics, final boolean excludeInactive){
return getProjectQueryManager().getChildrenProjects(tag, uuid, includeMetrics, excludeInactive);
}
public PaginatedResult getChildrenProjects(final Classifier classifier, final UUID uuid, final boolean includeMetrics, final boolean excludeInactive){
return getProjectQueryManager().getChildrenProjects(classifier, uuid, includeMetrics, excludeInactive);
}
public PaginatedResult getProjects(final Tag tag) {
return getProjectQueryManager().getProjects(tag);
}
public Tag getTagByName(final String name) {
return getProjectQueryManager().getTagByName(name);
}
public Tag createTag(final String name) {
return getProjectQueryManager().createTag(name);
}
public Project createProject(String name, String description, String version, List<Tag> tags, Project parent, PackageURL purl, boolean active, boolean commitIndex) {
return getProjectQueryManager().createProject(name, description, version, tags, parent, purl, active, commitIndex);
}
public Project createProject(final Project project, List<Tag> tags, boolean commitIndex) {
return getProjectQueryManager().createProject(project, tags, commitIndex);
}
public Project updateProject(UUID uuid, String name, String description, String version, List<Tag> tags, PackageURL purl, boolean active, boolean commitIndex) {
return getProjectQueryManager().updateProject(uuid, name, description, version, tags, purl, active, commitIndex);
}
public Project updateProject(Project transientProject, boolean commitIndex) {
return getProjectQueryManager().updateProject(transientProject, commitIndex);
}
public boolean updateNewProjectACL(Project transientProject, Principal principal) {
return getProjectQueryManager().updateNewProjectACL(transientProject, principal);
}
public Project clone(UUID from, String newVersion, boolean includeTags, boolean includeProperties,
boolean includeComponents, boolean includeServices, boolean includeAuditHistory,
boolean includeACL) {
return getProjectQueryManager().clone(from, newVersion, includeTags, includeProperties,
includeComponents, includeServices, includeAuditHistory, includeACL);
}
public Project updateLastBomImport(Project p, Date date, String bomFormat) {
return getProjectQueryManager().updateLastBomImport(p, date, bomFormat);
}
public void recursivelyDelete(final Project project, final boolean commitIndex) {
getProjectQueryManager().recursivelyDelete(project, commitIndex);
}
public ProjectProperty createProjectProperty(final Project project, final String groupName, final String propertyName,
final String propertyValue, final ProjectProperty.PropertyType propertyType,
final String description) {
return getProjectQueryManager().createProjectProperty(project, groupName, propertyName, propertyValue, propertyType, description);
}
public ProjectProperty getProjectProperty(final Project project, final String groupName, final String propertyName) {
return getProjectQueryManager().getProjectProperty(project, groupName, propertyName);
}
public List<ProjectProperty> getProjectProperties(final Project project) {
return getProjectQueryManager().getProjectProperties(project);
}
public Bom createBom(Project project, Date imported, Bom.Format format, String specVersion, Integer bomVersion, String serialNumber) {
return getBomQueryManager().createBom(project, imported, format, specVersion, bomVersion, serialNumber);
}
public List<Bom> getAllBoms(Project project) {
return getBomQueryManager().getAllBoms(project);
}
public void deleteBoms(Project project) {
getBomQueryManager().deleteBoms(project);
}
public Vex createVex(Project project, Date imported, Vex.Format format, String specVersion, Integer vexVersion, String serialNumber) {
return getVexQueryManager().createVex(project, imported, format, specVersion, vexVersion, serialNumber);
}
public List<Vex> getAllVexs(Project project) {
return getVexQueryManager().getAllVexs(project);
}
public void deleteVexs(Project project) {
getVexQueryManager().deleteVexs(project);
}
public PaginatedResult getComponents(final boolean includeMetrics) {
return getComponentQueryManager().getComponents(includeMetrics);
}
public PaginatedResult getComponents() {
return getComponentQueryManager().getComponents(false);
}
public List<Component> getAllComponents() {
return getComponentQueryManager().getAllComponents();
}
public PaginatedResult getComponentByHash(String hash) {
return getComponentQueryManager().getComponentByHash(hash);
}
public PaginatedResult getComponents(ComponentIdentity identity) {
return getComponentQueryManager().getComponents(identity);
}
public PaginatedResult getComponents(ComponentIdentity identity, boolean includeMetrics) {
return getComponentQueryManager().getComponents(identity, includeMetrics);
}
public PaginatedResult getComponents(ComponentIdentity identity, Project project, boolean includeMetrics) {
return getComponentQueryManager().getComponents(identity, project, includeMetrics);
}
public Component createComponent(Component component, boolean commitIndex) {
return getComponentQueryManager().createComponent(component, commitIndex);
}
public Component cloneComponent(Component sourceComponent, Project destinationProject, boolean commitIndex) {
return getComponentQueryManager().cloneComponent(sourceComponent, destinationProject, commitIndex);
}
public Component updateComponent(Component transientComponent, boolean commitIndex) {
return getComponentQueryManager().updateComponent(transientComponent, commitIndex);
}
void deleteComponents(Project project) {
getComponentQueryManager().deleteComponents(project);
}
public void recursivelyDelete(Component component, boolean commitIndex) {
getComponentQueryManager().recursivelyDelete(component, commitIndex);
}
public Map<String, Component> getDependencyGraphForComponent(Project project, Component component) {
return getComponentQueryManager().getDependencyGraphForComponent(project, component);
}
public PaginatedResult getLicenses() {
return getLicenseQueryManager().getLicenses();
}
public List<License> getAllLicensesConcise() {
return getLicenseQueryManager().getAllLicensesConcise();
}
public License getLicense(String licenseId) {
return getLicenseQueryManager().getLicense(licenseId);
}
License synchronizeLicense(License license, boolean commitIndex) {
return getLicenseQueryManager().synchronizeLicense(license, commitIndex);
}
public License createCustomLicense(License license, boolean commitIndex) {
return getLicenseQueryManager().createCustomLicense(license, commitIndex);
}
public void deleteLicense(final License license, final boolean commitIndex) {
getLicenseQueryManager().deleteLicense(license, commitIndex);
}
public PaginatedResult getPolicies() {
return getPolicyQueryManager().getPolicies();
}
public List<Policy> getAllPolicies() {
return getPolicyQueryManager().getAllPolicies();
}
public Policy getPolicy(final String name) {
return getPolicyQueryManager().getPolicy(name);
}
public Policy createPolicy(String name, Policy.Operator operator, Policy.ViolationState violationState) {
return getPolicyQueryManager().createPolicy(name, operator, violationState);
}
public void removeProjectFromPolicies(final Project project) {
getPolicyQueryManager().removeProjectFromPolicies(project);
}
public PolicyCondition createPolicyCondition(final Policy policy, final PolicyCondition.Subject subject,
final PolicyCondition.Operator operator, final String value) {
return getPolicyQueryManager().createPolicyCondition(policy, subject, operator, value);
}
public PolicyCondition updatePolicyCondition(final PolicyCondition policyCondition) {
return getPolicyQueryManager().updatePolicyCondition(policyCondition);
}
public synchronized void reconcilePolicyViolations(final Component component, final List<PolicyViolation> policyViolations) {
getPolicyQueryManager().reconcilePolicyViolations(component, policyViolations);
}
public synchronized PolicyViolation addPolicyViolationIfNotExist(final PolicyViolation pv) {
return getPolicyQueryManager().addPolicyViolationIfNotExist(pv);
}
public List<PolicyViolation> getAllPolicyViolations() {
return getPolicyQueryManager().getAllPolicyViolations();
}
public List<PolicyViolation> getAllPolicyViolations(final PolicyCondition policyCondition) {
return getPolicyQueryManager().getAllPolicyViolations(policyCondition);
}
public List<PolicyViolation> getAllPolicyViolations(final Component component) {
return getPolicyQueryManager().getAllPolicyViolations(component);
}
public List<PolicyViolation> getAllPolicyViolations(final Component component, final boolean includeSuppressed) {
return getPolicyQueryManager().getAllPolicyViolations(component, includeSuppressed);
}
public List<PolicyViolation> getAllPolicyViolations(final Project project) {
return getPolicyQueryManager().getAllPolicyViolations(project);
}
public PaginatedResult getPolicyViolations(final Project project, boolean includeSuppressed) {
return getPolicyQueryManager().getPolicyViolations(project, includeSuppressed);
}
public PaginatedResult getPolicyViolations(final Component component, boolean includeSuppressed) {
return getPolicyQueryManager().getPolicyViolations(component, includeSuppressed);
}
public PaginatedResult getPolicyViolations(boolean includeSuppressed) {
return getPolicyQueryManager().getPolicyViolations(includeSuppressed);
}
public ViolationAnalysis getViolationAnalysis(Component component, PolicyViolation policyViolation) {
return getPolicyQueryManager().getViolationAnalysis(component, policyViolation);
}
public ViolationAnalysis makeViolationAnalysis(Component component, PolicyViolation policyViolation,
ViolationAnalysisState violationAnalysisState, Boolean isSuppressed) {
return getPolicyQueryManager().makeViolationAnalysis(component, policyViolation, violationAnalysisState, isSuppressed);
}
public ViolationAnalysisComment makeViolationAnalysisComment(ViolationAnalysis violationAnalysis, String comment, String commenter) {
return getPolicyQueryManager().makeViolationAnalysisComment(violationAnalysis, comment, commenter);
}
void deleteViolationAnalysisTrail(Component component) {
getPolicyQueryManager().deleteViolationAnalysisTrail(component);
}
void deleteViolationAnalysisTrail(Project project) {
getPolicyQueryManager().deleteViolationAnalysisTrail(project);
}
public PaginatedResult getLicenseGroups() {
return getPolicyQueryManager().getLicenseGroups();
}
public LicenseGroup getLicenseGroup(final String name) {
return getPolicyQueryManager().getLicenseGroup(name);
}
public LicenseGroup createLicenseGroup(String name) {
return getPolicyQueryManager().createLicenseGroup(name);
}
public boolean doesLicenseGroupContainLicense(final LicenseGroup lg, final License license) {
return getPolicyQueryManager().doesLicenseGroupContainLicense(lg, license);
}
public void deletePolicy(final Policy policy) {
getPolicyQueryManager().deletePolicy(policy);
}
void deletePolicyViolations(Component component) {
getPolicyQueryManager().deletePolicyViolations(component);
}
void deletePolicyViolations(Project project) {
getPolicyQueryManager().deletePolicyViolations(project);
}
public long getAuditedCount(final Component component, final PolicyViolation.Type type) {
return getPolicyQueryManager().getAuditedCount(component, type);
}
public void deletePolicyCondition(PolicyCondition policyCondition) {
getPolicyQueryManager().deletePolicyCondition(policyCondition);
}
public Vulnerability createVulnerability(Vulnerability vulnerability, boolean commitIndex) {
return getVulnerabilityQueryManager().createVulnerability(vulnerability, commitIndex);
}
public Vulnerability updateVulnerability(Vulnerability transientVulnerability, boolean commitIndex) {
return getVulnerabilityQueryManager().updateVulnerability(transientVulnerability, commitIndex);
}
public Vulnerability synchronizeVulnerability(Vulnerability vulnerability, boolean commitIndex) {
return getVulnerabilityQueryManager().synchronizeVulnerability(vulnerability, commitIndex);
}
public Vulnerability getVulnerabilityByVulnId(String source, String vulnId) {
return getVulnerabilityQueryManager().getVulnerabilityByVulnId(source, vulnId, false);
}
public Vulnerability getVulnerabilityByVulnId(String source, String vulnId, boolean includeVulnerableSoftware) {
return getVulnerabilityQueryManager().getVulnerabilityByVulnId(source, vulnId, includeVulnerableSoftware);
}
public Vulnerability getVulnerabilityByVulnId(Vulnerability.Source source, String vulnId) {
return getVulnerabilityQueryManager().getVulnerabilityByVulnId(source, vulnId, false);
}
public Vulnerability getVulnerabilityByVulnId(Vulnerability.Source source, String vulnId, boolean includeVulnerableSoftware) {
return getVulnerabilityQueryManager().getVulnerabilityByVulnId(source, vulnId, includeVulnerableSoftware);
}
public List<Vulnerability> getVulnerabilitiesForNpmModule(String module) {
return getVulnerabilityQueryManager().getVulnerabilitiesForNpmModule(module);
}
public void addVulnerability(Vulnerability vulnerability, Component component, AnalyzerIdentity analyzerIdentity) {
getVulnerabilityQueryManager().addVulnerability(vulnerability, component, analyzerIdentity);
}
public void addVulnerability(Vulnerability vulnerability, Component component, AnalyzerIdentity analyzerIdentity,
String alternateIdentifier, String referenceUrl) {
getVulnerabilityQueryManager().addVulnerability(vulnerability, component, analyzerIdentity, alternateIdentifier, referenceUrl);
}
public void removeVulnerability(Vulnerability vulnerability, Component component) {
getVulnerabilityQueryManager().removeVulnerability(vulnerability, component);
}
public FindingAttribution getFindingAttribution(Vulnerability vulnerability, Component component) {
return getVulnerabilityQueryManager().getFindingAttribution(vulnerability, component);
}
void deleteFindingAttributions(Component component) {
getVulnerabilityQueryManager().deleteFindingAttributions(component);
}
void deleteFindingAttributions(Project project) {
getVulnerabilityQueryManager().deleteFindingAttributions(project);
}
public List<VulnerableSoftware> reconcileVulnerableSoftware(final Vulnerability vulnerability,
final List<VulnerableSoftware> vsListOld,
final List<VulnerableSoftware> vsList,
final Vulnerability.Source source) {
return getVulnerabilityQueryManager().reconcileVulnerableSoftware(vulnerability, vsListOld, vsList, source);
}
public List<AffectedVersionAttribution> getAffectedVersionAttributions(Vulnerability vulnerability, VulnerableSoftware vulnerableSoftware) {
return getVulnerabilityQueryManager().getAffectedVersionAttributions(vulnerability, vulnerableSoftware);
}
public AffectedVersionAttribution getAffectedVersionAttribution(Vulnerability vulnerability, VulnerableSoftware vulnerableSoftware, Vulnerability.Source source) {
return getVulnerabilityQueryManager().getAffectedVersionAttribution(vulnerability, vulnerableSoftware, source);
}
public void updateAffectedVersionAttributions(final Vulnerability vulnerability,
final List<VulnerableSoftware> vsList,
final Vulnerability.Source source) {
getVulnerabilityQueryManager().updateAffectedVersionAttributions(vulnerability, vsList, source);
}
public void updateAffectedVersionAttribution(final Vulnerability vulnerability,
final VulnerableSoftware vulnerableSoftware,
final Vulnerability.Source source) {
getVulnerabilityQueryManager().updateAffectedVersionAttribution(vulnerability, vulnerableSoftware, source);
}
public void deleteAffectedVersionAttribution(final Vulnerability vulnerability,
final VulnerableSoftware vulnerableSoftware,
final Vulnerability.Source source) {
getVulnerabilityQueryManager().deleteAffectedVersionAttribution(vulnerability, vulnerableSoftware, source);
}
public void deleteAffectedVersionAttributions(final Vulnerability vulnerability) {
getVulnerabilityQueryManager().deleteAffectedVersionAttributions(vulnerability);
}
public boolean contains(Vulnerability vulnerability, Component component) {
return getVulnerabilityQueryManager().contains(vulnerability, component);
}
public Cpe synchronizeCpe(Cpe cpe, boolean commitIndex) {
return getVulnerableSoftwareQueryManager().synchronizeCpe(cpe, commitIndex);
}
public Cpe getCpeBy23(String cpe23) {
return getVulnerableSoftwareQueryManager().getCpeBy23(cpe23);
}
public PaginatedResult getCpes() {
return getVulnerableSoftwareQueryManager().getCpes();
}
public List<Cpe> getCpes(final String cpeString) {
return getVulnerableSoftwareQueryManager().getCpes(cpeString);
}
public List<Cpe> getCpes(final String part, final String vendor, final String product, final String version) {
return getVulnerableSoftwareQueryManager().getCpes(part, vendor, product, version);
}
public VulnerableSoftware getVulnerableSoftwareByCpe23(String cpe23,
String versionEndExcluding, String versionEndIncluding,
String versionStartExcluding, String versionStartIncluding) {
return getVulnerableSoftwareQueryManager().getVulnerableSoftwareByCpe23(cpe23, versionEndExcluding, versionEndIncluding, versionStartExcluding, versionStartIncluding);
}
public PaginatedResult getVulnerableSoftware() {
return getVulnerableSoftwareQueryManager().getVulnerableSoftware();
}
public List<VulnerableSoftware> getAllVulnerableSoftwareByCpe(final String cpeString) {
return getVulnerableSoftwareQueryManager().getAllVulnerableSoftwareByCpe(cpeString);
}
public VulnerableSoftware getVulnerableSoftwareByPurl(String purlType, String purlNamespace, String purlName,
String versionEndExcluding, String versionEndIncluding,
String versionStartExcluding, String versionStartIncluding) {
return getVulnerableSoftwareQueryManager().getVulnerableSoftwareByPurl(purlType, purlNamespace, purlName, versionEndExcluding, versionEndIncluding, versionStartExcluding, versionStartIncluding);
}
public List<VulnerableSoftware> getVulnerableSoftwareByVulnId(final String source, final String vulnId) {
return getVulnerableSoftwareQueryManager().getVulnerableSoftwareByVulnId(source, vulnId);
}
public List<VulnerableSoftware> getAllVulnerableSoftwareByPurl(final PackageURL purl) {
return getVulnerableSoftwareQueryManager().getAllVulnerableSoftwareByPurl(purl);
}
public List<VulnerableSoftware> getAllVulnerableSoftware(final String cpePart, final String cpeVendor, final String cpeProduct, final String cpeVersion, final PackageURL purl) {
return getVulnerableSoftwareQueryManager().getAllVulnerableSoftware(cpePart, cpeVendor, cpeProduct, cpeVersion, purl);
}
public List<VulnerableSoftware> getAllVulnerableSoftware(final String cpePart, final String cpeVendor, final String cpeProduct, final PackageURL purl) {
return getVulnerableSoftwareQueryManager().getAllVulnerableSoftware(cpePart, cpeVendor, cpeProduct, purl);
}
public Cwe createCweIfNotExist(int id, String name) {
return getVulnerableSoftwareQueryManager().createCweIfNotExist(id, name);
}
public Cwe getCweById(int cweId) {
return getVulnerableSoftwareQueryManager().getCweById(cweId);
}
public PaginatedResult getCwes() {
return getVulnerableSoftwareQueryManager().getCwes();
}
public List<Cwe> getAllCwes() {
return getVulnerableSoftwareQueryManager().getAllCwes();
}
public Component matchSingleIdentity(final Project project, final ComponentIdentity cid) {
return getComponentQueryManager().matchSingleIdentity(project, cid);
}
public List<Component> matchIdentity(final Project project, final ComponentIdentity cid) {
return getComponentQueryManager().matchIdentity(project, cid);
}
public List<Component> matchIdentity(final ComponentIdentity cid) {
return getComponentQueryManager().matchIdentity(cid);
}
public void reconcileComponents(Project project, List<Component> existingProjectComponents, List<Component> components) {
getComponentQueryManager().reconcileComponents(project, existingProjectComponents, components);
}
public List<Component> getAllComponents(Project project) {
return getComponentQueryManager().getAllComponents(project);
}
public PaginatedResult getComponents(final Project project, final boolean includeMetrics) {
return getComponentQueryManager().getComponents(project, includeMetrics);
}
public ServiceComponent matchServiceIdentity(final Project project, final ComponentIdentity cid) {
return getServiceComponentQueryManager().matchServiceIdentity(project, cid);
}
public void reconcileServiceComponents(Project project, List<ServiceComponent> existingProjectServices, List<ServiceComponent> services) {
getServiceComponentQueryManager().reconcileServiceComponents(project, existingProjectServices, services);
}
public ServiceComponent createServiceComponent(ServiceComponent service, boolean commitIndex) {
return getServiceComponentQueryManager().createServiceComponent(service, commitIndex);
}
public List<ServiceComponent> getAllServiceComponents() {
return getServiceComponentQueryManager().getAllServiceComponents();
}
public List<ServiceComponent> getAllServiceComponents(Project project) {
return getServiceComponentQueryManager().getAllServiceComponents(project);
}
public PaginatedResult getServiceComponents() {
return getServiceComponentQueryManager().getServiceComponents();
}
public PaginatedResult getServiceComponents(final boolean includeMetrics) {
return getServiceComponentQueryManager().getServiceComponents(includeMetrics);
}
public PaginatedResult getServiceComponents(final Project project, final boolean includeMetrics) {
return getServiceComponentQueryManager().getServiceComponents(project, includeMetrics);
}
public ServiceComponent cloneServiceComponent(ServiceComponent sourceService, Project destinationProject, boolean commitIndex) {
return getServiceComponentQueryManager().cloneServiceComponent(sourceService, destinationProject, commitIndex);
}
public ServiceComponent updateServiceComponent(ServiceComponent transientServiceComponent, boolean commitIndex) {
return getServiceComponentQueryManager().updateServiceComponent(transientServiceComponent, commitIndex);
}
public void recursivelyDelete(ServiceComponent service, boolean commitIndex) {
getServiceComponentQueryManager().recursivelyDelete(service, commitIndex);
}
public PaginatedResult getVulnerabilities() {
return getVulnerabilityQueryManager().getVulnerabilities();
}
public PaginatedResult getVulnerabilities(Component component) {
return getVulnerabilityQueryManager().getVulnerabilities(component);
}
public PaginatedResult getVulnerabilities(Component component, boolean includeSuppressed) {
return getVulnerabilityQueryManager().getVulnerabilities(component, includeSuppressed);
}
public List<Component> getAllVulnerableComponents(Project project, Vulnerability vulnerability, boolean includeSuppressed) {
return getVulnerabilityQueryManager().getAllVulnerableComponents(project, vulnerability, includeSuppressed);
}
public List<Vulnerability> getAllVulnerabilities(Component component) {
return getVulnerabilityQueryManager().getAllVulnerabilities(component);
}
public List<Vulnerability> getAllVulnerabilities(Component component, boolean includeSuppressed) {
return getVulnerabilityQueryManager().getAllVulnerabilities(component, includeSuppressed);
}
public long getVulnerabilityCount(Project project, boolean includeSuppressed) {
return getVulnerabilityQueryManager().getVulnerabilityCount(project, includeSuppressed);
}
public List<Vulnerability> getVulnerabilities(Project project, boolean includeSuppressed) {
return getVulnerabilityQueryManager().getVulnerabilities(project, includeSuppressed);
}
public long getAuditedCount() {
return getFindingsQueryManager().getAuditedCount();
}
public long getAuditedCount(Project project) {
return getFindingsQueryManager().getAuditedCount(project);
}
public long getAuditedCount(Component component) {
return getFindingsQueryManager().getAuditedCount(component);
}
public long getAuditedCount(Project project, Component component) {
return getFindingsQueryManager().getAuditedCount(project, component);
}
public long getSuppressedCount() {
return getFindingsQueryManager().getSuppressedCount();
}
public long getSuppressedCount(Project project) {
return getFindingsQueryManager().getSuppressedCount(project);
}
public long getSuppressedCount(Component component) {
return getFindingsQueryManager().getSuppressedCount(component);
}
public long getSuppressedCount(Project project, Component component) {
return getFindingsQueryManager().getSuppressedCount(project, component);
}
public List<Project> getProjects(Vulnerability vulnerability) {
return getVulnerabilityQueryManager().getProjects(vulnerability);
}
public VulnerabilityAlias synchronizeVulnerabilityAlias(VulnerabilityAlias alias) {
return getVulnerabilityQueryManager().synchronizeVulnerabilityAlias(alias);
}
public List<VulnerabilityAlias> getVulnerabilityAliases(Vulnerability vulnerability) {
return getVulnerabilityQueryManager().getVulnerabilityAliases(vulnerability);
}
List<Analysis> getAnalyses(Project project) {
return getFindingsQueryManager().getAnalyses(project);
}
public Analysis getAnalysis(Component component, Vulnerability vulnerability) {
return getFindingsQueryManager().getAnalysis(component, vulnerability);
}
public Analysis makeAnalysis(Component component, Vulnerability vulnerability, AnalysisState analysisState,
AnalysisJustification analysisJustification, AnalysisResponse analysisResponse,
String analysisDetails, Boolean isSuppressed) {
return getFindingsQueryManager().makeAnalysis(component, vulnerability, analysisState, analysisJustification, analysisResponse, analysisDetails, isSuppressed);
}
public AnalysisComment makeAnalysisComment(Analysis analysis, String comment, String commenter) {
return getFindingsQueryManager().makeAnalysisComment(analysis, comment, commenter);
}