aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
committerOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
commit1cfb08779ea0e00be69e072a940b3063e049fe6b (patch)
tree6602a900387c8393ed0dcd81c0539381632903c6 /vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
parent2f20b001b9243e0f8b44aecc768ec265fd538732 (diff)
org.onap migration
Change-Id: I52f0b2851f2c765752b6d21f49b32136d7d72a3d Issue-ID: VID-86 Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java')
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java100
1 files changed, 0 insertions, 100 deletions
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
deleted file mode 100644
index f82f474f..00000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.GetTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostCreateNewVnfWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostSubmitVnfChangeTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerUtil;
-import org.openecomp.vid.scheduler.RestObjects.GetTimeSlotsRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostCreateNewVnfRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostSubmitVnfChangeRestObject;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class SchedulerUtil {
-
- private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerUtil.class);
-
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- public static GetTimeSlotsWrapper getTimeSlotsWrapResponse (GetTimeSlotsRestObject<String> rs) {
-
- String resp_str = "";
- int status = 0;
-
- if ( rs != null ) {
- resp_str = rs.get();
- status = rs.getStatusCode();
- }
-
- GetTimeSlotsWrapper w = new GetTimeSlotsWrapper();
-
- w.setEntity(resp_str);
- w.setStatus (status);
-
- return (w);
- }
-
- public static PostSubmitVnfChangeTimeSlotsWrapper postSubmitNewVnfWrapResponse (PostSubmitVnfChangeRestObject<String> rs) {
-
- String resp_str = "";
- int status = 0;
- String uuid = "";
-
- if ( rs != null ) {
- resp_str = rs.get();
- status = rs.getStatusCode();
- uuid = rs.getUUID();
- }
-
- PostSubmitVnfChangeTimeSlotsWrapper w = new PostSubmitVnfChangeTimeSlotsWrapper();
-
- w.setEntity(resp_str);
- w.setStatus (status);
- w.setUuid(uuid);
-
- return (w);
- }
-
- public static PostCreateNewVnfWrapper postCreateNewVnfWrapResponse (PostCreateNewVnfRestObject<String> rs) {
-
- String resp_str = "";
- int status = 0;
- String uuid = "";
-
- if ( rs != null ) {
- resp_str = rs.get();
- status = rs.getStatusCode();
- uuid = rs.getUUID();
- }
-
- PostCreateNewVnfWrapper w = new PostCreateNewVnfWrapper();
-
- w.setEntity(resp_str);
- w.setStatus (status);
- w.setUuid(uuid);
-
- return (w);
- }
-
- public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-
- String methodName = "convertPojoToString";
- ObjectMapper mapper = new ObjectMapper();
- String r_json_str = "";
- if ( t != null ) {
- try {
- r_json_str = mapper.writeValueAsString(t);
- }
- catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse object as json");
- }
- }
- return (r_json_str);
- }
-
-}