2 * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. 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.aaa.idm.model;
13 * @author peter.mellquist@hp.com
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
19 import javax.xml.bind.annotation.XmlRootElement;
20 import javax.ws.rs.core.Response;
22 @XmlRootElement(name = "idmerror")
23 public class IDMError{
24 private static Logger logger = LoggerFactory.getLogger(IDMError.class);
26 private String message;
27 private String details;
33 public IDMError(int statusCode, String msg, String msgDetails) {
39 public String getMessage() {
43 public void setMessage(String msg) {
47 public String getDetails() {
51 public void setDetails(String details) {
55 public Response response() {
56 logger.error("error: " + this.message + " details: " + this.details + " status: " + code);
57 return Response.status(this.code).entity(this).build();