/*
 * Created on 3 nov. 2004
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package tsp.core.consumer;

import tsp.core.rpc.TSP_status_t;
import tsp.core.rpc.TSP_answer_sample_t;
import tsp.core.common.TspAnswerSample;
import tsp.core.config.TspConfig;

import java.util.LinkedList;


/**
 * 
 */
public class TspConsumerRequestSampleException extends TspConsumerException {
	
	private TSP_answer_sample_t theAnswerSample;
	
	/**
	 * 
	 */
	public TspConsumerRequestSampleException() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	
	public TspConsumerRequestSampleException(int status) {
		super();
		this.status = status; 
	}

	/**
	 * 
	 */
	public TspConsumerRequestSampleException(String message) {
		super(message);
		// TODO Auto-generated constructor stub
	}
	
	public TspConsumerRequestSampleException(int status, String message) {
		super(message);
		this.status = status; 
	}

	/**
	 * 
	 */
	public TspConsumerRequestSampleException(int status, String message, Throwable cause) {
		super(message, cause);
		this.status = status;
		// TODO Auto-generated constructor stub
	}

	/**
	 * 
	 */
	public TspConsumerRequestSampleException(Throwable cause) {
		super(cause);
		// TODO Auto-generated constructor stub
	}
	
	public TspConsumerRequestSampleException(TSP_answer_sample_t anAnswer) {
		super();
		this.theAnswerSample = anAnswer;
		
	}

	public LinkedList getInvalidSymbolsName() {
		LinkedList invalidSymbolsName = new LinkedList();
		for (int i=0; i<theAnswerSample.symbols.value.length;i++){
			if (theAnswerSample.symbols.value[i].provider_global_index < 0){
				invalidSymbolsName.addLast(theAnswerSample.symbols.value[i].name);
			}
		}
		return invalidSymbolsName;
	}
	
	public TSP_answer_sample_t getAnswerSample() {
		return theAnswerSample;
	}
	
	public int getStatus() {
		return theAnswerSample.status;
	}
	  
}
