Class MantisBtClient

java.lang.Object
com.michelin.cert.redscan.utils.mantisbt.MantisBtClient

public class MantisBtClient extends Object
MantisBT client.
Author:
Maxime ESCOURBIAC
  • Constructor Details

    • MantisBtClient

      public MantisBtClient()
  • Method Details

    • init

      public static void init(String url, String username, String password)
      Init the MantisBT client.
      Parameters:
      url - MantisBT url (ex: http://10.124.2.25:9200 )
      username - MantisBT Search user.
      password - MantisBT Search password.
    • getMantisVersion

      public String getMantisVersion()
      Get MantisBT version.
      Returns:
      MantisBT version.
    • getIssue

      public biz.futureware.mantisconnect.IssueData getIssue(BigInteger id)
      Get issue by MantisBT id.
      Parameters:
      id - MantisBT id.
      Returns:
      MantisBT issue.
    • getIssuesByInternalId

      public biz.futureware.mantisconnect.IssueData[] getIssuesByInternalId(String id)
      Get issue by Internal id. In normal case, only one issue should be found.
      Parameters:
      id - Internal id
      Returns:
      MantisBT issues.
    • deleteIssue

      public boolean deleteIssue(BigInteger id)
      Delete MantisBT issue.
      Parameters:
      id - MantisBT id.
      Returns:
      True if the deletion is successful.
    • shouldBeReopened

      public boolean shouldBeReopened(biz.futureware.mantisconnect.IssueData issue)
      Determine if the ticket should be reopened.
      Parameters:
      issue - Issue to verify.
      Returns:
      True if the issue should be reopened.
    • reopenTicket

      public boolean reopenTicket(BigInteger id)
      Reopen a ticket.
      Parameters:
      id - Ticket id.
      Returns:
      True if the ticket has been reopened.
    • addComment

      public BigInteger addComment(BigInteger id, String comment)
      Add a note to a ticket.
      Parameters:
      id - Ticket id.
      comment - Comment to add.
      Returns:
      Comment id.
    • createIssue

      public BigInteger createIssue(Vulnerability vulnerability)
      Create a MantisBT issue from vulnerability.
      Parameters:
      vulnerability - Vulnerability to create.
      Returns:
      ID of the created ticket.