Class ProcessService


  • public class ProcessService
    extends AbstractService
    Service to manage dataload processes and process executions.
    • Constructor Detail

      • 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
      • ProcessService

        @Deprecated
        public ProcessService​(org.springframework.web.client.RestTemplate restTemplate,
                              AccountService accountService,
                              DataStoreService dataStoreService)
        Deprecated.
        use ProcessService(RestTemplate, AccountService, DataStoreService, GoodDataSettings) instead
        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
    • Method Detail

      • 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

        @Deprecated
        public DataloadProcess updateProcess​(Project project,
                                             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:
        project - project to which the process belongs
        process - to create
        processData - process data to upload
        Returns:
        updated 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

        @Deprecated
        public FutureResult<DataloadProcess> updateProcessFromAppstore​(Project project,
                                                                       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:
        project - project to which the process belongs
        process - to update
        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
      • 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
      • 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.collections.PageableList<Schedule> listSchedules​(Project project)
        Get first page of paged list of schedules by given project.
        Parameters:
        project - project of schedules
        Returns:
        MultiPageList list of found schedules or empty list
      • listSchedules

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

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