From 3b538606bceeb0c5b66ce102e001ff9b3802d06e Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Fri, 16 Feb 2018 10:28:16 +0530 Subject: Improve code reliability Issue-ID: VFC-764 Change-Id: Ie2319959be8ebb28025f1c99abdd231fba96f0a3 Signed-off-by: Kanagaraj Manickam k00365106 --- .../common/util/restclient/ExceptionArgs.java | 15 +++++++--- .../common/util/restclient/HttpsRest.java | 4 +++ .../common/util/restclient/ServiceException.java | 32 +++++++++++----------- 3 files changed, 31 insertions(+), 20 deletions(-) (limited to 'ResmanagementService') diff --git a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ExceptionArgs.java b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ExceptionArgs.java index 89b1b0a..46c3d84 100644 --- a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ExceptionArgs.java +++ b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ExceptionArgs.java @@ -16,16 +16,23 @@ package org.onap.vfc.nfvo.resmanagement.common.util.restclient; +import java.io.Serializable; + /** * ROA exception handling parameters. *
*

*

- * + * * @author * @version 28-May-2016 */ -public class ExceptionArgs { +public class ExceptionArgs implements Serializable{ + + /** + * + */ + private static final long serialVersionUID = -6567319637044813966L; /** * Exception descriptions. @@ -51,7 +58,7 @@ public class ExceptionArgs { * Constructor
*

*

- * + * * @since */ public ExceptionArgs() { @@ -62,7 +69,7 @@ public class ExceptionArgs { * Constructor
*

*

- * + * * @since * @param descArgs: descriptions. * @param reasonArgs: reasons. diff --git a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/HttpsRest.java b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/HttpsRest.java index e8fa42a..66b8f5f 100644 --- a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/HttpsRest.java +++ b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/HttpsRest.java @@ -230,6 +230,8 @@ public class HttpsRest extends HttpBaseRest { } } catch(InterruptedException e) { LOG.error("InterruptedException", e); + // Restore interrupted state... + Thread.currentThread().interrupt(); } catch(UnsupportedEncodingException e) { LOG.error("UnsupportedEncodingException", e); } @@ -280,6 +282,8 @@ public class HttpsRest extends HttpBaseRest { } } catch(InterruptedException e) { LOG.error("InterruptedException", e); + // Restore interrupted state... + Thread.currentThread().interrupt(); } catch(UnsupportedEncodingException e) { LOG.error("InterruptedException", e); } diff --git a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ServiceException.java b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ServiceException.java index 0f6d843..b57c34d 100644 --- a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ServiceException.java +++ b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/common/util/restclient/ServiceException.java @@ -22,7 +22,7 @@ import java.text.MessageFormat; * The base class for all common exception.
*

*

- * + * * @author * @version 28-May-2016 */ @@ -43,7 +43,7 @@ public class ServiceException extends Exception { */ private String id = DEFAULT_ID; - private Object[] args = null; + private Object[] args = null; // NOSONAR private int httpCode = 500; @@ -54,7 +54,7 @@ public class ServiceException extends Exception { *

* This method is only used as deserialized, in other cases, use parameterized constructor. *

- * + * * @since */ public ServiceException() { @@ -65,7 +65,7 @@ public class ServiceException extends Exception { * Constructor
*

*

- * + * * @since * @param id: details. * @param cause: reason. @@ -79,7 +79,7 @@ public class ServiceException extends Exception { * Constructor
*

*

- * + * * @since * @param message: details. */ @@ -91,7 +91,7 @@ public class ServiceException extends Exception { * Constructor
*

*

- * + * * @since * @param id: exception id. * @param message: details. @@ -105,7 +105,7 @@ public class ServiceException extends Exception { * Constructor
*

*

- * + * * @since * @param id: exception id. * @param httpCode: http status code. @@ -121,7 +121,7 @@ public class ServiceException extends Exception { *

* the exception include the httpcode and message. *

- * + * * @since * @param httpCode http code. * @param message details. @@ -135,7 +135,7 @@ public class ServiceException extends Exception { * Constructor
*

*

- * + * * @since * @param id: exception id. * @param httpCode: http code. @@ -153,7 +153,7 @@ public class ServiceException extends Exception { *

* Have a placeholder exception, use args formatted message. *

- * + * * @since * @param id: exception id. * @param message: details. @@ -170,7 +170,7 @@ public class ServiceException extends Exception { *

* Have a placeholder exception, use args formatted message *

- * + * * @since * @param id: exception id. * @param message: details. @@ -187,7 +187,7 @@ public class ServiceException extends Exception { * Constructor
*

*

- * + * * @since * @param id: exception id. * @param message: details. @@ -202,7 +202,7 @@ public class ServiceException extends Exception { * Constructor
*

*

- * + * * @since * @param cause: reason. */ @@ -212,7 +212,7 @@ public class ServiceException extends Exception { /** * Get exceptoin id.
- * + * * @return * @since */ @@ -237,7 +237,7 @@ public class ServiceException extends Exception { /** * Obtain the ROA exception handling framework parameters
- * + * * @return exception args. * @since */ @@ -251,7 +251,7 @@ public class ServiceException extends Exception { /** * Gets the parameter information
- * + * * @return parameter list. * @since */ -- cgit 1.2.3-korg