RevisionGuard constructor
@param {Object} store   The store object.
@param {Object} options The options object.
@constructor
552867
function RevisionGuard (store, options) {
  options = options || {};

  var defaults = {
    queueTimeout: 1000,
    queueTimeoutMaxLoops: 3//,
    // startRevisionNumber: 1
  };

  _.defaults(options, defaults);

  this.options = options;

  if (!store || !_.isObject(store)) {
    var err = new Error('store not injected!');
    debug(err);
    throw err;
  }

  this.store = store;

  this.definition = {
    correlationId: 'correlationId', // optional
    id: 'id',                       // optional
    name: 'name',                   // optional
//    aggregateId: 'aggregate.id',    // optional
//    context: 'context.name',        // optional
//    aggregate: 'aggregate.name',    // optional
    payload: 'payload'              // optional
//    revision: 'revision'            // optional
//    version: 'version',             // optional
//    meta: 'meta'                    // optional, if defined theses values will be copied to the notification (can be used to transport information like userId, etc..)
  };

  this.queue = new Queue({ queueTimeout: this.options.queueTimeout });

  this.currentHandlingRevisions = {};

  this.onEventMissing(function (info, evt) {
    debug('missing events: ', info, evt);
  });
}
515043
function(options, logger, LevelController) {
    this.config = null;
    this.options = options;
    this.logger = logger;
    this.LevelController = LevelController;
}
993425
function QuestionsStore(options) {
  debug('initializing from <%s>', __filename);
  Cache.call(this, options);
  this.createStores(this, this.options);
  this.listen(this);
}
474800
function (callback) {

    var self = this;

    var warnings = null;

    async.series([
      // load saga files...
      function (callback) {
        if (self.options.sagaPath === '') {
          self.sagas = {};
          debug('empty sagaPath defined so no sagas will be loaded...');
          return callback(null);
        }
        debug('load saga files...');
        self.structureLoader(self.options.sagaPath, function (err, sagas, warns) {
          if (err) {
            return callback(err);
          }
          warnings = warns;
          self.sagas = attachLookupFunctions(sagas);
          callback(null);
        });
      },

      // prepare infrastructure...
      function (callback) {
        debug('prepare infrastructure...');
        async.parallel([

          // prepare sagaStore...
          function (callback) {
            debug('prepare sagaStore...');

            self.sagaStore.on('connect', function () {
              self.emit('connect');
            });

            self.sagaStore.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.sagaStore.connect(callback);
          },

          // prepare revisionGuard...
          function (callback) {
            debug('prepare revisionGuard...');
            if (!self.revisionGuardStore) {
              return callback(null);
            }

            self.revisionGuardStore.on('connect', function () {
              self.emit('connect');
            });

            self.revisionGuardStore.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.revisionGuardStore.connect(callback);
          }
        ], callback);
      },

      // inject all needed dependencies...
      function (callback) {
        debug('inject all needed dependencies...');

        if (self.revisionGuardStore) {
          self.revisionGuard = new RevisionGuard(self.revisionGuardStore, self.options.revisionGuard);
          self.revisionGuard.onEventMissing(function (info, evt) {
            self.onEventMissingHandle(info, evt);
          });
        }

        if (self.options.sagaPath !== '') {
          self.eventDispatcher = new EventDispatcher(self.sagas, self.definitions.event);
          self.sagas.defineOptions({}) // options???
            .defineCommand(self.definitions.command)
            .defineEvent(self.definitions.event)
            .idGenerator(self.getNewId)
            .useSagaStore(self.sagaStore);
        }

        if (self.revisionGuardStore) {
          self.revisionGuard.defineEvent(self.definitions.event);
        }

        callback(null);
      }
    ], function (err) {
      if (err) {
        debug(err);
      }
      if (callback) { callback(err, warnings); }
    });
  }
