9a755597cb781e40417acab0eeb8244a874c2a7b
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / UnimplementedException.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 java.net.HttpURLConnection;
12 import javax.ws.rs.WebApplicationException;
13 import javax.ws.rs.core.MediaType;
14 import javax.ws.rs.core.Response;
15
16 /**
17  * Status Code 501 (Not Implemented Error)
18  *
19  * <p>
20  * The function is not implemented.
21  *
22  */
23 public class UnimplementedException extends WebApplicationException {
24     private static final long serialVersionUID = 1L;
25
26     /**
27      * Constructor for the NOT_IMPLEMENTED custom handler.
28      *
29      * @param string Error message to specify further the
30      *            SERVICE_UNAVAILABLE response
31      *
32      */
33     public UnimplementedException(String string) {
34         super(Response.status(HttpURLConnection.HTTP_NOT_IMPLEMENTED).entity(string).type(MediaType.TEXT_PLAIN)
35                 .build());
36     }
37 }