// Path: src/java/tmf/org/dsmapi/tt/service/JsonFault.java
// @XmlRootElement
// @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
// public class JsonFault {
// 
//     private ExceptionBean error;
//     private String detail;
// 
//     public JsonFault(ExceptionBean error) {
//         this.error = error;
//     }
// 
//     public JsonFault(ExceptionBean error, String detail) {
//         this.error = error;
//         this.detail = detail;
//     }   
// 
//     /**
//      * @return the type
//      */
//     public ExceptionBean getError() {
//         return error;
//     }
// 
//     /**
//      * @param type the type to set
//      */
//     public void setError(ExceptionBean error) {
//         this.error = error;
//     }
// 
//     /**
//      * @return the detail
//      */
//     public String getDetail() {
//         return detail;
//     }
// 
//     /**
//      * @param detail the detail to set
//      */
//     public void setDetail(String detail) {
//         this.detail = detail;
//     }
// 
// }
// 
// Path: src/java/tmf/org/dsmapi/commons/exceptions/UnknownResourceException.java
// public class UnknownResourceException extends FunctionalException {
//     
//     public UnknownResourceException(ExceptionType type) {
//         super(type);
//     }
//     
//     public UnknownResourceException(ExceptionType type, String message) {
//         super(type, message);
//     }     
//     
// }


import tmf.org.dsmapi.tt.service.JsonFault;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import tmf.org.dsmapi.commons.exceptions.UnknownResourceException;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tmf.org.dsmapi.tt.service.mapper;


@Provider
public class UnknowResourceExceptionMapper implements ExceptionMapper<UnknownResourceException> {
    @Override
    public Response toResponse(UnknownResourceException ex) {
// Path: src/java/tmf/org/dsmapi/tt/service/JsonFault.java
// @XmlRootElement
// @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
// public class JsonFault {
// 
//     private ExceptionBean error;
//     private String detail;
// 
//     public JsonFault(ExceptionBean error) {
//         this.error = error;
//     }
// 
//     public JsonFault(ExceptionBean error, String detail) {
//         this.error = error;
//         this.detail = detail;
//     }   
// 
//     /**
//      * @return the type
//      */
//     public ExceptionBean getError() {
//         return error;
//     }
// 
//     /**
//      * @param type the type to set
//      */
//     public void setError(ExceptionBean error) {
//         this.error = error;
//     }
// 
//     /**
//      * @return the detail
//      */
//     public String getDetail() {
//         return detail;
//     }
// 
//     /**
//      * @param detail the detail to set
//      */
//     public void setDetail(String detail) {
//         this.detail = detail;
//     }
// 
// }
// 
// Path: src/java/tmf/org/dsmapi/commons/exceptions/UnknownResourceException.java
// public class UnknownResourceException extends FunctionalException {
//     
//     public UnknownResourceException(ExceptionType type) {
//         super(type);
//     }
//     
//     public UnknownResourceException(ExceptionType type, String message) {
//         super(type, message);
//     }     
//     
// }


// Path: src/java/tmf/org/dsmapi/tt/service/mapper/UnknowResourceExceptionMapper.java
import tmf.org.dsmapi.tt.service.JsonFault;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import tmf.org.dsmapi.commons.exceptions.UnknownResourceException;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tmf.org.dsmapi.tt.service.mapper;


@Provider
public class UnknowResourceExceptionMapper implements ExceptionMapper<UnknownResourceException> {
    @Override
    public Response toResponse(UnknownResourceException ex) {
        JsonFault error = new JsonFault(ex.getType().getInfo(),ex.getMessage());