/* ----------------------------------------
 * Origin  : GFI INFORMATIQUE 
 * Project : CDPP Propagation Tool 
 * ----------------------------------------
 * History 
 * Version : 01/05/2015 : SCA : V2.1
 * ----------------------------------------
 */
package fr.tlse.irap.server.frontServices;

import java.awt.Image;
import java.util.Date;

import javax.jws.WebMethod;
import javax.jws.WebService;

import org.apache.log4j.Logger;

import fr.tlse.irap.map.EclipticMap;
import fr.tlse.irap.map.IEclipticMap;
import fr.tlse.irap.server.serviceDAO.IFitsDAO;
import fr.tlse.irap.server.serviceDAO.IImageDAO;

@WebService(endpointInterface = "fr.tlse.irap.map.IEclipticMap")
public class EclipticMapImpl implements IEclipticMap {
	private static final Logger logger = Logger.getLogger(EclipticMapImpl.class);
	
	private IFitsDAO fitsDAO;
	private IImageDAO imageDAO;

	public EclipticMapImpl() {
	}
	
	@WebMethod
	public EclipticMap getEclipticMap(Date t, String type) {
		logger.info("Start retrieving a eclipticMap file ");
		EclipticMap eclipticMap = null;
		try {
			//TODO
			//eclipticMap = fitsDAO.loadJMap(type, t);
		} catch (Exception e) {
			return eclipticMap;
		}
		logger.info("Stop retrieving a eclipticMap file ");
		return eclipticMap;
		
	}

	@WebMethod
	public Image getEclipticImage(Date t, String type) {
		logger.info("Start retrieving a eclipticMap file ");
		Image eclipticMap = null;
		try {
			// TODO
//			if (type.equals("BMap")) {
//				eclipticMap = imageDAO.loadEclipticBMap(t);
//			}
		} catch (Exception e) {
			return eclipticMap;
		}
		logger.info("Stop retrieving a eclipticMap file ");
		return eclipticMap;
		
	}

	public IFitsDAO getFitsDAO() {
		return fitsDAO;
	}

	public void setFitsDAO(IFitsDAO fitsDAO) {
		this.fitsDAO = fitsDAO;
	}

	public IImageDAO getImageDAO() {
		return imageDAO;
	}

	public void setImageDAO(IImageDAO imageDAO) {
		this.imageDAO = imageDAO;
	}

}
