Class ProcessService

java.lang.Object
com.gooddata.sdk.service.AbstractService
com.gooddata.sdk.service.dataload.processes.ProcessService

public class ProcessService extends AbstractService
Service to manage dataload processes and process executions.
  • Field Details

    • SCHEDULE_TEMPLATE

      public static final org.springframework.web.util.UriTemplate SCHEDULE_TEMPLATE
    • PROCESS_TEMPLATE

      public static final org.springframework.web.util.UriTemplate PROCESS_TEMPLATE
    • SCHEDULES_TEMPLATE

      public static final org.springframework.web.util.UriTemplate SCHEDULES_TEMPLATE
    • PROCESSES_TEMPLATE

      public static final org.springframework.web.util.UriTemplate PROCESSES_TEMPLATE
    • USER_PROCESSES_TEMPLATE

      public static final org.springframework.web.util.UriTemplate USER_PROCESSES_TEMPLATE
  • Constructor Details

    • ProcessService

      public ProcessService(org.springframework.web.client.RestTemplate restTemplate, AccountService accountService, DataStoreService dataStoreService, GoodDataSettings settings)
      Sets RESTful HTTP Spring template. Should be called from constructor of concrete service extending this abstract one.
      Parameters:
      restTemplate - RESTful HTTP Spring template
      accountService - service to access accounts
      dataStoreService - service for upload process data
      settings - settings
  • Method Details

    • createProcess

      public DataloadProcess createProcess(Project project, DataloadProcess process, File processData)
      Create new process with given data by given project. Process must have null path to prevent clashes with deploying from appstore.
      Parameters:
      project - project to which the process belongs
      process - to create
      processData - process data to upload
      Returns:
      created process
    • createProcess

      public DataloadProcess createProcess(Project project, DataloadProcess process)
      Create new process without data. Only some specific types of processes can be created without data. Process must have null path to prevent clashes with deploying from appstore.
      Parameters:
      project - project to which the process belongs
      process - to create
      Returns:
      created process
    • createProcessFromAppstore

      public FutureResult<DataloadProcess> createProcessFromAppstore(Project project, DataloadProcess process)
      Create new process from appstore. Process must have set path field to valid appstore path in order to deploy from appstore. This method is asynchronous, because when deploying from appstore, deployment worker can be triggered.
      Parameters:
      project - project to which the process belongs
      process - to create
      Returns:
      created process
    • updateProcess

      public DataloadProcess updateProcess(DataloadProcess process, File processData)
      Update process with given data by given project. Process must have null path to prevent clashes with deploying from appstore.
      Parameters:
      process - to create
      processData - process data to upload
      Returns:
      updated process
    • updateProcessFromAppstore

      public FutureResult<DataloadProcess> updateProcessFromAppstore(DataloadProcess process)
      Update process with data from appstore by given project. Process must have set path field to valid appstore path in order to deploy from appstore. This method is asynchronous, because when deploying from appstore, deployment worker can be triggered.
      Parameters:
      process - to update
      Returns:
      updated process
    • getProcessByUri

      public DataloadProcess getProcessByUri(String uri)
      Get process by given URI.
      Parameters:
      uri - process uri
      Returns:
      found process
      Throws:
      ProcessNotFoundException - when the process doesn't exist
    • getProcessById

      public DataloadProcess getProcessById(Project project, String id)
      Get process by given id and project.
      Parameters:
      project - project to which the process belongs
      id - process id
      Returns:
      found process
      Throws:
      ProcessNotFoundException - when the process doesn't exist
    • listProcesses

      public Collection<DataloadProcess> listProcesses(Project project)
      Get list of processes by given project.
      Parameters:
      project - project of processes
      Returns:
      list of found processes or empty list
    • listUserProcesses

      public Collection<DataloadProcess> listUserProcesses()
      Get list of current user processes by given user account.
      Returns:
      list of found processes or empty list
    • removeProcess

      public void removeProcess(DataloadProcess process)
      Delete given process
      Parameters:
      process - to delete
    • getProcessSource

      public void getProcessSource(DataloadProcess process, OutputStream outputStream)
      Get process source data. Source data are fetched as zip and written to given stream.
      Parameters:
      process - process to fetch data of
      outputStream - stream where to write fetched data
    • getExecutionLog

      public void getExecutionLog(ProcessExecutionDetail executionDetail, OutputStream outputStream)
      Get process execution log
      Parameters:
      executionDetail - execution to log of
      outputStream - stream to write the log to
    • executeProcess

      public FutureResult<ProcessExecutionDetail> executeProcess(ProcessExecution execution)
      Run given execution under given process
      Parameters:
      execution - to run
      Returns:
      result of the execution
      Throws:
      ProcessExecutionException - in case process can't be executed
    • createSchedule

      public Schedule createSchedule(Project project, Schedule schedule)
      Create new schedule with given data by given project.
      Parameters:
      project - project to which the process belongs
      schedule - to create
      Returns:
      created schedule
    • updateSchedule

      public Schedule updateSchedule(Schedule schedule)
      Update the given schedule
      Parameters:
      schedule - to update
      Returns:
      updated Schedule
      Throws:
      ScheduleNotFoundException - when the schedule doesn't exist
    • getScheduleByUri

      public Schedule getScheduleByUri(String uri)
      Get schedule by given URI.
      Parameters:
      uri - schedule uri
      Returns:
      found schedule
      Throws:
      ScheduleNotFoundException - when the schedule doesn't exist
    • getScheduleById

      public Schedule getScheduleById(Project project, String id)
      Get schedule by given id and project.
      Parameters:
      project - project to which the schedule belongs
      id - schedule id
      Returns:
      found schedule
      Throws:
      ScheduleNotFoundException - when the process doesn't exist
    • listSchedules

      public com.gooddata.sdk.common.collections.PageBrowser<Schedule> listSchedules(Project project)
      Get browser of schedules by given project.
      Parameters:
      project - project of schedules
      Returns:
      PageBrowser of found schedules or empty list
    • listSchedules

      public com.gooddata.sdk.common.collections.PageBrowser<Schedule> listSchedules(Project project, com.gooddata.sdk.common.collections.PageRequest startPage)
      Get defined page of paged list of schedules by given project.
      Parameters:
      project - project of schedules
      startPage - page to be retrieved
      Returns:
      PageBrowser list of found schedules or empty list
    • removeSchedule

      public void removeSchedule(Schedule schedule)
      Delete given schedule
      Parameters:
      schedule - to delete
    • executeSchedule

      public FutureResult<ScheduleExecution> executeSchedule(Schedule schedule)
      Executes given schedule
      Parameters:
      schedule - to execute
      Returns:
      schedule execution