The DefinitionCache uses a series of caching layers, both local storage and in memory storage, to make reading definition objects fast.
The DefinitionCache also periodically checks for new minor versions of a definition file and loads it into memory when avaliable.
The DefintionCache stores one instance of each definition object, and returns that instance when asked, which makes it really fast once stored in cache. The downside of this method is, if you make changes to that instance, that change will be seen throughout your applicaiton. Users can avoid this by making a clone copy of the instance, if they really need to make a change.
Example usage:
var setName = SetName.Parse( "v1.0:ntparc:Three-Position Air Rifle Type" );
var airRifleTypeDefinition = await DefinitionCache.GetAttributeDefinitionAsync( setName );
public static class DefinitionCache| ClearCache | Clears all cached responses from the DefinitionCache. |
| DownloadNewMinorVersionIfAvaliableAsync(Attribute) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(CourseOfFire) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(Definition) | Checks if the passed in defintion has a new minor versino avaliable from the REST API. If true downloads it into memory in the background. |
| DownloadNewMinorVersionIfAvaliableAsync(EventAndStageStyleMapping) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(EventStyle) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(RankingRule) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(ResultListFormat) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(ScoreFormatCollection) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(StageStyle) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(Target) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| DownloadNewMinorVersionIfAvaliableAsync(TargetCollection) | Method checks to see if there is a new minor release avaliable for the past in Definition. If so, it tries and download it and update the cache. |
| GetAttributeDefinitionAsync | |
| GetCacheSize | Effectively for unit testing only. Returns the number of definitions in the cache |
| GetCourseOfFireDefinitionAsync | |
| GetDefinitionAsync | |
| GetEventAndStageStyleMappingDefinitionAsync | |
| GetEventStyleDefinitionAsync | |
| GetRankingRuleDefinitionAsync | |
| GetResultListFormatDefinitionAsync | |
| GetScoreFormatCollectionDefinitionAsync | |
| GetStageStyleDefinitionAsync | |
| GetTargetCollectionDefinitionAsync | |
| GetTargetDefinitionAsync | |
| PreLoadAsync | Preloads the Definiiton Cache with commmon definitions. If used, should help with some start up time. |
| TryGetAttributeDefinition | Tries and returns the Attribute requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetCourseOfFireDefinition | Tries and returns the CourseOfFire requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetEventAndStageStyleMappingDefinition | Tries and returns the EVENT AND STAGE STYLE MAPPING requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetEventStyleDefinition | Tries and returns the EVENT STYLE requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetRankingRuleDefinition | Tries and returns the RANKING RULE requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetResultListFormatDefinition | Tries and returns the RESULT LIST FORMAT requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetScoreFormatCollectionDefinition | Tries and returns the SCORE FORMAT COLLECTION requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetStageStyleDefinition | Tries and returns the STAGE STYLE requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetTargetCollectionDefinition | Tries and returns the TARGET COLLECTION requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| TryGetTargetDefinition | Tries and returns the TARGET requested, if it has already been loaded into the cache. Returns false, if it has not been loaded yet. Then tries and reads or downloads it in the background. Which means the definition may be avalaible at a latter time (once the getting is successful). |
| AutoDownloadNewDefinitionVersions |
Set to true, to allow the Definition Cache to automatically check, and if avaliable, downlaod newer minor versions of Definition Files.
The runtime.Initializer has the same property .AutoDownloadNewDefinitionVersions, as an easier facade to set / unset. |