diff options
author | julien zhang <zhang.jun3g@zte.com.cn> | 2017-09-12 14:47:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-09-12 14:47:37 +0000 |
commit | 8153ff1bac0ec3664c777302396698e4fb5f34b9 (patch) | |
tree | 2b97892774e3ced5f0c10e400657d28f9222749b /verigraph/src/main/java/it/polito/escape/verify/exception | |
parent | 96de9387460091e7cf0dc5fde1afaa637a8b2b79 (diff) | |
parent | a42de79292d9541db7865b54e93be2d0b6e6a094 (diff) |
Merge "update verigraph"
Diffstat (limited to 'verigraph/src/main/java/it/polito/escape/verify/exception')
9 files changed, 0 insertions, 241 deletions
diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestException.java b/verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestException.java deleted file mode 100644 index abbdbf0..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestException.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -public class BadRequestException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = -548472179073745084L; - - public BadRequestException(String message) { - super(message); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestExceptionMapper.java b/verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestExceptionMapper.java deleted file mode 100644 index 8f1ba9c..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestExceptionMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - -import it.polito.escape.verify.model.ErrorMessage; - -@Provider -public class BadRequestExceptionMapper implements ExceptionMapper<BadRequestException> { - - @Override - public Response toResponse(BadRequestException exception) { - ErrorMessage errorMessage = new ErrorMessage( exception.getMessage(), - 400, - "http://localhost:8080/verify/api-docs/"); - return Response.status(Status.BAD_REQUEST).entity(errorMessage).build(); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundException.java b/verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundException.java deleted file mode 100644 index 5cd1806..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundException.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -public class DataNotFoundException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = -6012364193903183208L; - - public DataNotFoundException(String message) { - super(message); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundExceptionMapper.java b/verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundExceptionMapper.java deleted file mode 100644 index 62e3556..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundExceptionMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - -import it.polito.escape.verify.model.ErrorMessage; - -@Provider -public class DataNotFoundExceptionMapper implements ExceptionMapper<DataNotFoundException> { - - @Override - public Response toResponse(DataNotFoundException exception) { - ErrorMessage errorMessage = new ErrorMessage( exception.getMessage(), - 404, - "http://localhost:8080/verify/api-docs/"); - return Response.status(Status.NOT_FOUND).entity(errorMessage).build(); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenException.java b/verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenException.java deleted file mode 100644 index dc79e97..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenException.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -public class ForbiddenException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = -4658914972167044321L; - - public ForbiddenException(String message) { - super(message); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenExceptionMapper.java b/verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenExceptionMapper.java deleted file mode 100644 index d060b8b..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenExceptionMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - -import it.polito.escape.verify.model.ErrorMessage; - -@Provider -public class ForbiddenExceptionMapper implements ExceptionMapper<ForbiddenException> { - - @Override - public Response toResponse(ForbiddenException exception) { - ErrorMessage errorMessage = new ErrorMessage( exception.getMessage(), - 403, - "http://localhost:8080/verify/api-docs/"); - return Response.status(Status.FORBIDDEN).entity(errorMessage).build(); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/GenericExceptionMapper.java b/verigraph/src/main/java/it/polito/escape/verify/exception/GenericExceptionMapper.java deleted file mode 100644 index 96f7caa..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/GenericExceptionMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; - -import it.polito.escape.verify.model.ErrorMessage; - -// @Provider -public class GenericExceptionMapper implements ExceptionMapper<Throwable> { - - @Override - public Response toResponse(Throwable exception) { - ErrorMessage errorMessage = new ErrorMessage("Generic exception: " + exception.getMessage(), - 500, - "http://localhost:8080/verify/api-docs/"); - return Response.status(Status.INTERNAL_SERVER_ERROR).entity(errorMessage).build(); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorException.java b/verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorException.java deleted file mode 100644 index 877edb5..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorException.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -public class InternalServerErrorException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 156815197709461502L; - - public InternalServerErrorException(String message) { - super(message); - } - -} diff --git a/verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorExceptionMapper.java b/verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorExceptionMapper.java deleted file mode 100644 index 02b6765..0000000 --- a/verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorExceptionMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Politecnico di Torino and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Apache License, Version 2.0 - * which accompanies this distribution, and is available at - * http://www.apache.org/licenses/LICENSE-2.0 - *******************************************************************************/ - -package it.polito.escape.verify.exception; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - -import it.polito.escape.verify.model.ErrorMessage; - -@Provider -public class InternalServerErrorExceptionMapper implements ExceptionMapper<InternalServerErrorException> { - - @Override - public Response toResponse(InternalServerErrorException exception) { - ErrorMessage errorMessage = new ErrorMessage( exception.getMessage(), - 500, - "http://localhost:8080/verify/api-docs/"); - return Response.status(Status.INTERNAL_SERVER_ERROR).entity(errorMessage).build(); - } - -} |