private static bool IsRemoteComponentOnlineInternal(string fqdn, MultiValuedProperty <string> componentStates, ServerComponentEnum serverComponent)
        {
            ServiceState serviceState = ServerComponentStates.ReadEffectiveComponentState(fqdn, componentStates, ServerComponentStates.GetComponentId(serverComponent), ServiceState.Active);

            return(serviceState == ServiceState.Active);
        }
 public static ServiceState ReadEffectiveComponentState(ServerComponentEnum serverComponent, ServiceState defaultState)
 {
     return(ServerComponentStates.ReadEffectiveComponentState(null, null, ServerComponentStateSources.Registry, ServerComponentStates.GetComponentId(serverComponent), defaultState));
 }
        public static bool IsRemoteComponentOnlineAccordingToADInternal(MultiValuedProperty <string> componentStates, ServerComponentEnum serverComponent)
        {
            List <ServerComponentStates.ItemEntry> remoteStates = ServerComponentStates.GetRemoteStates(componentStates, ServerComponentStates.GetComponentId(serverComponent));
            ServiceState effectiveState = ServerComponentStates.GetEffectiveState(remoteStates, ServiceState.Active);

            return(effectiveState == ServiceState.Active);
        }
예제 #4
0
        public static ServiceState GetEffectiveState(ServerComponentEnum serverComponent, bool onlineByDefault)
        {
            MultiValuedProperty <string> adStates = null;

            try
            {
                adStates = ServerComponentStateManager.Instance.GetAdStates();
            }
            catch (ServerComponentApiException arg)
            {
                ServerComponentStateManager.Tracer.TraceError <ServerComponentApiException>(0L, "GetEffectiveState ignoring failure to get adStates. Ex was {0}", arg);
            }
            ServiceState compState = ServiceState.Inactive;

            ServerComponentStateManager.RunLocalRegistryOperation(delegate
            {
                compState = ServerComponentStates.ReadEffectiveComponentState(null, adStates, ServerComponentStates.GetComponentId(serverComponent), onlineByDefault ? ServiceState.Active : ServiceState.Inactive);
            });
            return(compState);
        }