package com.bocloud.ims.service.internal.worker;

import java.util.List;

/**
 * 同步调用Worker服务的返回结果包装类
 * 
 * <pre>
 * 返回结果示例
 * {
 * 	"success": true,
 * 	"message": "The sync job Finished",
 * 	"results": [{
 * 		"task": "authority",
 * 		"success": true,
 * 		"host": "192.168.2.21",
 * 		"cost": 31.1895689964294,
 * 		"user": "root",
 * 		"message": {
 * 			"bsm_worker_msg": {
 * 				"msg": "All items completed",
 * 				"changed": true,
 * 				"results": [{
 * 					"changed": true,
 * 					"stdout": "sxp-test-1 ALL=(root) NOPASSWD: /usr/sbin/useradd,/usr/sbin/userdel\r\n",
 * 					"item": "sxp-test-1",
 * 					"stderr": "Shared connection to 192.168.2.21 closed.\r\n",
 * 					"stdout_lines": [
 * 						"sxp-test-1 ALL=(root) NOPASSWD: /usr/sbin/useradd,/usr/sbin/userdel"
 * 					]
 * 				}]
 * 			},
 * 			"changed": false
 * 		},
 * 		"port": 22
 * 	}]
 * }
 * </pre>
 * 
 * @author sxp
 * @since Jan 23, 2018
 */
public class WorkerResult {
	private boolean success;
	private String message;
	private List<WorkerHostResult> data;

	public WorkerResult() {
		super();
	}

	public boolean isSuccess() {
		return success;
	}

	public boolean getSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * @return the data
	 */
	public List<WorkerHostResult> getData() {
		return data;
	}

	/**
	 * @param data the data to set
	 */
	public void setData(List<WorkerHostResult> data) {
		this.data = data;
	}

}
