All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.moskito.webui.threshold.resource.StatusResource Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package net.anotheria.moskito.webui.threshold.resource;

import net.anotheria.anoplass.api.APIException;
import net.anotheria.moskito.webui.shared.resource.AbstractResource;
import net.anotheria.moskito.webui.shared.resource.ReplyObject;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.WebApplicationException;

/**
 * TODO comment this class
 *
 * @author lrosenberg
 * @since 14.04.15 18:09
 */
@Path("status")
public class StatusResource extends AbstractResource {

	@GET
	public ReplyObject getWorstStatus(){
		try{
			return ReplyObject.success("status", getThresholdAPI().getWorstStatus().name());
		}catch(APIException e){
			throw new WebApplicationException(e);
		}
	}

	@POST
	public ReplyObject getWorstStatus(StatusForm statusForm){
		try{
			return ReplyObject.success("status", getThresholdAPI().getWorstStatus(statusForm.getThresholdNames()).name());
		}catch(APIException e){
			throw new WebApplicationException(e);
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy