package com.test.server;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.isomorphic.datasource.BasicDataSource;
import com.isomorphic.datasource.DSRequest;
import com.isomorphic.datasource.DSResponse;

public class ClientFilterDataSource extends
		BasicDataSource {
	
	
	@Override
	public DSResponse execute(DSRequest arg0) throws Exception {
		// TODO Auto-generated method stub
		return super.execute(arg0);
	}

	@Override
	public DSResponse executeAdd(DSRequest req) throws Exception {
		return new DSResponse();  
	}

	@Override
	public DSResponse executeCustom(DSRequest req) throws Exception {
		// TODO Auto-generated method stub
		return super.executeCustom(req);
	}

	@Override
	public DSResponse executeFetch(DSRequest req) throws Exception {
		List list = new ArrayList<HashMap>();
		HashMap r1 = new HashMap<String, String>();
		r1.put("id", "1");
		r1.put("symbolicName", "Test");
		HashMap r2 = new HashMap<String, String>();
		r2.put("id", "2");
		r2.put("symbolicName", "Not");
		list.add(r1);
		list.add(r2);
		DSResponse dsResponse = new DSResponse();
        dsResponse.setTotalRows(list.size());
        dsResponse.setStartRow(0);

        dsResponse.setEndRow(list.size());
        dsResponse.setData(list);
		return dsResponse;
	}

	@Override
	public DSResponse executeRemove(DSRequest req) throws Exception {
		return new DSResponse();
	}
	
	
	@Override
	public DSResponse executeUpdate(DSRequest req) throws Exception {  
		return new DSResponse();  
    }  
	

}
