diff options
Diffstat (limited to 'jar/src/main/java/org/onap/music/exceptions')
5 files changed, 0 insertions, 379 deletions
diff --git a/jar/src/main/java/org/onap/music/exceptions/MusicExceptionMapper.java b/jar/src/main/java/org/onap/music/exceptions/MusicExceptionMapper.java deleted file mode 100644 index 14a23d1f..00000000 --- a/jar/src/main/java/org/onap/music/exceptions/MusicExceptionMapper.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * ============LICENSE_START========================================== - * org.onap.music - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================= - * ==================================================================== - */ -package org.onap.music.exceptions; - -import java.io.EOFException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; - -import org.codehaus.jackson.map.exc.UnrecognizedPropertyException; -import org.onap.music.main.ResultType; -import org.onap.music.response.jsonobjects.JsonResponse; - -@Provider -public class MusicExceptionMapper implements ExceptionMapper<Exception> { - @Override - public Response toResponse(Exception exception) { - if(exception instanceof UnrecognizedPropertyException) { - return Response.status(Response.Status.BAD_REQUEST). - entity(new JsonResponse(ResultType.FAILURE).setError("Unknown field :"+((UnrecognizedPropertyException) exception).getUnrecognizedPropertyName()).toMap()). - build(); - } - else if(exception instanceof EOFException) { - return Response.status(Response.Status.BAD_REQUEST). - entity(new JsonResponse(ResultType.FAILURE).setError("Request body cannot be empty").toMap()). - build(); - } - else { - return Response.status(Response.Status.BAD_REQUEST). - entity(new JsonResponse(ResultType.FAILURE).setError(exception.getMessage()).toMap()). - build(); - } - } -} diff --git a/jar/src/main/java/org/onap/music/exceptions/MusicLockingException.java b/jar/src/main/java/org/onap/music/exceptions/MusicLockingException.java deleted file mode 100644 index 1a9e45d9..00000000 --- a/jar/src/main/java/org/onap/music/exceptions/MusicLockingException.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * ============LICENSE_START========================================== - * org.onap.music - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================= - * ==================================================================== - */ -package org.onap.music.exceptions; - -/** - * @author inam - * - */ -public class MusicLockingException extends Exception { - - /** - * - */ - public MusicLockingException() { - - } - - /** - * @param message - */ - public MusicLockingException(String message) { - super(message); - - } - - /** - * @param cause - */ - public MusicLockingException(Throwable cause) { - super(cause); - - } - - /** - * @param message - * @param cause - */ - public MusicLockingException(String message, Throwable cause) { - super(message, cause); - - } - - /** - * @param message - * @param cause - * @param enableSuppression - * @param writableStackTrace - */ - public MusicLockingException(String message, Throwable cause, boolean enableSuppression, - boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - - } - -} diff --git a/jar/src/main/java/org/onap/music/exceptions/MusicPolicyVoilationException.java b/jar/src/main/java/org/onap/music/exceptions/MusicPolicyVoilationException.java deleted file mode 100644 index bade21a4..00000000 --- a/jar/src/main/java/org/onap/music/exceptions/MusicPolicyVoilationException.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * ============LICENSE_START========================================== - * org.onap.music - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================= - * ==================================================================== - */ -package org.onap.music.exceptions; - -/** - * @author inam - * - */ -public class MusicPolicyVoilationException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * - */ - public MusicPolicyVoilationException() { - // TODO Auto-generated constructor stub - } - - /** - * @param message - */ - public MusicPolicyVoilationException(String message) { - super(message); - // TODO Auto-generated constructor stub - } - - /** - * @param cause - */ - public MusicPolicyVoilationException(Throwable cause) { - super(cause); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - */ - public MusicPolicyVoilationException(String message, Throwable cause) { - super(message, cause); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - * @param enableSuppression - * @param writableStackTrace - */ - public MusicPolicyVoilationException(String message, Throwable cause, boolean enableSuppression, - boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - // TODO Auto-generated constructor stub - } - -} diff --git a/jar/src/main/java/org/onap/music/exceptions/MusicQueryException.java b/jar/src/main/java/org/onap/music/exceptions/MusicQueryException.java deleted file mode 100644 index 24b8568b..00000000 --- a/jar/src/main/java/org/onap/music/exceptions/MusicQueryException.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * ============LICENSE_START========================================== - * org.onap.music - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================= - * ==================================================================== - */ -package org.onap.music.exceptions; - - - -/** - * @author inam - * - */ -public class MusicQueryException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1L; - private int errorCode; - - - /** - * - */ - public MusicQueryException() { - super(); - } - - /** - * @param message - */ - public MusicQueryException(String message) { - super(message); - } - - - - /** - * @param message - */ - public MusicQueryException(String message, int errorCode) { - super(message); - this.errorCode = errorCode; - } - - /** - * @param cause - */ - public MusicQueryException(Throwable cause) { - super(cause); - } - - /** - * @param message - * @param cause - */ - public MusicQueryException(String message, Throwable cause) { - super(message, cause); - } - - /** - * @param message - * @param cause - * @param enableSuppression - * @param writableStackTrace - */ - public MusicQueryException(String message, Throwable cause, boolean enableSuppression, - boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } - -} diff --git a/jar/src/main/java/org/onap/music/exceptions/MusicServiceException.java b/jar/src/main/java/org/onap/music/exceptions/MusicServiceException.java deleted file mode 100644 index a3b1fc56..00000000 --- a/jar/src/main/java/org/onap/music/exceptions/MusicServiceException.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * ============LICENSE_START========================================== - * org.onap.music - * =================================================================== - * Copyright (c) 2017 AT&T Intellectual Property - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============LICENSE_END============================================= - * ==================================================================== - */ - -package org.onap.music.exceptions; - -/** - * @author inam - * - */ -public class MusicServiceException extends Exception { - - - private int errorCode; - private String errorMessage; - - public int getErrorCode() { - return errorCode; - } - - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - } - - - public String getErrorMessage() { - return errorMessage; - } - - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - - public MusicServiceException() { - super(); - } - - - public MusicServiceException(String message) { - super(message); - - } - - - public MusicServiceException(Throwable cause) { - super(cause); - - } - - - public MusicServiceException(String message, Throwable cause) { - super(message, cause); - - } - - - public MusicServiceException(String message, Throwable cause, boolean enableSuppression, - boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - - } - -} |