Package com.gooddata.dataload.processes
Class ProcessService
- java.lang.Object
-
- com.gooddata.AbstractService
-
- com.gooddata.dataload.processes.ProcessService
-
public class ProcessService extends AbstractService
Service to manage dataload processes and process executions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.gooddata.AbstractService
AbstractService.OutputStreamResponseExtractor
-
-
Field Summary
-
Fields inherited from class com.gooddata.AbstractService
mapper, restTemplate
-
-
Constructor Summary
Constructors Constructor Description ProcessService(org.springframework.web.client.RestTemplate restTemplate, AccountService accountService, DataStoreService dataStoreService)Deprecated.use ProcessService(RestTemplate, AccountService, DataStoreService, GoodDataSettings) insteadProcessService(org.springframework.web.client.RestTemplate restTemplate, AccountService accountService, DataStoreService dataStoreService, GoodDataSettings settings)Sets RESTful HTTP Spring template.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DataloadProcesscreateProcess(Project project, DataloadProcess process)Create new process without data.DataloadProcesscreateProcess(Project project, DataloadProcess process, File processData)Create new process with given data by given project.FutureResult<DataloadProcess>createProcessFromAppstore(Project project, DataloadProcess process)Create new process from appstore.SchedulecreateSchedule(Project project, Schedule schedule)Create new schedule with given data by given project.FutureResult<ProcessExecutionDetail>executeProcess(ProcessExecution execution)Run given execution under given processFutureResult<ScheduleExecution>executeSchedule(Schedule schedule)Executes given schedulevoidgetExecutionLog(ProcessExecutionDetail executionDetail, OutputStream outputStream)Get process execution logDataloadProcessgetProcessById(Project project, String id)Get process by given id and project.DataloadProcessgetProcessByUri(String uri)Get process by given URI.voidgetProcessSource(DataloadProcess process, OutputStream outputStream)Get process source data.SchedulegetScheduleById(Project project, String id)Get schedule by given id and project.SchedulegetScheduleByUri(String uri)Get schedule by given URI.Collection<DataloadProcess>listProcesses(Project project)Get list of processes by given project.com.gooddata.collections.PageableList<Schedule>listSchedules(Project project)Get first page of paged list of schedules by given project.com.gooddata.collections.PageableList<Schedule>listSchedules(Project project, com.gooddata.collections.Page startPage)Get defined page of paged list of schedules by given project.Collection<DataloadProcess>listUserProcesses()Get list of current user processes by given user account.voidremoveProcess(DataloadProcess process)Delete given processvoidremoveSchedule(Schedule schedule)Delete given scheduleDataloadProcessupdateProcess(DataloadProcess process, File processData)Update process with given data by given project.DataloadProcessupdateProcess(Project project, DataloadProcess process, File processData)Deprecated.FutureResult<DataloadProcess>updateProcessFromAppstore(DataloadProcess process)Update process with data from appstore by given project.FutureResult<DataloadProcess>updateProcessFromAppstore(Project project, DataloadProcess process)Deprecated.ScheduleupdateSchedule(Schedule schedule)Update the given scheduleScheduleupdateSchedule(Project project, Schedule schedule)Deprecated.-
Methods inherited from class com.gooddata.AbstractService
extractData
-
-
-
-
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 templateaccountService- service to access accountsdataStoreService- service for upload process datasettings- settings
-
ProcessService
@Deprecated public ProcessService(org.springframework.web.client.RestTemplate restTemplate, AccountService accountService, DataStoreService dataStoreService)
Deprecated.use ProcessService(RestTemplate, AccountService, DataStoreService, GoodDataSettings) insteadSets RESTful HTTP Spring template. Should be called from constructor of concrete service extending this abstract one.- Parameters:
restTemplate- RESTful HTTP Spring templateaccountService- service to access accountsdataStoreService- 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 belongsprocess- to createprocessData- 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 belongsprocess- 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 belongsprocess- to create- Returns:
- created process
-
updateProcess
@Deprecated public DataloadProcess updateProcess(Project project, DataloadProcess process, File processData)
Deprecated.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 belongsprocess- to createprocessData- 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 createprocessData- process data to upload- Returns:
- updated process
-
updateProcessFromAppstore
@Deprecated public FutureResult<DataloadProcess> updateProcessFromAppstore(Project project, DataloadProcess process)
Deprecated.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 belongsprocess- 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
-
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 belongsid- 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 ofoutputStream- stream where to write fetched data
-
getExecutionLog
public void getExecutionLog(ProcessExecutionDetail executionDetail, OutputStream outputStream)
Get process execution log- Parameters:
executionDetail- execution to log ofoutputStream- 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 belongsschedule- to create- Returns:
- created schedule
-
updateSchedule
@Deprecated public Schedule updateSchedule(Project project, Schedule schedule)
Deprecated.Update the given schedule- Parameters:
project- projectschedule- to update- Returns:
- updated Schedule
- Throws:
ScheduleNotFoundException- when the schedule doesn't exist
-
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 belongsid- 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 schedulesstartPage- 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
-
executeSchedule
public FutureResult<ScheduleExecution> executeSchedule(Schedule schedule)
Executes given schedule- Parameters:
schedule- to execute- Returns:
- schedule execution
-
-