abddc94bee89db087f55ebc41cd6cb9a0bf6824d
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / ServiceUnavailableException.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 503 (Service Unavailable Error)
17  *
18  * <p>
19  * The server is currently unable to handle the request due to a temporary
20  * overloading or maintenance of the server.
21  * The implication is that this is a temporary condition which will be alleviated
22  * after some delay.
23  *
24  *
25  */
26 public class ServiceUnavailableException extends WebApplicationException {
27     private static final long serialVersionUID = 1L;
28
29     /**
30      * Constructor for the SERVICE_UNAVAILABLE custom handler.
31      *
32      * @param string Error message to specify further the
33      *            SERVICE_UNAVAILABLE response
34      *
35      */
36     public ServiceUnavailableException(String string) {
37         super(Response.status(Response.Status.SERVICE_UNAVAILABLE).entity(string).type(MediaType.TEXT_PLAIN).build());
38     }
39 }