private CommandInfo ParseCommand(Caching.Cache cache, Alachisoft.NCache.Common.Protobuf.Command command)
        {
            CommandInfo cmdInfo = new CommandInfo();

            Alachisoft.NCache.Common.Protobuf.AddAttributeCommand addAttributeCommand = command.addAttributeCommand;
            cmdInfo.ExpHint   = Alachisoft.NCache.Caching.Util.ProtobufHelper.GetExpirationHintObj(cache.Configuration.ExpirationPolicy, addAttributeCommand.dependency, addAttributeCommand.absExpiration, 0, false, serializationContext);
            cmdInfo.Key       = addAttributeCommand.key;
            cmdInfo.RequestId = addAttributeCommand.requestId.ToString();

            return(cmdInfo);
        }
        internal AddAttributeCommand(string key, DateTime absoluteExpiration)
        {
            base.name = "AddAttributeCommand";
            base.key = key;

            _addAttributeCommand = new Alachisoft.NCache.Common.Protobuf.AddAttributeCommand();
            if (absoluteExpiration != Cache.NoAbsoluteExpiration)
                _addAttributeCommand.absExpiration = absoluteExpiration.ToUniversalTime().Ticks;

            _addAttributeCommand.key = key;
            _addAttributeCommand.requestId = base.RequestId;
        }
Exemple #3
0
        internal AddAttributeCommand(string key, DateTime absoluteExpiration)
        {
            base.name = "AddAttributeCommand";
            base.key  = key;


            _addAttributeCommand = new Alachisoft.NCache.Common.Protobuf.AddAttributeCommand();
            if (absoluteExpiration != Cache.NoAbsoluteExpiration)
            {
                _addAttributeCommand.absExpiration = absoluteExpiration.ToUniversalTime().Ticks;
            }

            _addAttributeCommand.key       = key;
            _addAttributeCommand.requestId = base.RequestId;
        }
Exemple #4
0
        internal AddAttributeCommand(string key, DateTime absoluteExpiration, CacheDependency dependency,
                                     int methodOverload)
        {
            base.name = "AddAttributeCommand";
            base.key  = key;

            _methodOverload      = methodOverload;
            _addAttributeCommand = new Alachisoft.NCache.Common.Protobuf.AddAttributeCommand();
            if (absoluteExpiration != Alachisoft.NCache.Web.Caching.Cache.NoAbsoluteExpiration)
            {
                _addAttributeCommand.absExpiration = absoluteExpiration.ToUniversalTime().Ticks;
            }

            _addAttributeCommand.key       = key;
            _addAttributeCommand.requestId = base.RequestId;

            if (dependency != null)
            {
                _addAttributeCommand.dependency =
                    Alachisoft.NCache.Common.Util.DependencyHelper.GetProtoBufDependency(dependency);
            }
        }