1118126
function StoragePlugin(options) {

    var merge       = merge || require('utils/merge');
    var Collection  = Collection || require('utils/collection');
    var uuid        = uuid || require('vendor/uuid');


    var self = {
        'options' : {
            'bucket': 'default'
        }
    };

    var bucketInstance = {};
    var storage     = null;

    var entities    = {}, collections = {}; // entities & collections (data) objects
    var keywords    = ['not null']; // TODO - null, exists


    var proto = {
        'bucket'    : undefined,
        'drop'      : bucketDrop,
        'Collection': Collection
    };

    var entityProto = {
        'insert'    : collectionInsert,
        'find'      : collectionFind,
        'findOne'   : collectionFindOne,
        'update'    : null,
        'delete'    : collectionDelete,
        'drop'      : collectionDrop
    };

    var init = function(options) {

        // detect if cookies are enabled
        if ( !window.localStorage || window.localStorage && ! typeof(window.localStorage.setItem) == 'undefined' ) {
            throw new Error('Make sure your browser supports `window.localStorage` to use Gina Storage. See: `https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API#Browser_compatibility`');
        }

        if ( typeof(options) != 'object' && typeof(options) != 'undefined' ) {
            throw new Error('`options` must be an object')
        } else if ( typeof(options) == 'undefined' ) {
            var options = {}
        }

        self.options    = merge(options, self.options);
        storage         = window.localStorage;

        var bucketName  = self.options['bucket'];
        var bucket      = storage.getItem(bucketName);

        if (!bucket && bucketName != undefined) {
            //console.log('creating new bucket !');
            bucketCreate(bucketName);
        } else if (bucketName == undefined) {
            throw new Error('`bucket` name cannot be undefined')
        }

        bucketInstance['bucket'] = bucketName;
        bucketInstance = merge(bucketInstance, proto);
    }



    /**
     * Create bucket
     *
     * @param {string} bucketName
     * */
    var bucketCreate = function(bucketName) {
        storage.setItem(bucketName, JSON.stringify(collections));
    }

    /**
     * Drop bucket
     *
     * */
    function bucketDrop() {
        storage.removeItem(self.options['bucket']);
        bucketInstance = null;

        for (var prop in this) {
            delete this[prop]
        }

        return bucketInstance;
    }

    /**
     * Create or Get Collection by name
     *
     * @param {string} name - Collection name
     * */
    function Collection(name) {
        // retrieve collections state
        collections = JSON.parse(storage.getItem(this['bucket']));
        //console.log('collections ', (collections || null) );
        if ( typeof(collections[name]) == 'undefined' ) {
            collections[name] = [];
            storage.setItem(this['bucket'], JSON.stringify(collections));
            collections = JSON.parse(storage.getItem(this['bucket']));
        }

        entities[name]      = { '_collection': name, '_bucket': this['bucket'] };
        entities[name]      = merge(entities[name], entityProto);

        return entities[name]
    }

    /**
     * Drop collection
     *
     * @param {string} name
     * */
    function collectionDrop(name) {
        if ( typeof(collections[ this['_collection'] ]) == 'undefined' ) {
            throw new Error('Collection `'+name+'` not found')
        }

        delete entities[ this['_collection'] ]; // delete entity
        delete collections[ this['_collection'] ]; // delete data

        storage.setItem(this['_bucket'], JSON.stringify(collections));
    }

    /**
     * Insert into collection
     *
     * @param {object} content
     * */
    function collectionInsert(content) {

        // TODO - add uuid
        content['_id']         = uuid.v1();
        content['_createdAt']  = new Date().format("isoDateTime");
        content['_updatedAt']  = new Date().format("isoDateTime");

        collections[ this['_collection'] ][ collections[ this['_collection'] ].length ] = content;

        storage.setItem(this['_bucket'], JSON.stringify(collections));
    }

    /**
     * Find from collection
     *
     * // TODO - add options
     *
     * @param {object} filter
     * @param {object} [options] - e.g.: limit
     *
     * @return {array} result
     * */
    function collectionFind(filter, options) {
        if (!filter) {
            // TODO - limit of ten by
            return collections[ this['_collection'] ]
        }

        if ( typeof(filter) !== 'object' ) { // == findAll
            throw new Error('filter must be an object');
        } else {
            //console.log('search into ', this['_collection'], collections[ this['_collection'] ], collections);
            var content             = collections[ this['_collection'] ]
                , condition         = filter.count()
                , i                 = 0
                , found             = []
                , localeLowerCase   = '';

            for (var o in content) {
                for (var f in filter) {
                    localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
                    if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] != 'null' && content[o][f] != 'undefined' ) {
                        if (found.indexOf(content[o][f]) < 0 ) {
                            found[i] = content[o][f];
                            ++i
                        }

                    } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {
                        found[i] = content[o];
                        ++i
                    }
                }
            }
        }

        return found
    }

    //function collectionLimit(limit) {}

    /**
     * Find a single result from collection
     *
     * e.g:
     *  // getting a record
     *  > var objectRecord = <bucket>.Collection('myBucket').findOne({_name: "someName"});
     *
     *  // updating record by adding or updating an existing property
     *  > objectRecord.myProperty = 'some value';
     *  > objectRecord.save();
     *
     *  // deleting record
     *  > objectRecord.myProperty.delete()
     *
     * @param {object} filter
     *
     * @returns {object|array|string} result
     *
     * */
    function collectionFindOne(filter) {

        if ( typeof(filter) !== 'object' ) {
            throw new Error('filter must be an object');
        } else {
            var content             = collections[ this['_collection'] ]
                , condition         = filter.count()
                , i                 = 0
                , result            = null
                , localeLowerCase   = '';


            //console.log('condition ', condition, '\nfitler', filter, '\ncontent', content);
            if (condition == 0) return null;

            for (var o in content) {
                for (var f in filter) {
                    localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
                    if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] && content[o][f] != 'null' && content[o][f] != 'undefined' ) {
                        if (result.indexOf(content[o][f]) < 0 ) {
                            ++i;
                            if (i === condition) {
                                result                   = content[o];
                                result['_index']         = o;
                                result['_collection']    = this['_collection'];
                                result['_bucket']        = this['_bucket'];
                            }

                        }

                    } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {
                        ++i;
                        if (i === condition) {
                            result                   = content[o];
                            result['_index']         = o;
                            result['_collection']    = this['_collection'];
                            result['_bucket']        = this['_bucket'];
                            result['_filter']        = filter;
                        }
                    }
                }
            }
        }

        if (result) {
            /**
             * save
             *  e.g.:
             *      // updating property
             *      <obj>.property = 'value';
             *      <obj>.save();
             *
             *      // deleting property
             *      delete <obj>.property;
             *      <obj>.save(true);
             *
             * @param {boolean} enforceDeleted
             * */
            result['save'] = function(enforceDeleted) {

                var enforceDeleted = enforceDeleted || false;

                try {
                    //backing up collections
                    var tmpCollections  = JSON.parse(JSON.stringify(collections));
                    var index           = this['_index'];
                    var collection      = this['_collection'];
                    var bucket          = this['_bucket'];
                    var filter          = this['_filter'];
                    this['_updatedAt']  = new Date().format("isoDateTime");

                    merge(tmpCollections[ collection ][ index ], this, true);

                    // cleaning
                    delete tmpCollections[ collection ][ index ]['_index'];
                    delete tmpCollections[ collection ][ index ]['_collection'];
                    delete tmpCollections[ collection ][ index ]['_bucket'];
                    delete tmpCollections[ collection ][ index ]['save'];
                    delete tmpCollections[ collection ][ index ]['_filter'];

                    if (enforceDeleted && typeof(tmpCollections[ collection ][ index ]) == 'object' ) {

                        var parseEnforcedCollection = function (arr, target) {
                            for (var i = 0, len = arr.length; i < len; ++i) {
                                if ( typeof (target[i]) == 'object' && typeof(arr[i]) != 'undefined' && !Array.isArray(arr[i]) ) {
                                    parseEnforced(arr[i], target[i])
                                } else if ( !Array.isArray(arr[i]) ){
                                    if (typeof(arr[i]) == 'undefined') {
                                        delete target[i]
                                    }
                                } else { // is collection type
                                    parseEnforcedCollection(arr[i], target[i])
                                }
                            }

                            return target
                        }

                        var parseEnforced = function (obj, target) {
                            for (var prop in target) {
                                if ( typeof (target[prop]) == 'object' && typeof(obj[prop]) != 'undefined' && !Array.isArray(obj[prop]) ) {
                                    parseEnforced(obj[prop], target[prop])
                                } else if ( !Array.isArray(obj[prop]) ){
                                    if (typeof(obj[prop]) == 'undefined') {
                                        delete target[ prop ]
                                    }
                                } else { // is collection type
                                    parseEnforcedCollection(obj[prop], target[prop])
                                }
                            }

                            return target
                        };

                        if ( Array.isArray(tmpCollections[ collection ][ index ]) ) {
                            tmpCollections[ collection ][ index ] = parseEnforcedCollection(this, tmpCollections[ collection ][ index ])
                        } else if ( typeof(tmpCollections[ collection ][ index ] ) == 'object' ) {
                            tmpCollections[ collection ][ index ] = parseEnforced(this, tmpCollections[ collection ][ index ])
                        } else {
                            if (typeof(this[prop]) == 'undefined') {
                                delete tmpCollections[ collection ][ index ]
                            }
                        }
                    }

                    collections[ collection ][ index ] = tmpCollections[ collection ][ index ];

                    // saving
                    storage.setItem(bucket, JSON.stringify(collections));

                    return collectionFindOne(filter)

                } catch (err) {
                    throw err
                }
            }
        }


        return result
    }

    /**
     * Delete from collection
     *
     * @param {object} filter
     *
     * @return {array} result
     * */
    function collectionDelete(filter) {

        if ( typeof(filter) !== 'object' ) {
            throw new Error('filter must be an object');
        } else {
            var content     = JSON.parse(JSON.stringify( collections[ this['_collection'] ] ))
                //, condition = filter.count()
                , i         = 0
                , found     = [];

            for (var o in content) {
                for (var f in filter) {
                    if ( filter[f] && keywords.indexOf(filter[f].toLocaleLowerCase()) > -1 && filter[f].toLowerCase() == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] != 'null' && content[o][f] != 'undefined' ) {
                        if (found.indexOf(content[o][f]) < 0 ) {
                            found[i] = content[o][f];
                            delete collections[ this['_collection'] ][o][f];
                            ++i
                        }

                    } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {
                        found[i] = content[o];
                        collections[ this['_collection'] ].splice(o, 1);
                        ++i
                    }
                }
            }
        }

        if (found.length > 0 ) {
            storage.setItem(this['_bucket'], JSON.stringify(collections));
            return true
        }

        return false
    }

    init(options);


    return bucketInstance
}
280389
function createPersistStore(reduxStore) {
    var persistor = (0, _reduxPersist.persistStore)(reduxStore);
    var dispatch = persistor.dispatch,
        getState = persistor.getState;


    reduxStore.persistor = persistor;
    reduxStore.getState.persistor = getState;
    reduxStore.dispatch.persistor = dispatch;
    reduxStore.dispatch.persistor = Object.assign(reduxStore.dispatch.persistor, {
        flush: persistor.flush,
        pause: persistor.pause,
        persist: persistor.flush,
        purge: persistor.purge
    });

    return reduxStore;
}
477214
function hyperBind(store) {
  this.compile = function(input) {
    var path = input.split('.');
    return {
      path: input,
      target: path[path.length - 1]
    };
  };

  this.state = function(config, state) {
    var res = store.get(config.path, state);
    if (!res.completed) return false;
    return state.set(config.target, res.value);
  };

  this.children = function(config, state, children) {
    var value = state.get(config.target);
    if (typeof value === 'undefined') return '';
    return value;
  };
}
733357
function (args) {
  if (false === (this instanceof Store)) throw new Error('new operator required');
  args = args || {};
  this.storeType = args.storeType || "Store";
  this.name = args.name || 'a ' + this.storeType;
  this.storeProperty = {
    isReady: false,
    canGetModel: false,
    canPutModel: false,
    canDeleteModel: false,
    canGetList: false
  };
  var unusedProperties = getInvalidProperties(args, ['name', 'storeType']);
  var errorList = [];
  for (var i = 0; i < unusedProperties.length; i++) errorList.push('invalid property: ' + unusedProperties[i]);
  if (errorList.length > 1) throw new Error('error creating Store: multiple errors');
  if (errorList.length) throw new Error('error creating Store: ' + errorList[0]);
}
363005
function EntityInstantiator(options) {
  if (!options.store) throw new Error("Missing store");
  if (!options.Entity) throw new Error("Missing entity constructor");
  if (!options.logger) throw new Error("Missing logger");
  this.store  = options.store;
  this.Entity = options.Entity;
  this.logger = options.logger;
}
1031060
function storeOptions() {
    var showTomster = this.checked;

    chrome.storage.sync.set({
      options: { showTomster: showTomster }
    }, function optionsSaved() {
      console.log("saved!");
    });
  }
