ARC SDK
|
Public Member Functions | |
bool | ReadAll (std::list< Job > &jobs, const std::list< std::string > &rejectEndpoints=std::list< std::string >()) |
Read all jobs from storage. More... | |
bool | Read (std::list< Job > &jobs, std::list< std::string > &jobIdentifiers, const std::list< std::string > &endpoints=std::list< std::string >(), const std::list< std::string > &rejectEndpoints=std::list< std::string >()) |
Read specified jobs. More... | |
bool | Write (const std::list< Job > &jobs, const std::set< std::string > &prunedServices, std::list< const Job * > &newJobs) |
Write jobs. More... | |
bool | Clean () |
Clean storage. More... | |
bool | Remove (const std::list< std::string > &jobids) |
Remove jobs. More... | |
![]() | |
JobInformationStorage (const std::string &name, unsigned nTries=10, unsigned tryInterval=500000) | |
Constructor. More... | |
virtual bool | Write (const std::list< Job > &jobs) |
Write jobs. More... | |
const std::string & | GetName () const |
Get name. More... | |
|
virtual |
Clean storage.
Invoking this method causes the storage to be cleaned of any jobs it holds.
true
is returned if the storage was successfully cleaned, otherwise false
is returned. Implements Arc::JobInformationStorage.
|
virtual |
Read specified jobs.
Read jobs specified by job identifiers and/or endpoints from storage. Only jobs which has a JobID or a Name attribute matching any of the items in the identifiers
list parameter, and also jobs for which the JobManagementURL
attribute matches any of those endpoints specified in the endpoints
list parameter, will be added to the list of Job objects reference to by the jobs
parameter, except those jobs for which the JobManagementURL
attribute matches any of those endpoints specified in the rejectEndpoints
list parameter. Identifiers specified in the jobIdentifiers
list parameter which matches a job in the storage will be removed from the referenced list. The algorithm used for matching should be equivalent to that used in the URL::StringMatches method.
jobs | reference to list of Job objects which will be filled with matching jobs. |
jobIdentifiers | specifies the job IDs and names of jobs to be added to the job list. Entries in this list is removed if they match a job from the storage. |
endpoints | is a list of strings specifying endpoints for which Job objects with the JobManagementURL attribute matching any of those endpoints will added to the job list. The algorithm used for matching should be equivalent to that used in the URL::StringMatches method. |
rejectEndpoints | is a list of strings specifying endpoints for which Job objects with the JobManagementURL attribute matching any of those endpoints will not be part of the retrieved jobs. The algorithm used for matching should be equivalent to that used in the URL::StringMatches method. |
false
is returned in case a job failed to be read from storage, otherwise true
is returned. This method will also return in case an identifier does not match any jobs in the storage. Implements Arc::JobInformationStorage.
|
virtual |
Read all jobs from storage.
Read all jobs contained in storage, except those managed by a service at an endpoint which matches any of those in the rejectEndpoints
list parameter. The read jobs are added to the list of Job objects referenced by the jobs
parameter. The algorithm used for matching should be equivalent to that used in the URL::StringMatches method.
jobs | is a reference to a list of Job objects, which will be filled with the jobs read from file (cleared before use). |
rejectEndpoints | is a list of strings specifying endpoints for which Job objects with JobManagementURL matching any of those endpoints will not be part of the retrieved jobs. The algorithm used for matching should be equivalent to that used in the URL::StringMatches method. |
true
is returned if all jobs contained in the storage was retrieved (except those rejected, if any), otherwise false. Implements Arc::JobInformationStorage.
|
virtual |
Remove jobs.
The jobs with matching job IDs (Job::JobID attribute) as specified with the list of job IDs (jobids
parameter) will be remove from the storage.
jobids | list job IDs for which matching jobs should be remove from storage. |
is
returned if any of the matching jobs failed to be removed from the storage, otherwise true
is returned. Implements Arc::JobInformationStorage.
|
virtual |
Write jobs.
Add jobs to storage. If there already exist a job with a specific job ID in the storage, and a job with the same job ID is tried added to the storage then the existing job will be overwritten. For jobs in the storage with a ServiceEndpointURL attribute where the host name is equal to any of the entries in the set referenced by the prunedServices
parameter, is removed from the storage, if they are not among the list of jobs referenced by the jobs
parameter. A pointer to jobs in the job list (jobs
) which does not already exist in the storage will be added to the list of Job object pointers referenced by the newJobs
parameter.
jobs | is the list of Job objects which should be added to the storage. |
prunedServices | is a set of host names of services whose jobs should be removed if not replaced. This is typically the list of host names for which at least one endpoint was successfully queried. By passing an empty set, all existing jobs are kept, even if jobs are outdated. |
newJobs | is a reference to a list of pointers to Job objects which are not duplicates. |
true
is returned if all jobs in the jobs
list are written to to storage, otherwise false
is returned. Implements Arc::JobInformationStorage.