internal AggregateExpirationHint GetRoutableClone(PoolManager poolManager, Address sourceNode)
        {
            if (_hints == null || _hints.Count == 0)
            {
                return(null);
            }

            AggregateExpirationHint hint = Create(poolManager);

            NodeExpiration ne = null;

            for (int i = 0; i < _hints.Count; i++)
            {
                ExpirationHint eh = (ExpirationHint)_hints[i];
                if (!eh.IsRoutable && ne == null)
                {
                    ne = NodeExpiration.Create(poolManager, sourceNode);
                    hint.Add(ne);
                }
                else
                {
                    hint.Add(eh);
                }
            }
            return(hint);
        }
Exemple #2
0
        public static ExpirationHint ReadExpHint(CompactReader reader, PoolManager poolManager)
        {
            ExpirationHintType expHint = ExpirationHintType.Parent;

            expHint = (ExpirationHintType)reader.ReadInt16();

            switch (expHint)
            {
            case ExpirationHintType.NULL:
                return(null);

            case ExpirationHintType.Parent:
                return((ExpirationHint)reader.ReadObject());

            case ExpirationHintType.FixedExpiration:
                var fe = FixedExpiration.Create(poolManager);
                fe.Deserialize(reader);
                return(fe);

            case ExpirationHintType.TTLExpiration:
                var ttle = TTLExpiration.Create(poolManager);
                ((ICompactSerializable)ttle).Deserialize(reader);
                return(ttle);

            case ExpirationHintType.FixedIdleExpiration:
                var fie = FixedIdleExpiration.Create(poolManager);
                ((ICompactSerializable)fie).Deserialize(reader);
                return(fie);

#if !(DEVELOPMENT || CLIENT)
            case ExpirationHintType.NodeExpiration:
                var ne = NodeExpiration.Create(poolManager);
                ((ICompactSerializable)ne).Deserialize(reader);
                return(ne);
#endif
            case ExpirationHintType.IdleExpiration:
                var ie = IdleExpiration.Create(poolManager);
                ((ICompactSerializable)ie).Deserialize(reader);
                return(ie);

            case ExpirationHintType.AggregateExpirationHint:
                var aeh = AggregateExpirationHint.Create(poolManager);
                ((ICompactSerializable)aeh).Deserialize(reader);
                return(aeh);

            case ExpirationHintType.DependencyHint:
                break;

            default:
                break;
            }
            return(null);
        }