86741
function LocalStore(prefix) {
  prefix = prefix || 'openpgp-';
  this.publicKeysItem = prefix + this.publicKeysItem;
  this.privateKeysItem = prefix + this.privateKeysItem;
  if (typeof window !== 'undefined' && window.localStorage) {
    this.storage = window.localStorage;
  } else {
    this.storage = new (require('node-localstorage').LocalStorage)(config.node_store);
  }
}
1042462
function(options) {
    const Store = require('../../store')

    var self = this
    var primaryKeys = this.definition.primaryKeys
    var condition = {}

    options = options || {}

    for (var i = 0; i < primaryKeys.length; i++) {
      condition[primaryKeys[i]] = this[primaryKeys[i]]
    }

    return self.store.startTransaction(options, function() {
      return self
        .callInterceptors('beforeDestroy', [self, options])
        .then(function() {
          var query = self.definition.query(options)

          return query
            .where(condition)
            .delete()
            .catch(function(error) {
              debug(query.toString())
              throw new Store.SQLError(error)
            })
            .then(function() {
              debug(query.toString())
            })
            .then(function() {
              return self.callInterceptors('afterDestroy', [self, options])
            })
            .then(function() {
              self.__exists = false
              return self
            })
        })
    })
  }
1006714
function store( $storeAsValid = false )
    {
        $dateTime = time();
        $user = eZUser::currentUser();
        if (  $this->ID == null )
        {
            parent::store();
            return;
        }

        $db = eZDB::instance();
        $db->begin();
        if ( $storeAsValid )
        {
            $oldStatus = $this->attribute( 'status' );
            $this->setAttribute( 'status', eZRSSExport::STATUS_VALID );
        }
        $this->setAttribute( 'modified', $dateTime );
        $this->setAttribute( 'modifier_id', $user->attribute( "contentobject_id" ) );
        parent::store();
        $db->commit();
        if ( $storeAsValid )
        {
            $this->setAttribute( 'status', $oldStatus );
        }
    }
