package hh.dejsem.fm;

import android.os.Bundle;

import hh.dejsem.K;
import hh.lib.D;

/**
 * ----------------------------------------------------------
 * control data of file transfer task
 * ----------------------------------------------------------
 */
public class NetTaskRef {

	public D d;
	private Bundle args;
	private TaskProgress progress;
	public boolean failedTimeStamp = false;    // bug in setLastModified()
	public boolean go;                         // task is not cancelled

	NetTaskRef(D d, Bundle args, EntitySize es) {
		this.d = d.klon(this);
		progress = (es != null ? new TaskProgress(this.d, es) : new TaskProgress(this.d));
		if(this.d.ll(4)) this.d.l(String.format("new task ref, fn=%s, context=%s, msgr=%s",
				progress.es.getFn(), this.d.getContext(), this.d.actMsgr));
		this.args = args;
		go = true;
	}

	int getPort() { return args.getInt(K.PORT_KEY); }

	public Bundle getArgs() { return args; }

	public TaskProgress getProgress() { return progress; }
}
