/*
 * 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 pl.edu.pwr.nlpmonitor;

import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PUT;
import javax.ws.rs.core.MediaType;
import org.json.JSONArray;

/**
 * REST Web Service
 *
 * @author www_zsk
 */
@Path("")
public class TestWSResource {

    @Context
    private UriInfo context;

    /**
     * Creates a new instance of TestWSResource
     */
    public TestWSResource() {
    }

    /**
     * Retrieves representation of an instance of pl.edu.pwr.nlpmonitor.TestWSResource
     * @return an instance of java.lang.String
     */
    
    
    @GET     
    @Path("getWorkerStatus")
    @Produces(MediaType.APPLICATION_JSON)
    public String getWorkerStatus() 
    { WorkerStatus wstatus=new WorkerStatus();
      JSONArray result =wstatus.get();
      return result.toString();
        
     
    }
    
    
    @GET
    @Produces("application/xml")
    public String getXml() {
        //TODO return proper representation object
        throw new UnsupportedOperationException();
    }

    /**
     * PUT method for updating or creating an instance of TestWSResource
     * @param content representation for the resource
     * @return an HTTP response with content of the updated or created resource.
     */
    @PUT
    @Consumes("application/xml")
    public void putXml(String content) {
    }
}
