OpenDaylight Controller functional modules.
[controller.git] / opendaylight / northbound / commons / src / main / java / org / opendaylight / controller / northbound / commons / exception / MethodNotAllowedException.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 405 (Method Not Allowed)
17  *
18  * The method specified in the Request-Line is not allowed for the
19  * resource identified by the Request-URI. The response MUST include
20  * an Allow header containing a list of valid methods for the
21  * requested resource.
22  *
23  *
24  *
25  */
26 public class MethodNotAllowedException extends WebApplicationException {
27     private static final long serialVersionUID = 1L;
28
29     public MethodNotAllowedException(String string) {
30         super(Response.status(new MethodNotAllowed()).entity(string).type(
31                 MediaType.TEXT_PLAIN).build());
32     }
33 }