2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.northbound.commons.exception;
11 import javax.ws.rs.WebApplicationException;
12 import javax.ws.rs.core.Response;
13 import javax.ws.rs.core.MediaType;
16 * Status Code 403 (Forbidden)
18 * The server understood the request, but is refusing to fulfill it.
19 * Authorization will not help and the request SHOULD NOT be repeated.
20 * If the request method was not HEAD and the server wishes to make public
21 * why the request has not been fulfilled, it SHOULD describe the reason
22 * for the refusal in the entity.
23 * If the server does not wish to make this information available to
24 * the client, the status code 404 (Not Found) can be used instead.
29 public class ResourceForbiddenException extends WebApplicationException {
30 private static final long serialVersionUID = 1L;
32 public ResourceForbiddenException(String string) {
33 super(Response.status(Response.Status.FORBIDDEN).entity(string).type(
34 MediaType.TEXT_PLAIN).build());