aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java
blob: 0179400dc0880c83d13993334de48a92e18c3716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package org.openecomp.vid.mso;

import org.apache.commons.io.IOUtils;
import org.json.JSONObject;
import org.json.JSONTokener;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.vid.changeManagement.ChangeManagementRequest;
import org.openecomp.vid.controller.VidController;
import org.openecomp.vid.mso.rest.RequestDetails;

import javax.ws.rs.client.Client;
import javax.ws.rs.core.MultivaluedHashMap;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 * Created by pickjonathan on 20/06/2017.
 */
public class MsoLocalClient implements MsoRestInterfaceIfc {

    /**
     * The logger.
     */
    EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoLocalClient.class);

    /**
     * The Constant dateFormat.
     */
    final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");

    /**
     * The client.
     */
    private static Client client = null;

    /**
     * The common headers.
     */
    private MultivaluedHashMap<String, Object> commonHeaders;

    /**
     * Instantiates a new mso rest interface.
     */
    public MsoLocalClient() {
        super();
    }

    public void initMsoClient() {
        final String methodname = "initRestClient()";
    }

    @Override
    public <T> void Get(T t, String sourceId, String path, RestObject<T> restObject) throws Exception {

    }

    @Override
    public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {

    }

    @Override
    public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
        initMsoClient();

        final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_create_instance_response.json");

        t = (T) IOUtils.toString(asdcServicesFile);
        restObject.setStatusCode(200);
        restObject.set(t);
    }

    @Override
    public void logRequest(RequestDetails r) {

    }

	@Override
	public <T> void Put(T t, ChangeManagementRequest r, String sourceID, String path, RestObject<T> restObject)
			throws Exception {
		
		
	}
}