Package javax.ws.rs.core.Response

Examples of javax.ws.rs.core.Response.Status


   @Path("/new-workspace/{repositoryName}")
   public Response createWorkspace(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName,
            WorkspaceEntry newWorkspace) throws URISyntaxException
   {
      String errorMessage = new String();
      Status status;
      try
      {
         RepositoryImpl repository = (RepositoryImpl) repositoryService.getRepository(repositoryName);
         repository.configWorkspace(newWorkspace);
         repository.createWorkspace(newWorkspace.getName());
View Full Code Here


   @RolesAllowed("administrators")
   @Path("/remove-repository/{repositoryName}")
   public Response removeRepository(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName)
   {
      String errorMessage = new String();
      Status status;

      try
      {
         if (repositoryService.canRemoveRepository(repositoryName))
         {
View Full Code Here

   @Path("/remove-workspace/{repositoryName}/{workspaceName}")
   public Response removeWorkspace(@Context UriInfo uriInfo, @PathParam("repositoryName") String repositoryName,
            @PathParam("workspaceName") String workspaceName)
   {
      String errorMessage = new String();
      Status status;

      try
      {
         ManageableRepository repository = repositoryService.getRepository(repositoryName);
         if (repository.canRemoveWorkspace(workspaceName))
View Full Code Here

   @RolesAllowed("administrators")
   @Path("/workspaces/{repositoryName}")
   public Response getWorkspaceNames(@PathParam("repositoryName") String repositoryName)
   {
      String errorMessage = new String();
      Status status;

      try
      {
         List<String> workspaces = new ArrayList<String>();
View Full Code Here

public class JAXBMarshalExceptionMapper extends CandlepinExceptionMapper
    implements ExceptionMapper<JAXBMarshalException> {

    @Override
    public Response toResponse(JAXBMarshalException exception) {
        Status status = Response.Status.INTERNAL_SERVER_ERROR;
        if (exception.getResponse() != null) {
            status = Response.Status.fromStatusCode(
                exception.getResponse().getStatus());
        }
        return getDefaultBuilder(exception, status, determineBestMediaType()).build();
View Full Code Here

    implements ExceptionMapper<WriterException> {

    @Override
    public Response toResponse(WriterException exception) {

        Status status = Response.Status.INTERNAL_SERVER_ERROR;
        if (exception.getResponse() != null) {
            status = Response.Status.fromStatusCode(
                exception.getResponse().getStatus());
        }
        return getDefaultBuilder(exception, status,
View Full Code Here

public class ReaderExceptionMapper extends CandlepinExceptionMapper
    implements ExceptionMapper<ReaderException> {

    @Override
    public Response toResponse(ReaderException exception) {
        Status status = Response.Status.INTERNAL_SERVER_ERROR;
        if (exception.getResponse() != null) {
            status = Response.Status.fromStatusCode(
                exception.getResponse().getStatus());
        }
        return getDefaultBuilder(exception, status, determineBestMediaType()).build();
View Full Code Here

        FilterChain chain) throws IOException, ServletException {

        TeeHttpServletResponse resp = new TeeHttpServletResponse(
                (HttpServletResponse) response);
        chain.doFilter(request, resp);
        Status status = Status.fromStatusCode(resp.getStatus());
        if (status.getFamily() == Status.Family.SUCCESSFUL) {
            eventSinkProvider.get().sendEvents();
        }
        else {
            log.debug("Request failed, skipping event sending, status={}", status);
        }
View Full Code Here

public class FailureExceptionMapper extends CandlepinExceptionMapper
    implements ExceptionMapper<Failure> {

    @Override
    public Response toResponse(Failure exception) {
        Status status = Response.Status.BAD_REQUEST;
        if (exception.getResponse() != null) {
            status = Response.Status.fromStatusCode(
                exception.getResponse().getStatus());
        }
        return getDefaultBuilder(exception, status, determineBestMediaType()).build();
View Full Code Here

public class JAXBUnmarshalExceptionMapper extends CandlepinExceptionMapper
    implements ExceptionMapper<JAXBUnmarshalException> {

    @Override
    public Response toResponse(JAXBUnmarshalException exception) {
        Status status = Response.Status.BAD_REQUEST;
        if (exception.getResponse() != null) {
            status = Response.Status.fromStatusCode(
                exception.getResponse().getStatus());
        }
        return getDefaultBuilder(exception, status, determineBestMediaType()).build();
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.Response.Status

Copyright © 2018 www.massapicom. 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.