ARC SDK
Public Member Functions | Static Public Member Functions
Arc::JobInformationStorageXML Class Reference
Inheritance diagram for Arc::JobInformationStorageXML:
Arc::JobInformationStorage

Public Member Functions

 JobInformationStorageXML (const std::string &name, unsigned nTries=10, unsigned tryInterval=500000)
 
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)
 Write 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...
 
- Public Member Functions inherited from Arc::JobInformationStorage
 JobInformationStorage (const std::string &name, unsigned nTries=10, unsigned tryInterval=500000)
 Constructor. More...
 
bool IsValid () const
 Check if storage is valid. More...
 
bool IsStorageExisting () const
 Check if storage exists. More...
 
const std::string & GetName () const
 Get name. More...
 

Static Public Member Functions

static JobInformationStorageInstance (const std::string &name)
 

Additional Inherited Members

- Static Public Attributes inherited from Arc::JobInformationStorage
static JobInformationStorageDescriptor AVAILABLE_TYPES []
 
- Protected Attributes inherited from Arc::JobInformationStorage
const std::string name
 
unsigned nTries
 
unsigned tryInterval
 
bool isValid
 
bool isStorageExisting
 

Member Function Documentation

◆ Clean()

bool Arc::JobInformationStorageXML::Clean ( )
virtual

Clean storage.

Invoking this method causes the storage to be cleaned of any jobs it holds.

Note
This method is abstract and an implementation must be provided by specialised classes.
Returns
true is returned if the storage was successfully cleaned, otherwise false is returned.

Implements Arc::JobInformationStorage.

◆ Read()

bool Arc::JobInformationStorageXML::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 >() 
)
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.

Note
This method is abstract and an implementation must be provided by specialised classes.
Parameters
jobsreference to list of Job objects which will be filled with matching jobs.
jobIdentifiersspecifies 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.
endpointsis 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.
rejectEndpointsis 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.
Returns
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.

◆ ReadAll()

bool Arc::JobInformationStorageXML::ReadAll ( std::list< Job > &  jobs,
const std::list< std::string > &  rejectEndpoints = std::list< std::string >() 
)
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.

Note
This method is abstract and an implementation must be provided by specialised classes.
Parameters
jobsis a reference to a list of Job objects, which will be filled with the jobs read from storage (cleared before use).
rejectEndpointsis 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.
Returns
true is returned if all jobs contained in the storage was retrieved (except those rejected, if any), otherwise false.

Implements Arc::JobInformationStorage.

◆ Remove()

bool Arc::JobInformationStorageXML::Remove ( const std::list< std::string > &  jobids)
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.

Note
This method is abstract and an implementation must be provided by specialised classes.
Parameters
jobidslist job IDs for which matching jobs should be remove from storage.
Returns
is returned if any of the matching jobs failed to be removed from the storage, otherwise true is returned.

Implements Arc::JobInformationStorage.

◆ Write() [1/2]

bool Arc::JobInformationStorageXML::Write ( const std::list< Job > &  jobs)
inlinevirtual

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.

A specialised implementaion does not necessarily need to be provided. If not provided Write(const std::list<Job>&, std::set<std::string>&, std::list<const Job*>&) will be used.

Parameters
jobsis the list of Job objects which should be added to the storage.
Returns
true is returned if all jobs in the jobs list are written to to storage, otherwise false is returned.
See also
Write(const std::list<Job>&, std::set<std::string>&, std::list<const Job*>&)

Reimplemented from Arc::JobInformationStorage.

◆ Write() [2/2]

bool Arc::JobInformationStorageXML::Write ( const std::list< Job > &  jobs,
const std::set< std::string > &  prunedServices,
std::list< const Job *> &  newJobs 
)
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.

Note
This method is abstract and an implementation must be provided by specialised classes.
Parameters
jobsis the list of Job objects which should be added to the storage.
prunedServicesis 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.
newJobsis a reference to a list of pointers to Job objects which are not duplicates.
Returns
true is returned if all jobs in the jobs list are written to to storage, otherwise false is returned.

Implements Arc::JobInformationStorage.


The documentation for this class was generated from the following file: