From a42de79292d9541db7865b54e93be2d0b6e6a094 Mon Sep 17 00:00:00 2001 From: "serena.spinoso" Date: Thu, 7 Sep 2017 10:22:39 +0200 Subject: update verigraph JIRA: PARSER-154 code optimizations about graph manipulation and formula generation. Change-Id: Idebef19b128281aa2bc40d1aeab6e208c7ddd93d Signed-off-by: serena.spinoso --- .../verify/exception/BadRequestException.java | 23 ----------------- .../exception/BadRequestExceptionMapper.java | 30 ---------------------- .../verify/exception/DataNotFoundException.java | 23 ----------------- .../exception/DataNotFoundExceptionMapper.java | 30 ---------------------- .../verify/exception/ForbiddenException.java | 23 ----------------- .../verify/exception/ForbiddenExceptionMapper.java | 30 ---------------------- .../verify/exception/GenericExceptionMapper.java | 29 --------------------- .../exception/InternalServerErrorException.java | 23 ----------------- .../InternalServerErrorExceptionMapper.java | 30 ---------------------- 9 files changed, 241 deletions(-) delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestException.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/BadRequestExceptionMapper.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundException.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/DataNotFoundExceptionMapper.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenException.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/ForbiddenExceptionMapper.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/GenericExceptionMapper.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorException.java delete mode 100644 verigraph/src/main/java/it/polito/escape/verify/exception/InternalServerErrorExceptionMapper.java (limited to 'verigraph/src/main/java/it/polito/escape/verify/exception') 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 { - - @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 { - - @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 { - - @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 { - - @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 { - - @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(); - } - -} -- cgit 1.2.3-korg