Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ryan Berkheimer
messageapi
Commits
546cd603
Commit
546cd603
authored
Oct 06, 2020
by
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
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dist/artifacts/c/messageapi_1_0_0/messageapi.tar
View file @
546cd603
No preview for this file type
dist/artifacts/java/messageapi_1_0_0/messageapi.tar
View file @
546cd603
No preview for this file type
dist/docs/api/messageapi_docs.tar
View file @
546cd603
No preview for this file type
resources/demo/notebooks/C_Demo.ipynb
View file @
546cd603
%% 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
```
...
...
resources/demo/notebooks/Java_Demo.ipynb
View file @
546cd603
...
...
@@ -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":
1
2,
"execution_count": 2
5
,
"metadata": {},
"outputs": [
{
...
...
@@ -134,7 +134,7 @@
"3"
]
},
"execution_count":
1
2,
"execution_count": 2
5
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -145,7 +145,7 @@
},
{
"cell_type": "code",
"execution_count":
13
,
"execution_count":
26
,
"metadata": {},
"outputs": [
{
...
...
src/cpp/main/libs/session/MessageApiSessionLib.h
View file @
546cd603
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment