forked from alephnaughty/MapLargeSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapLargeSDKTest.java
More file actions
53 lines (42 loc) · 1.9 KB
/
MapLargeSDKTest.java
File metadata and controls
53 lines (42 loc) · 1.9 KB
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
import com.maplarge.api.MapLargeConnector;
import java.util.HashMap;
import java.util.Map;
public class MapLargeSDKTest {
/***********************
* MAIN, FOR TESTING *
***********************/
public static void main(String[] args) {
//DEFAULT CREDENTIALS
String server = "http://server.maplarge.com/";
String user = "user@ml.com";
String pass = "pw123456";
int token = 123456789;
Map<String, String> params = new HashMap<String, String>();
//CREATE MAPLARGE CONNECTION WITH USER / PASSWORD
MapLargeConnector mlconnPassword = new MapLargeConnector(server, user, pass);
//CREATE MAPLARGE CONNECTION WITH USER / AUTH TOKEN
MapLargeConnector mlconnToken = new MapLargeConnector(server, user, token);
//CREATE TABLE SYNCHRONOUS (NO WEB CALL)
params.put("account", "test");
params.put("tablename", "testJavaSdkTable");
params.put("fileurl", "http://localhost/testfile.csv");
MapLargeConnector.NO_WEB_CALLS = true;
String response = mlconnPassword.InvokeAPIRequest("CreateTableSynchronous", params);
System.out.println(response);
MapLargeConnector.NO_WEB_CALLS = false;
//RETRIEVE REMOTE USER AUTH TOKEN
response = mlconnPassword.GetRemoteAuthToken(user, pass, "255.255.255.255");
System.out.println(response);
//LIST GROUPS
params.clear();
params.put("account", "test");
response = mlconnToken.InvokeAPIRequestPost("ListGroups", params);
System.out.println(response);
//CREATE TABLE WITH FILES SYNCHRONOUS
params.clear();
params.put("account", "test");
params.put("tablename", "PostedTableImport");
response = mlconnToken.InvokeAPIRequestPost("CreateTableWithFilesSynchronous", params, new String[] { "C:\\temp\\usa.csv" });
//System.out.println(response);
}
}