Sha256: 42a4b87f7bfc213be70ee4e5d24db8265393797d30c2de49673d60bb128c0203

Contents?: true

Size: 557 Bytes

Versions: 39

Compression:

Stored size: 557 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

39 entries across 24 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.4.5 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.4 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.4 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.3 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.3 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.2 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.4.2 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.3.0 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.3.0 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.2.0 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.2.0 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.14 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.14 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.13 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.13 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.12 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.12 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.11 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/ReferencesCache.js
javonet-ruby-sdk-2.1.11 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/ReferencesCache.js