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 406 (Not Acceptable)
18 * The resource identified by the request is only capable of
19 * generating response entities which have content characteristics not
20 * acceptable according to the accept headers sent in the request.
25 public class NotAcceptableException extends WebApplicationException {
26 private static final long serialVersionUID = 1L;
28 public NotAcceptableException(String string) {
29 super(Response.status(Response.Status.NOT_ACCEPTABLE).entity(string)
30 .type(MediaType.TEXT_PLAIN).build());