BUG-2218: Keep existing link augmentations during discovery process
[controller.git] / opendaylight / northbound / commons / src / main / java / org / opendaylight / controller / northbound / commons / exception / UnauthorizedException.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 401 (Unauthorized)
17  *
18  * The request requires user authentication. The response MUST include
19  * a WWW-Authenticate header field (section 14.47) containing a
20  * challenge applicable to the requested resource.
21  *
22  *
23  *
24  */
25 public class UnauthorizedException extends WebApplicationException {
26     private static final long serialVersionUID = 1L;
27
28     public UnauthorizedException(String string) {
29         super(Response.status(Response.Status.UNAUTHORIZED).entity(string)
30                 .type(MediaType.TEXT_PLAIN).build());
31     }
32 }