All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.openservices.log.response.GetShipperTasksResponse Maven / Gradle / Ivy

There is a newer version: 0.6.115
Show newest version
package com.aliyun.openservices.log.response;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.aliyun.openservices.log.common.ShipperTask;
import com.aliyun.openservices.log.common.ShipperTasksStatistic;

public class GetShipperTasksResponse extends Response {
	/**
	 * 
	 */
	private static final long serialVersionUID = 4081210336385900737L;
	
	private int mCount = 0;
	private int mTotal = 0;
	private ShipperTasksStatistic mStatistic = null;
	private List mShipperTasks = null;

	public GetShipperTasksResponse(Map headers, int count, int total, ShipperTasksStatistic statistic, List shipperTasks) {
		super(headers);
		mCount = count;
		mTotal = total;
		mStatistic = statistic;
		mShipperTasks = new ArrayList(shipperTasks);
	}
	
	public int GetCountTask()
	{
		return mCount;
	}
	
	public int GetTotalTask()
	{
		return mTotal;
	}
	
	public int GetRunningTaskCount()
	{
		return mStatistic.GetRunningTaskCount();
	}
	public int GetSuccessTaskCount()
	{
		return mStatistic.GetSuccessTaskCount();
	}
	public int GetFailTaskCount()
	{
		return mStatistic.GetFailTaskCount();
	}
	public List GetShipperTasks()
	{
		return new ArrayList(mShipperTasks);
	}
	
	public List GetSuccessTaskIds()
	{
		return GetTaskIds("success");
	}
	
	public List GetFailTaskIds()
	{
		return GetTaskIds("fail");
	}
	
	public List GetRunningTaskIds()
	{
		return GetTaskIds("running");
	}
	
	private List GetTaskIds(String status)
	{
		List res = new ArrayList();
		for (ShipperTask task : mShipperTasks)
		{
			if (task.GetTaskStatus().equals(status))
			{
				res.add(task.GetTaskId());
			}
		}
		return res;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy