Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.owasp.appsensor.handler;
  
  
  import javax.inject.Named;
  import  javax.ws.rs.Consumes;
  import  javax.ws.rs.GET;
  import  javax.ws.rs.POST;
 import  javax.ws.rs.Path;
 import  javax.ws.rs.Produces;
 import  javax.ws.rs.QueryParam;
 import  javax.ws.rs.container.ContainerRequestContext;
 import  javax.ws.rs.core.Context;
 import  javax.ws.rs.core.MediaType;
 
This is the restful endpoint that handles requests on the server-side.

Author(s):
John Melton (jtmelton@gmail.com) http://www.jtmelton.com/
Raphaƫl Taban
 
 @Path("/api/v1.0")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
 public class RestRequestHandler implements RequestHandler {
 
 	
 	
 	@Context
 	private ContainerRequestContext requestContext;

 
 	@POST
 	@Path("/events")
 	public void addEvent(Event eventthrows NotAuthorizedException {
 		
 		
 	}

 
 	@POST
 	@Path("/attacks")
 	public void addAttack(Attack attackthrows NotAuthorizedException {
 		
 		
 	}

 
 	@GET
 	@Path("/responses")
 	public Collection<ResponsegetResponses(@QueryParam("earliest"String earliestthrows NotAuthorizedException {
 
 		SearchCriteria criteria = new SearchCriteria().
 				setEarliest(earliest);
 
 	}

Helper method to retrieve client application name. This is set by the ClientApplicationIdentificationFilter

Returns:
client application name
		return clientApplicationName;
	}
New to GrepCode? Check out our FAQ X