Package org.camunda.bpm.engine.rest.application

Source Code of org.camunda.bpm.engine.rest.application.UnannotatedResource

package org.camunda.bpm.engine.rest.application;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response.Status;

import org.camunda.bpm.engine.AuthorizationException;
import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.rest.exception.RestException;

/**
* Does not declare produced media types.
* @author Thorben Lindhauer
*
*/
@Path("/unannotated")
public class UnannotatedResource {

  @GET
  @Path("/exception")
  public String throwAnException() throws Exception {
    throw new Exception("expected exception");
  }
 
  @GET
  @Path("/processEngineException")
  public String throwProcessEngineException() throws Exception {
    throw new ProcessEngineException("expected exception");
  }
 
  @GET
  @Path("/restException")
  public String throwRestException() throws Exception {
    throw new RestException(Status.BAD_REQUEST, "expected exception");
  }
 
  @GET
  @Path("/authorizationException")
  public String throwAuthorizationException() throws Exception {
    throw new AuthorizationException("someUser", "somePermission", "someResourceName", "someResourceId");
  }
}
TOP

Related Classes of org.camunda.bpm.engine.rest.application.UnannotatedResource

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.