Sha256: 0af83036acc67210afdd61de17ef0b5c6331adfb96c99d056219b5da41bacb76

Contents?: true

Size: 586 Bytes

Versions: 15

Compression:

Stored size: 586 Bytes

Contents

let _cache = {}
let _instance = null
const v4 = require('../../utils/uuid/v4')

class ReferencesCache {

    static getInstance() {
        if (_instance === null) {
            _instance = new ReferencesCache()
        }
        return _instance
    }

    cacheReference(reference) {
        let id = v4()
        _cache[id] = reference
        return id
    }

    resolveReference(id) {
        return _cache[id]
    }

    deleteReference(referenceGuid) {
        delete _cache[referenceGuid]
        return 0;
    }
}

module.exports = ReferencesCache

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/referenceCache/ReferencesCache.js
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/referenceCache/ReferencesCache.js
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/referenceCache/ReferencesCache.js
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/referenceCache/ReferencesCache.js
javonet-ruby-sdk-2.4.6 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/referenceCache/ReferencesCache.js
javonet-ruby-sdk-2.4.5 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.4 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.3 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.2 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.3.0 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.2.0 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.14 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.13 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.12 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.11 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/ReferencesCache.js