Method description
Obtains all jobs of the current user.
Parameter description
Parameter | Type | Required | Description |
---|---|---|---|
marker | String | No | Start resource ID of the current page. Default value: Null string. |
maxItemCount | int | No | Maximum number of returned items. The maximum value is 200. The default value is also 200. |
Response description
If the call succeeds, a ListJobsResponse instance is returned. You can use the getJobList() method of this instance to obtain the List
object. If failure occurs, a ClientException is thrown.
Sample code
try{
ListJobsResponse response = client.listJobs();
//Succeeded
List<Job> list = response.getItems();
//Marker of the next page. This parameter must be specified when you query the next page.
String nextMarker = response.getNextMarker();
}catch(ClientException e){
e.printStackTrace();
// Failed
}
Sample code 2
String marker = ""; //Next marker returned by the previous listJobs. This parameter is not specified upon the first query.
int maxItemCount = 100; //The maximum value is 100. The default value is 50.
try{
ListJobsResponse response = client.listJobs(marker, maxItemCount);
//Succeeded
List<Jobs> list = response.getItems();
//Marker of the next page. This parameter must be specified when you query the next page.
String nextMarker = response.getNextMarker();
}catch(ClientException e){
e.printStackTrace();
// Failed
}
Sample code 3
String marker = ""; //Next marker returned by the previous listJobs. This parameter is not specified upon the first query.
int maxItemCount = 100; //The maximum value is 100. The default value is 50.
try{
List<Jobs> list = new ArrayList<Jobs>();
do{
ListJobsResponse response = client.listJobs(marker, maxItemCount);
//Succeeded
list.addAll(response.getItems());
//Marker of the next page. This parameter must be specified when you query the next page.
marker = response.getNextMarker();
}while(marker!=null && !marker.equals(""))
for (Job job: list){
System.out.println(job.getId()+" "+job.getNae());
}
}catch(ClientException e){
e.printStackTrace();
// Failed
}