FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
Bucket agent validation, and usage functions. More...
#include "buckets.h"
Go to the source code of this file.
Functions | |
FUNCTION int | arrayAinB (int *arrayA, int *arrayB) |
Verify that all the values in array A are also in B. More... | |
FUNCTION int | intAinB (int intA, int *arrayB) |
Verify that all the value A is a member of array B. More... | |
FUNCTION int | validate_pk (PGconn *pgConn, char *sql) |
Verify a primary key exists. More... | |
FUNCTION void | Usage (char *Name) |
FUNCTION int | processed (PGconn *pgConn, int agent_pk, int nomos_agent_pk, int pfile_pk, int uploadtree_pk, int bucketpool_pk, int bucket_pk) |
Has this pfile or uploadtree_pk already been bucket processed? This only works if the bucket has been recorded in table bucket_file, or bucket_container. More... | |
FUNCTION int | UploadProcessed (PGconn *pgConn, int bucketagent_pk, int nomosagent_pk, int pfile_pk, int uploadtree_pk, int upload_pk, int bucketpool_pk) |
Has this upload already been bucket processed? This function checks buckets_ars to see if the upload has been processed. More... | |
Variables | |
int | debug |
Bucket agent validation, and usage functions.
Definition in file validate.c.
FUNCTION int arrayAinB | ( | int * | arrayA, |
int * | arrayB | ||
) |
Verify that all the values in array A are also in B.
arrayA | null terminated array of ints |
arrayB | null terminated array of ints |
Definition at line 24 of file validate.c.
FUNCTION int intAinB | ( | int | intA, |
int * | arrayB | ||
) |
Verify that all the value A is a member of array B.
intA | int to match |
arrayB | null terminated array of ints |
Definition at line 54 of file validate.c.
FUNCTION int processed | ( | PGconn * | pgConn, |
int | agent_pk, | ||
int | nomos_agent_pk, | ||
int | pfile_pk, | ||
int | uploadtree_pk, | ||
int | bucketpool_pk, | ||
int | bucket_pk | ||
) |
Has this pfile or uploadtree_pk already been bucket processed? This only works if the bucket has been recorded in table bucket_file, or bucket_container.
pgConn | postgresql connection |
agent_pk | bucket agent_pk |
nomos_agent_pk | nomos agent_pk |
pfile_pk | pfile id which was processed |
uploadtree_pk | upload tree id |
bucketpool_pk | bucket pool id |
bucket_pk | may be zero (to skip bucket_pk check) |
Definition at line 139 of file validate.c.
FUNCTION int UploadProcessed | ( | PGconn * | pgConn, |
int | bucketagent_pk, | ||
int | nomosagent_pk, | ||
int | pfile_pk, | ||
int | uploadtree_pk, | ||
int | upload_pk, | ||
int | bucketpool_pk | ||
) |
Has this upload already been bucket processed? This function checks buckets_ars to see if the upload has been processed.
pgConn | postgresql connection |
bucketagent_pk | bucket agent ID |
nomosagent_pk | nomos agent ID |
pfile_pk | |
uploadtree_pk | |
bucketpool_pk |
Definition at line 204 of file validate.c.
FUNCTION void Usage | ( | char * | Name | ) |
Print usage of bucket agent
Name | Absolute path of agent |
Definition at line 103 of file validate.c.
FUNCTION int validate_pk | ( | PGconn * | pgConn, |
char * | sql | ||
) |
Verify a primary key exists.
This works by running the sql (must be select) and returning the first column of the first row.
The sql should make this the primary key.
This could be used to simply return the first column of the first result for any query.
pgConn | Database connection object |
sql | sql must select a single column, value in first row is returned. |
Definition at line 84 of file validate.c.