Commit 546cd603 authored by Ryan Berkheimer's avatar Ryan Berkheimer
Browse files

exposed missing getRecord method to C API for session lib. Rebuilt artifacts.

parent b45a0d60
Pipeline #5990 failed with stage
in 0 seconds
%% Cell type:code id: tags:
``` c
#include <stdio.h>
int main() {
printf("Hello world\n");
}
```
%%%% Output: stream
Hello world
%% Cell type:code id: tags:
``` c
//%cflags:-fPIC -std=c99 -I/home/messageapi/.messageapi/c/headers -I/usr/lib/jvm/java-11-openjdk-11.0.8.10-1.el7.x86_64/include -I/usr/lib/jvm/java-11-openjdk-11.0.8.10-1.el7.x86_64/include/linux -L/workspaces/messageapi/libs/test/c/session/so -lmessageapi
#include <jni.h>
#include <stdio.h>
#include "messageapi_structs.h"
#include "MessageApiSessionLib.h"
int main(int argc, char **argv)
int main()
{
puts("In our native session demo test!\n");
puts("Hello, World\n");
fflush(stdout);
session *session = createSession("/workspaces/messageapi/resources/test/file-reader-native/manifest.json");
puts("Successfully created session.");
fflush(stdout);
request *request1 = createRequest(session);
puts("Successfully created a request.");
fflush(stdout);
record *record1 = createRequestRecord(session, request1);
puts("Successfully created a request record.");
fflush(stdout);
field *field1 = getField(session, record1, "file-path");
puts("Successfully retrieved the file-path field from the request record.");
fflush(stdout);
setFieldStringVal(session, field1, "/workspaces/messageapi/resources/test/inputs/file-reader/simpletextfile");
puts(getFieldStringVal(session, field1));
fflush(stdout);
puts("Successfully set the field string value for the file-path field from the request record.");
fflush(stdout);
//record_list *session_records = createRecordList(session);
//addRecord(session, session_records, record1);
//setRequestRecords(session, request1, session_records);
//record *record2 = createRequestRecord(session, request1);
//field *field2 = getField(session, record2, "file-path");
//setFieldStringVal(session, field2, "/workspaces/messageapi/resources/test/inputs/file-reader/proc_sm_gtsnp_data_ftp_CF6_cf6_20190506.txt");
record_list *request_records = getRequestRecords(session, request1);
printf("Request record count: %d\n", request_records->count);
fflush(stdout);
response *response = submitRequest(session, request1);
puts("Response completion status right after submission:");
fputs(isComplete(session, response) ? "true" : "false", stdout);
puts("");
fflush(stdout);
puts("Successfully submitted the request.");
fflush(stdout);
puts(getFieldStringVal(session, field1));
fflush(stdout);
while (!isComplete(session, response)) {}
puts("Successfully returned from the request.");
fflush(stdout);
//puts(getFieldStringVal(session, field1));
//fflush(stdout);
record_list *response_records = getResponseRecords(session, response);
rejection_list *response_rejections = getResponseRejections(session, response);
printf("Record count: %d\n", response_records->count);
printf("Rejection count: %d\n", response_rejections->count);
printf("Record field count: %d\n", )
fflush(stdout);
releaseSession(session);
return 0;
}
```
%%%% Output: stream
In our native session demo test!
Hello, World
Successfully created session.
Successfully created a request.
Successfully created a request record.
Successfully retrieved the file-path field from the request record.
/workspaces/messageapi/resources/test/inputs/file-reader/simpletextfile
Successfully set the field string value for the file-path field from the request record.
Request record count: 1
Response completion status right after submission:
false
Successfully submitted the request.
/workspaces/messageapi/resources/test/inputs/file-reader/simpletextfile
Successfully returned from the request.
Record count: 7
Rejection count: 0
%% Cell type:code id: tags:
``` c
```
......
......@@ -47,7 +47,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
......@@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
......@@ -66,7 +66,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
......@@ -76,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 22,
"metadata": {},
"outputs": [
{
......@@ -85,7 +85,7 @@
"1"
]
},
"execution_count": 9,
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
......@@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
......@@ -105,7 +105,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 24,
"metadata": {},
"outputs": [
{
......@@ -114,7 +114,7 @@
"true"
]
},
"execution_count": 11,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
......@@ -125,7 +125,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 25,
"metadata": {},
"outputs": [
{
......@@ -134,7 +134,7 @@
"3"
]
},
"execution_count": 12,
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
......@@ -145,7 +145,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 26,
"metadata": {},
"outputs": [
{
......
......@@ -42,6 +42,7 @@ extern "C"
/*Record Methods*/
extern record_list *createRecordList(session *session);
extern void addRecord(session *session, record_list *record_list, record *record);
extern record *getRecord(session *session, record_list *record_list, int index);
extern record *getRecordCopy(session *session, record *record);
extern bool getRecordIsValid(session *session, record *record);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment