Exemplo n.º 1
0
 // This constructor has to be public for JSonSerialization to work!
 // Implement ISerializable if changing it to non-public
 public PubSubSubscriptionState(
     GuidId subscriptionId,
     StreamId streamId,
     IStreamConsumerExtension streamConsumer)
 {
     SubscriptionId    = subscriptionId;
     Stream            = streamId;
     consumerReference = streamConsumer as GrainReference;
     state             = SubscriptionStates.Active;
 }
 // This constructor has to be public for JSonSerialization to work!
 // Implement ISerializable if changing it to non-public
 public PubSubSubscriptionState(
     GuidId subscriptionId,
     StreamId streamId,
     IStreamConsumerExtension streamConsumer,
     IStreamFilterPredicateWrapper filterWrapper)
 {
     SubscriptionId     = subscriptionId;
     Stream             = streamId;
     consumerReference  = streamConsumer as GrainReference;
     this.filterWrapper = filterWrapper;
     state = SubscriptionStates.Active;
 }
Exemplo n.º 3
0
 // This constructor has to be public for JSonSerialization to work!
 // Implement ISerializable if changing it to non-public
 public PubSubSubscriptionState(
     GuidId subscriptionId,
     StreamId streamId,
     IStreamConsumerExtension streamConsumer,
     StreamSequenceToken token,
     IStreamFilterPredicateWrapper filterWrapper)
 {
     SubscriptionId      = subscriptionId;
     Stream              = streamId;
     Consumer            = streamConsumer;
     StreamSequenceToken = token;
     FilterWrapper       = filterWrapper;
     state = SubscriptionStates.Active;
 }
Exemplo n.º 4
0
        private void ChangeState(SubscriptionInfo info, SubscriptionStates state)
        {
            const string text = "Subscription {0} {1}->{2}.";

            if (info.State.IsOk(state))
            {
                this.AddInfoLog(text, info.Subscription.TransactionId, info.State, state);
            }
            else
            {
                this.AddWarningLog(text, info.Subscription.TransactionId, info.State, state);
            }

            info.State = state;
        }
            private void ChangeState(Subscription subscription, SubscriptionStates state)
            {
                const string text = "Subscription {0} {1}->{2}.";

                if (subscription.State.IsOk(state))
                {
                    _connector.AddInfoLog(text, subscription.TransactionId, subscription.State, state);
                }
                else
                {
                    _connector.AddWarningLog(text, subscription.TransactionId, subscription.State, state);
                }

                subscription.State = state;
            }
Exemplo n.º 6
0
        public void WriteSubscriptionState(SubscriptionStates state, int expires)
        {
            Write(C.Subscription_State__);

            switch (state)
            {
            case SubscriptionStates.Active: Write(C.active, C._expires_, expires); break;

            case SubscriptionStates.Pending: Write(C.pending, C._expires_, expires); break;

            case SubscriptionStates.Terminated: Write(C.terminated); break;
            }

            Write(C.CRLF);
        }
        private void ChangeState(SubscriptionInfo info, SubscriptionStates state)
        {
            var id = info.Subscription.TransactionId;

            const string text = "Subscription {0} {1}->{2}.";

            if (info.State.IsOk(state))
            {
                this.AddInfoLog(text, id, info.State, state);
            }
            else
            {
                this.AddWarningLog(text, id, info.State, state);
            }

            info.State = state;

            if (!state.IsActive())
            {
                _subscriptionsByKey.RemoveByValue(info);
                this.AddInfoLog(LocalizedStrings.OnlineSubscriptionRemoved, id);
            }
        }
Exemplo n.º 8
0
 private void ChangeState(Subscription subscription, SubscriptionStates state)
 {
     subscription.State = subscription.State.ChangeSubscriptionState(state, subscription.TransactionId, _connector);
 }
Exemplo n.º 9
0
 public void Fault()
 {
     state = SubscriptionStates.Faulted;
 }
 private void ChangeState(SubscriptionInfo info, SubscriptionStates state)
 {
     info.State = info.State.ChangeSubscriptionState(state, info.Subscription.TransactionId, this, !_allSecIdChilds.Contains(info.Subscription.TransactionId));
 }
Exemplo n.º 11
0
            private void ChangeState(SubscriptionInfo info, SubscriptionStates state)
            {
                var subscription = info.Subscription;

                subscription.State = subscription.State.ChangeSubscriptionState(state, subscription.TransactionId, _connector, info.Parent == null);
            }
 private void ChangeState(SubscriptionInfo info, SubscriptionStates state)
 {
     info.State = info.State.ChangeSubscriptionState(state, info.TransactionId, this);
 }
Exemplo n.º 13
0
 private void ChangeState(Subscription subscription, SubscriptionStates state)
 {
     _connector.AddInfoLog("Subscription {0} {1}->{2}.", subscription.TransactionId, subscription.State, state);
     subscription.State = state;
 }
Exemplo n.º 14
0
		public void WriteSubscriptionState(SubscriptionStates state, int expires)
		{
			Write(C.Subscription_State__);

			switch (state)
			{
				case SubscriptionStates.Active: Write(C.active, C._expires_, expires); break;
				case SubscriptionStates.Pending: Write(C.pending, C._expires_, expires); break;
				case SubscriptionStates.Terminated: Write(C.terminated); break;
			}

			Write(C.CRLF);
		}