Merge "Move adsal into its own subdirectory."
[controller.git] / opendaylight / adsal / northbound / commons / src / main / java / org / opendaylight / controller / northbound / commons / exception / ResourceConflictException.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 409 (Conflict)
17  *
18  * The request could not be completed due to a conflict with the
19  * current state of the resource. This code is only allowed in
20  * situations where it is expected that the user might be able to
21  * resolve the conflict and resubmit the request. The response body
22  * SHOULD include enough information for the user to recognize the
23  * source of the conflict. Ideally, the response entity would include
24  * enough information for the user or user agent to fix the problem;
25  * however, that might not be possible and is not required.
26  *
27  *
28  *
29  */
30 public class ResourceConflictException extends WebApplicationException {
31     private static final long serialVersionUID = 1L;
32
33     public ResourceConflictException(String string) {
34         super(Response.status(Response.Status.CONFLICT).entity(string).type(
35                 MediaType.TEXT_PLAIN).build());
36     }
37 }