BUG 2302 : odl-clustering-test-app should not be part of the odl-restconf-all feature set
[controller.git] / opendaylight / adsal / northbound / commons / src / main / java / org / opendaylight / controller / northbound / commons / exception / ResourceForbiddenException.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.northbound.commons.exception;
10
11 import javax.ws.rs.WebApplicationException;
12 import javax.ws.rs.core.Response;
13 import javax.ws.rs.core.MediaType;
14
15 /**
16  * Status Code 403 (Forbidden)
17  *
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.
25  *
26  *
27  *
28  */
29 public class ResourceForbiddenException extends WebApplicationException {
30     private static final long serialVersionUID = 1L;
31
32     public ResourceForbiddenException(String string) {
33         super(Response.status(Response.Status.FORBIDDEN).entity(string).type(
34                 MediaType.TEXT_PLAIN).build());
35     }
36 }