public void SetState(string state, ISubscriptionPersistence persistence, string nodeId) { Timesout = false; switch (state) { case MonitoredNode.HealthyAndFunctional: IsFullyFunctionalAndActive(); persistence.Alter(nodeId, node => node.AddOwnership(Subject)); break; case MonitoredNode.ThrowsExceptionOnStartupOrHealthCheck: ActivationException = new DivideByZeroException(); AssertAvailableException = new HandshakeException(); break; case MonitoredNode.TimesOutOnStartupOrHealthCheck: Timesout = true; break; case MonitoredNode.IsInactive: IsFullyFunctional(); IsActive = false; break; } }
public void AddOwnershipToThisNode(Uri subject) { _persistence.Alter(_graph.NodeId, node => node.AddOwnership(subject)); }