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