/* ************************************************************************
#
#  DivConq
#
#  http://divconq.com/
#
#  Copyright:
#    Copyright 2012 eTimeline, LLC. All rights reserved.
#
#  License:
#    See the license.txt file in the project's top-level directory for details.
#
#  Authors:
#    * Andy White
#
************************************************************************ */
package divconq.db;

import divconq.struct.FieldStruct;
import divconq.struct.RecordStruct;

/**
 * Send a request to the database that merely returns the string intact including support
 * for unicode characters (but not certain control characters).  This request is helpful 
 * for verifying that the database is connected and working (and has unicode support 
 * turned on).
 * 
 * @author Andy
 *
 */
public class EchoRequest extends QueryRequest {
	protected String text = null;

	/**
	 * @return text to echo
	 */
	public String getText() {
		return this.text;
	}
	
	/**
	 * @param v text to echo
	 */
	public void setText(String v) {
		this.text = v;
	}
	
	/**
	 * @param text the string to echo back
	 */
	public EchoRequest(String text) {
		super("dcEcho");
		this.text = text;
	}
	
	/* (non-Javadoc)
	 * @see divconq.db.IDatabaseRequest#getDatabaseParams()
	 */
	@Override
	public RecordStruct getDatabaseParams(IDatabaseManager dbm) {
		return new RecordStruct(new FieldStruct("Text", this.text));
	}
}
