Upgrade sonar plugin
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / mso / rest / MsoBusinessLogicNew.java
1 package org.openecomp.vid.mso.rest;
2
3 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
4 import org.openecomp.vid.mso.MsoClientFactory;
5 import org.openecomp.vid.mso.MsoInterface;
6 import org.openecomp.vid.mso.MsoResponseWrapper;
7
8 import java.text.DateFormat;
9 import java.text.SimpleDateFormat;
10 import java.util.Date;
11
12 /**
13  * Created by pickjonathan on 21/06/2017.
14  * This class was created only for testing the new logic.
15  * It is not used by any of the controllers binded to the ui.
16  * This can be deleted in the future in order to keep a cleaner project.
17  * If deleting please dont forget to delete the controllers, factory and all involved in the assert test.
18  */
19 public class MsoBusinessLogicNew {
20
21     /**
22      * \
23      * The MSO Client
24      */
25     private MsoInterface msoClient;
26
27     private MsoInterface msoRestTempClient;
28
29     /**
30      * The logger.
31      */
32     EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoBusinessLogicNew.class);
33
34     /**
35      * The Constant dateFormat.
36      */
37     final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
38
39     public MsoBusinessLogicNew() {
40         msoClient = MsoClientFactory.getInstance();
41         msoRestTempClient = new MsoRestClientNew();
42     }
43
44     public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception {
45         String methodName = "createSvcInstance ";
46         logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
47
48 //        String endpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
49 //
50 //        MsoResponseWrapper w = createInstance(msoRequest, p);
51
52         MsoResponseWrapper w = msoClient.createSvcInstance(msoRequest, "");
53
54         return w;
55     }
56
57
58     public MsoResponseWrapper createSvcInstanceRest(RequestDetails msoRequest) throws Exception {
59         String methodName = "createSvcInstance ";
60         logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
61
62
63         MsoResponseWrapper w = msoRestTempClient.createSvcInstance(msoRequest, "");
64
65         return w;
66     }
67 }