794707
function _initStorage(options) {
        var self = this;
        var dbInfo = {};
        if (options) {
            for (var i in options) {
                dbInfo[i] = options[i];
            }
        }

        dbInfo.keyPrefix = dbInfo.name + '/';

        self._dbInfo = dbInfo;
        return Promise.resolve();
    }
798638
function store() {
    return function (storeClass) {
        // save a reference to the original constructor
        var original = storeClass;
        // a utility function to generate instances of a class
        function construct(constructor, args) {
            var dynamicClass = function () {
                return new (constructor.bind.apply(constructor, [void 0].concat(args)))();
            };
            dynamicClass.prototype = constructor.prototype;
            return new dynamicClass();
        }
        // the new constructor behavior
        var overriddenConstructor = function Store() {
            var _this = this;
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
            }
            if (!Reflect.hasMetadata(constance_1.STATEX_ACTION_KEY, this))
                return;
            var statexActions = Reflect.getMetadata(constance_1.STATEX_ACTION_KEY, this);
            Object.keys(statexActions).forEach(function (name) { return new statexActions[name]().subscribe(_this[name], _this); });
            return construct(original, args);
        };
        // copy prototype so instanceof operator still works
        overriddenConstructor.prototype = original.prototype;
        // create singleton instance
        var instance = new overriddenConstructor();
        // return new constructor (will override original)
        return instance && overriddenConstructor;
    };
}
852483
protected void initStores() throws SecurityDomainException {
        setDomainEnvironment();

        char[] keyStorePasswd = domainProperties.getProperty(JAVAX_NET_SSL_KEYSTORE_PASSWORD, "").toCharArray();
        char[] trustStorePasswd = domainProperties.getProperty(JAVAX_NET_SSL_TRUSTSTORE_PASSWORD, "").toCharArray();

        String keyStoreName = domainProperties.getProperty(JAVAX_NET_SSL_KEYSTORE, null);
        if (logger.isDebugEnabled())
            logger.debug("Name of key store for security domain " + name + " is " + keyStoreName);
        if (keyStoreName == null) {
            restoreSystemEnvironment();
            throw new SecurityDomainException(name, "Key Store file is undefined");
        }

        String trustStoreName = domainProperties.getProperty(JAVAX_NET_SSL_TRUSTSTORE, null);
        if (logger.isDebugEnabled()) {
            if (trustStoreName != null) {
                logger.debug("Name of trust store for security domain " + name + " is " + trustStoreName);
            } else {
                logger.debug("Name of trust store for security domain " + name + " was not defined. Default trust store from JVM will be used");
            }
        }

        // Key Store
        try {
            InputStream keystoreInputStream = preBufferInputStream(new FileInputStream(keyStoreName));
            initKeyStore(keystoreInputStream, keyStorePasswd);
            if (logger.isDebugEnabled())
                logger.debug("Key store for security domain " + name + " initialized successfully");
        } catch (NoSuchAlgorithmException e) {
            String msg = "Error: Key Store Manager Algorithm " + KeyManagerFactory.getDefaultAlgorithm() + " is not supported. " + e.getLocalizedMessage();
            logger.error(msg);
            restoreSystemEnvironment();
            throw new SecurityDomainException(name, msg, e);
        } catch (CertificateException | IOException | UnrecoverableKeyException e) {
            String msg = "Error loading key store file " + keyStoreName + ".  " + e.getLocalizedMessage();
            logger.error(msg);
            restoreSystemEnvironment();
            throw new SecurityDomainException(name, msg, e);
        }

        if (trustStoreName != null) {
            // Trust Store
            try {
                InputStream trustoreInputStream = preBufferInputStream(new FileInputStream(trustStoreName));
                initTrustStore(trustoreInputStream, trustStorePasswd);
                if (logger.isDebugEnabled())
                    logger.debug("Trust store for security domain " + name + " initialized successfully");

            } catch (NoSuchAlgorithmException e) {
                String msg = "Error: Key Store Manager Algorithm " + KeyManagerFactory.getDefaultAlgorithm() + " is not supported. " + e.getLocalizedMessage();
                logger.error(msg);
                restoreSystemEnvironment();
                throw new SecurityDomainException(name, msg, e);
            } catch (CertificateException e) {
                String msg = "Error loading trust store file " + trustStoreName + ".  " + e.getLocalizedMessage();
                logger.error(msg);
                restoreSystemEnvironment();
                throw new SecurityDomainException(name, msg, e);
            } catch (IOException e) {
                String msg = "Error loading trust store file " + trustStoreName + ".  " + e.getLocalizedMessage();
                logger.error(msg);
                restoreSystemEnvironment();
                throw new SecurityDomainException(name, msg, e);
            }
        }
        restoreSystemEnvironment();
    }
780118
function (callback) {
        debug('');
        async.parallel([

          // prepare repository...
          function (callback) {
            debug('prepare repository...');

            self.repository.on('connect', function () {
              self.emit('connect');
            });

            self.repository.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.repository.connect(callback);
          },

          // prepare revisionGuard...
          function (callback) {
            debug('prepare revisionGuard...');

            self.revisionGuardStore.on('connect', function () {
              self.emit('connect');
            });

            self.revisionGuardStore.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.revisionGuardStore.connect(callback);
          }
        ], callback);
      }