C# Class Summer.Batch.Extra.IO.GdgResourceLoader

Resource loader that supports generation data groups (GDG) with the "gdg:" URI protocol. Other URIs or paths without protocol are delegated to ResourceLoader. Generation data groups are supported with the following syntax: gdg:path/to/file(<number>)[.<extension>] <number> refers to a file in the group. The latest version existing before the job is start is version 0. The previous one is -1, and so on. The version that has being written in the current job can be referenced with 1 (or +1). It is possible to limit the number of files in a group by using a setting named "gdg-options". This setting must be a string containing comma separated values with the following repeatable pattern: path/to/file.txt,limit=<limit>[,mode=<mode>] <limit> is the maximum number of files in the group and <mode> is either "empty" or "noempty". If no mode is specified, "noempty" is the default. In the "empty" mode, all previous files are moved when the limit is reached, whereas in "noempty" mode the oldest files are removed to keep the number of files at the limit.
Inheritance: Summer.Batch.Common.IO.ResourceLoader
Mostrar archivo Open project: SummerBatch/SummerBatch

Public Methods

Method Description
GdgResourceLoader ( Summer.Batch.Common.Settings.SettingsManager settings ) : System

Default constructor. Checks the options in the settings manager.

Protected Methods

Method Description
DoGetResources ( string path ) : IEnumerable

Resolves a single path to resources.

Private Methods

Method Description
GetGdgResource ( GdgPath path ) : IResource
GetGenerationNumber ( IResource resource ) : int
GetGenerationNumber ( IResource>.SortedDictionary resources ) : int
GetGenerationNumber ( string path ) : int
GetJobContext ( ) : ExecutionContext
GetPath ( string path ) : GdgPath
GetResource ( GdgPath path, int currentNumber ) : IResource
GetResources ( GdgPath path ) : IEnumerable
GetResourcesDictionary ( GdgPath path ) : IResource>.SortedDictionary
GetResourcesToDelete ( ) : IEnumerable
GetResourcesToDelete ( GdgPath path, GdgOptions options, IEnumerable resources ) : IEnumerable
ParseOptions ( ) : void
SaveGenerationNumber ( string path, int number ) : void

Method Details

DoGetResources() protected method

Resolves a single path to resources.
protected DoGetResources ( string path ) : IEnumerable
path string the path to resolve
return IEnumerable

GdgResourceLoader() public method

Default constructor. Checks the options in the settings manager.
public GdgResourceLoader ( Summer.Batch.Common.Settings.SettingsManager settings ) : System
settings Summer.Batch.Common.Settings.SettingsManager
return System