V1_0.java [src/java/m/gis/intersect] Revision: e2a6e0d96ef5eadfabbb16f7b42e2bbf0e24b385  Date: Mon May 11 14:49:31 MDT 2015
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package m.gis.intersect;

import csip.ModelDataService;
import javax.ws.rs.Path;
import oms3.annotations.*;
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONObject;

/**
 * GIS Intersection.
 *
 * @author od
 */
@Name("intersect")
@Description("CSIP Intersection Service")
@Path("m/intersect/1.0")
public class V1_0 extends ModelDataService {

    JSONArray geoms;	
    JSONObject result;	


    // 1) parse the service input 
    @Override
    protected void preProcess() throws Exception {
	    geoms = getJSONArrayParam("geometries");
    }

    // 2) convert the temperature
    @Override
    protected String process() throws Exception {
        LOG.info("received geometries: " + geoms.toString());  
        return EXEC_OK;
    }


    // 3) provide the temperature as a result.
    @Override
    protected void postProcess() throws Exception {
        putResult("geometry", result);
    }

}