Class BotMaestroSDK

java.lang.Object
dev.botcity.maestro_sdk.BotMaestroSDK
All Implemented Interfaces:
IFunctionService

public class BotMaestroSDK extends Object implements IFunctionService
  • Field Details

    • ignoreSSL

      public boolean ignoreSSL
    • server

      public String server
    • accessToken

      public dev.botcity.api.client.login.GetToken accessToken
  • Constructor Details

    • BotMaestroSDK

      public BotMaestroSDK()
  • Method Details

    • login

      public void login(String server, String login, String key)
    • login

      public void login(BotExecution execution)
    • getTask

      public AutomationTask getTask(String taskId)
      Specified by:
      getTask in interface IFunctionService
      Parameters:
      taskId - Task ID
      Returns:
      AutomationTask with all attributes of the task.
      Required Parameters:
      (taskId)
    • interruptTask

      public AutomationTask interruptTask(String taskId)
      Specified by:
      interruptTask in interface IFunctionService
      Parameters:
      taskId - Task ID
      Returns:
      AutomationTask with all attributes of the task.
      Required Parameters:
      (taskId)
    • restartTask

      public AutomationTask restartTask(String taskId)
      Specified by:
      restartTask in interface IFunctionService
      Parameters:
      taskId - Task ID
      Returns:
      AutomationTask with all attributes of the task.
      Required Parameters:
      (taskId)
    • finishTask

      public AutomationTask finishTask(String taskId, String finishMessage, AutomationTask.FinishStatus finishStatus)
      Specified by:
      finishTask in interface IFunctionService
      Parameters:
      taskId - Task ID
      finishMessage - optional task termination message
      finishStatus - SUCCESS, FAILED, PARTIALLY_COMPLETED
      Returns:
      AutomationTask with all attributes of the task.
      Required Parameters:
      (taskId, finishStatus)
    • finishTask

      public AutomationTask finishTask(String taskId, AutomationTask.FinishStatus status)
      Parameters:
      taskId - iTask ID
      status - SUCCESS, FAILED, PARTIALLY_COMPLETED
      Returns:
      AutomationTask with all attributes of the task.
      Required Parameters:
      (taskId, finishStatus)
    • listTasks

      public PageTaskVO listTasks()
      Specified by:
      listTasks in interface IFunctionService
      Returns:
      PageTaskVO with the content(List) with the first 10 lines of page 1.
    • listTasks

      public PageTaskVO listTasks(Integer page)
      ATTENTION: By default, we return 10 records
      Specified by:
      listTasks in interface IFunctionService
      Parameters:
      page - page number in the listing.
      Returns:
      PageTaskVO with the content(List) with all attributes of the task.
      Required Parameters:
      (page)
    • createTask

      public AutomationTask createTask(String label, Map<String,Object> params, boolean taskToTest)
      Specified by:
      createTask in interface IFunctionService
      Parameters:
      label - Label
      params - parameter map.
      taskToTest - boolean informing if it is a test task.
      Returns:
      AutomationTask with all attributes of the task.
      Required Parameters:
      (label)
    • createTask

      public AutomationTask createTask(String label, Map<String,Object> params)
      Parameters:
      label - Label
      params - parameter map.
      Returns:
      AutomationTask with all attributes of the task.
      Required Parameters:
      (label)
    • newLogEntry

      public ResponseData newLogEntry(String logId, Map<String,Object> columns)
      Specified by:
      newLogEntry in interface IFunctionService
      Parameters:
      logId - Log Id
      columns - hasMap of Log Entry columns
      Returns:
      ResponseData (message, statusCode).
      Required Parameters:
      (logId, columns)
    • newLogEntry

      public ResponseData newLogEntry(String logId, Object[][] columns)
      Parameters:
      logId - ID of the Log Entry
      columns - Object[][] of Log Entry columns
      Returns:
      ResponseData (message, statusCode).
      Required Parameters:
      (logId, columns)
    • getLogFile

      public byte[] getLogFile(String logId, Integer days)
      Specified by:
      getLogFile in interface IFunctionService
      Parameters:
      logId - Log ID
      days - number of days
      Returns:
      Data byte[]
      Required Parameters:
      (logId, days)
    • newLog

      public LogSchemaVO newLog(String label, List<Column> columns)
      Specified by:
      newLog in interface IFunctionService
      Parameters:
      label - Label
      columns - list of log columns
      Returns:
      LogSchemaVO with all the log attributes.
      Required Parameters:
      (label, columns)
    • getLog

      public List<Row> getLog(String logId, Integer days)
      Specified by:
      getLog in interface IFunctionService
      Parameters:
      logId - Log ID
      days - number of days
      Returns:
      List containing the hasmap.
      Required Parameters:
      (logId, days)
    • deleteLog

      public ResponseData deleteLog(String label)
      Specified by:
      deleteLog in interface IFunctionService
      Parameters:
      label - Label
      Returns:
      ResponseData (message, statusCode).
      Required Parameters:
      (label)
    • postArtifact

      public ResponseData postArtifact(String taskId, String artifactName, File artifactFile)
      Specified by:
      postArtifact in interface IFunctionService
      Parameters:
      taskId - Task ID
      artifactName - Artifact Name
      artifactFile - Artifact File
      Returns:
      ResponseData (message, statusCode).
      Required Parameters:
      (taskId, artifactName, artifactFile)
    • getArtifactFile

      public byte[] getArtifactFile(String artifactId)
      Specified by:
      getArtifactFile in interface IFunctionService
      Parameters:
      artifactId - Artifact ID
      Returns:
      Data byte[]
      Required Parameters:
      (artifactId)
    • listArtifact

      public List<ArtifactVO> listArtifact()
      Specified by:
      listArtifact in interface IFunctionService
      Returns:
      ArtifactVO list with all attributes of the Artifact.
    • alert

      public AlertVO alert(String taskId, String title, String message, AlertType alertType)
      Specified by:
      alert in interface IFunctionService
      Parameters:
      title - Title
      message - Message
      alertType - INFO, WARN, ERROR
      Returns:
      AlertVO with all attributes of the Alert.
      Required Parameters:
      (taskId, title, message, alertType)
    • message

      public ResponseData message(List<String> email, List<String> users, String subject, String body, MessageType messageType, String group)
      Deprecated.
      As of VERSION 1.2.3, replaced by message(List, String, String, MessageType)
      Specified by:
      message in interface IFunctionService
      Parameters:
      email - Email
      subject - Subject
      body - Body
      messageType - TEXT, HTML
      group - Group
      Returns:
      ResponseData (message, statusCode).
      Required Parameters:
      (email, subject, body, messageType)
    • message

      public ResponseData message(List<String> email, String subject, String body, MessageType messageType)
      Parameters:
      email - Email
      subject - Subject
      body - Body
      messageType - TEXT, HTML
      Returns:
      ResponseData (message, statusCode).
      Required Parameters:
      (email, subject, body, messageType)
    • createCredential

      public SecretVO createCredential(String credentialLabel, String key, String value)
      Specified by:
      createCredential in interface IFunctionService
      Parameters:
      key - Key
      value - Value
      credentialLabel - Label
      Returns:
      SecretVO with all attributes of the Credential.
      Required Parameters:
      (credentialLabel, key, value)
    • createError

      public ResponseData createError(Integer taskId, Exception exception, File fileScreenshot, Map<String,Object> tags, List<File> fileAttachmentList)
      Specified by:
      createError in interface IFunctionService
      Parameters:
      taskId - Task ID
      exception - Exception to the error
      fileScreenshot - Screenshot of the error
      tags - Tags
      fileAttachmentList - Attachment list of the error
      Returns:
      ResponseData (message, statusCode).
      Required Parameters:
      (taskId, exception)