File tree Expand file tree Collapse file tree 2 files changed +83
-0
lines changed
src/main/java/io/securecodebox/persistence/defectdojo Expand file tree Collapse file tree 2 files changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ package io .securecodebox .persistence .defectdojo .models ;
2+
3+ import com .fasterxml .jackson .annotation .JsonInclude ;
4+ import com .fasterxml .jackson .annotation .JsonProperty ;
5+ import lombok .*;
6+
7+ import java .util .List ;
8+ import java .util .Map ;
9+
10+ @ Data
11+ @ Builder
12+ @ NoArgsConstructor
13+ @ AllArgsConstructor
14+ @ EqualsAndHashCode (callSuper = true )
15+ @ JsonInclude (JsonInclude .Include .NON_NULL )
16+ public class Endpoint extends DefectDojoModel {
17+ @ JsonProperty
18+ Long id ;
19+
20+ @ JsonProperty
21+ String protocol ;
22+
23+ @ JsonProperty
24+ String host ;
25+
26+ @ JsonProperty ("fqdm" )
27+ String fullyQualifiedDomainName ;
28+
29+ @ JsonProperty
30+ Long port ;
31+
32+ @ JsonProperty
33+ String path ;
34+
35+ @ JsonProperty
36+ String query ;
37+
38+ @ JsonProperty
39+ String fragment ;
40+
41+ @ JsonProperty
42+ Long product ;
43+
44+ @ JsonProperty
45+ Boolean mitigated ;
46+
47+ @ Override
48+ public boolean equalsQueryString (Map <String , Object > queryParams ) {
49+ if (queryParams .containsKey ("id" ) && queryParams .get ("id" ).equals (this .id )) {
50+ return true ;
51+ }
52+ return false ;
53+ }
54+ }
Original file line number Diff line number Diff line change 1+ package io .securecodebox .persistence .defectdojo .service ;
2+
3+ import com .fasterxml .jackson .core .JsonProcessingException ;
4+ import com .fasterxml .jackson .core .type .TypeReference ;
5+ import io .securecodebox .persistence .defectdojo .config .DefectDojoConfig ;
6+ import io .securecodebox .persistence .defectdojo .models .DefectDojoResponse ;
7+ import io .securecodebox .persistence .defectdojo .models .Endpoint ;
8+
9+ public class EndpointService extends GenericDefectDojoService <Endpoint > {
10+ public EndpointService (DefectDojoConfig config ) {
11+ super (config );
12+ }
13+
14+ @ Override
15+ protected String getUrlPath () {
16+ return "endpoints" ;
17+ }
18+
19+ @ Override
20+ protected Class <Endpoint > getModelClass () {
21+ return Endpoint .class ;
22+ }
23+
24+ @ Override
25+ protected DefectDojoResponse <Endpoint > deserializeList (String response ) throws JsonProcessingException {
26+ return this .objectMapper .readValue (response , new TypeReference <>() {
27+ });
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments