5a075451277cfb50ca3be0b0a5ab95470284d98e
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / ResourceNotFoundException.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.neutron.northbound.api;
10
11 import javax.ws.rs.WebApplicationException;
12 import javax.ws.rs.core.MediaType;
13 import javax.ws.rs.core.Response;
14
15 /**
16  * Status Code 404 (Not Found)
17  *
18  * <p>
19  * The server has not found anything matching the Request-URI.
20  * No indication is given of whether the condition is temporary or permanent.
21  * The 410 (Gone) status code SHOULD be used if the server knows,
22  * through some internally configurable mechanism, that an old resource
23  * is permanently unavailable and has no forwarding address.
24  * This status code is commonly used when the server does not wish to
25  * reveal exactly why the request has been refused, or when no other
26  * response is applicable.
27  *
28  *
29  *
30  */
31 public class ResourceNotFoundException extends WebApplicationException {
32     private static final long serialVersionUID = 1L;
33
34     public ResourceNotFoundException(String string) {
35         super(Response.status(Response.Status.NOT_FOUND).entity(string).type(MediaType.TEXT_PLAIN).build());
36     }
37 }