Commit 97e0368a authored by Ryan Berkheimer's avatar Ryan Berkheimer

added methods for creation of rejection and record lists, and adding entries to these lists.

parent b772e2b8
Pipeline #5748 failed with stages
in 0 seconds
......@@ -1211,6 +1211,36 @@ void MessageApiEndpoint::setConditionListVal(struct condition *condition, struct
this->jvm->CallVoidMethod(condition->jcondition, this->setConditionValueMethodId, value->jlist);
}
struct record_list *MessageApiEndpoint::createRecordList()
{
jobject jList = this->jvm->NewObject(this->jArrayListClass, this->createJArrayListMethodId);
struct record_list *record_list = (struct record_list *)malloc(sizeof(struct record_list));
record_list->count = 0;
record_list->jrecords = jList;
return record_list;
}
void MessageApiEndpoint::addRecordEntry(struct record_list *record_list, struct record *record)
{
this->jvm->CallVoidMethod(record_list->jrecords, this->addJListItemMethodId, record->jrecord);
record_list->count += 1;
}
struct rejection_list *MessageApiEndpoint::createRejectionList()
{
jobject jList = this->jvm->NewObject(this->jArrayListClass, this->createJArrayListMethodId);
struct rejection_list *rejection_list = (struct rejection_list *)malloc(sizeof(struct rejection_list));
rejection_list->count = 0;
rejection_list->jrejections = jList;
return rejection_list;
}
void MessageApiEndpoint::addRejectionEntry(struct rejection_list *rejection_list, struct rejection *rejection)
{
this->jvm->CallVoidMethod(rejection_list->jrejections, this->addJListItemMethodId, rejection->jrejection);
rejection_list->count += 1;
}
struct val_list *MessageApiEndpoint::createList()
{
jobject jList = this->jvm->NewObject(this->jArrayListClass, this->createJArrayListMethodId);
......
......@@ -52,6 +52,8 @@ public:
struct record *getRecord(struct record_list *record_list, int index);
/*Record Methods*/
struct record_list *createRecordList();
void addRecordEntry(struct record_list *record_list, struct record *record);
struct record *getRecordCopy(struct record *record);
bool getRecordIsValid(struct record *record);
......@@ -65,6 +67,10 @@ public:
struct condition_list *getConditions(struct record *record);
struct condition *getCondition(struct record *record, const char *conditionId);
/*Rejection Methods*/
struct rejection_list *createRejectionList();
void addRejectionEntry(struct rejection_list *rejection_list, struct rejection *rejection);
/*Field Methods*/
const char *getFieldId(struct field *field);
const char *getFieldType(struct field *field);
......
......@@ -78,6 +78,16 @@ extern "C"
return reinterpret_cast<MessageApiEndpoint *>(message)->getRecords("getRecordsByClassifier", classifierKey, classifierValue);
}
struct record_list *createRecordList(jlong message)
{
return reinterpret_cast<MessageApiEndpoint *>(message)->createRecordList();
}
void addRecordEntry(jlong message, struct record_list *record_list, struct record *record)
{
return reinterpret_cast<MessageApiEndpoint *>(message)->addRecordEntry(record_list, record);
}
struct record *getRecord(jlong message, struct record_list *recordList, int recordIndex)
{
return reinterpret_cast<MessageApiEndpoint *>(message)->getRecord(recordList, recordIndex);
......@@ -489,6 +499,17 @@ extern "C"
return reinterpret_cast<MessageApiEndpoint *>(message)->addListEntry(list, val);
}
/*Rejection Utils*/
struct rejection_list *createRejectionList(jlong message)
{
return reinterpret_cast<MessageApiEndpoint *>(message)->createRejectionList();
}
void addRejectionEntry(jlong message, struct rejection_list *rejection_list, struct rejection *rejection)
{
return reinterpret_cast<MessageApiEndpoint *>(message)->addRejectionEntry(rejection_list, rejection);
}
/*Packet Utils*/
void addPacketRecord(jlong message, struct packet *packet, struct record *record)
{
......
......@@ -24,6 +24,9 @@ extern "C"
struct record *getRecord(jlong message, struct record_list *recordList, int recordIndex);
/*Record Methods*/
struct record_list *createRecordList(jlong message);
void addRecordEntry(jlong message, struct record_list *record_list, struct record *record);
struct record *getRecordCopy(jlong message, struct record *record);
bool getRecordIsValid(jlong message, struct record *record);
......@@ -37,6 +40,10 @@ extern "C"
struct condition *getCondition(jlong message, struct record *record, const char *conditionId);
bool hasCondition(jlong message, struct record *record, const char *conditionId);
/*Rejection Methods*/
struct rejection_list *createRejectionList(jlong message);
void addRejectionEntry(jlong message, struct rejection_list *rejection_list, struct rejection *rejection);
/*Field Methods*/
const char *getFieldId(jlong message, struct field *field);
const char * getFieldType(jlong message, struct field *field);
......
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