2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.northbound.commons.exception;
11 import javax.ws.rs.WebApplicationException;
12 import javax.ws.rs.core.Response;
13 import javax.ws.rs.core.MediaType;
16 * Status Code 409 (Conflict)
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.
30 public class ResourceConflictException extends WebApplicationException {
31 private static final long serialVersionUID = 1L;
33 public ResourceConflictException(String string) {
34 super(Response.status(Response.Status.CONFLICT).entity(string).type(
35 MediaType.TEXT_PLAIN).build());