Skip to content

Commit

Permalink
Update TransportGetFindingsSearchAction.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Annie Lee committed Mar 30, 2022
1 parent e392de5 commit 4a3a7dd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ class TransportGetFindingsSearchAction @Inject constructor(
mgetRequest,
object : ActionListener<MultiGetResponse> {
override fun onResponse(response: MultiGetResponse) {
val findingsWithDocs: Map<Finding, FindingDocument> = mutableMapOf()
val findingsWithDocs: List<FindingWithDocs> = mutableListOf()
response.responses.forEach {
// TODO: REMOVE DEBUG LOG
log.info("response: $response")
val xcp = XContentFactory.xContent(XContentType.JSON)
.createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, response.toString())
XContentParserUtils.ensureExpectedToken(XContentParser.Token.START_OBJECT, xcp.nextToken(), xcp)
val findingDocument = FindingDocument.parse(xcp)
// TODO: Parse the searched documents and add to map of findings, need to associate original finding id to response
// TODO: Parse the searched documents and add to list of findingWithDocs, need to associate original finding id to response
}
// TODO: Form the response here with the map/list of findings
actionListener.onResponse(GetFindingsSearchResponse(RestStatus.OK, totalFindingCount, findingsWithDocs))
Expand Down

0 comments on commit 4a3a7dd

Please sign in to comment.