/// <summary>
        /// The sign-out operation desired.
        /// </summary>
        /// <param name="signOut">The sign out.</param>
        public void SignOut(DeviceSignOutMethod signOut, IDevice device)
        {
            IDevicePreparationManager dpm = DevicePreparationManagerFactory.Create(device);

            dpm.WorkflowLogger = _workflowLogger;
            dpm.SignOut(signOut);
        }
        /// <summary>
        /// Signs the out.
        /// </summary>
        /// <param name="signOutMethod">The sign out method.</param>
        public void SignOut(DeviceSignOutMethod signOutMethod)
        {
            RecordInfo(DeviceWorkflowMarker.SignOutType, signOutMethod.ToString());
            RecordEvent(DeviceWorkflowMarker.DeviceSignOutBegin);

            switch (signOutMethod)
            {
            case DeviceSignOutMethod.PressSignOut:
                NavigateHome();
                PressSignOutButton();
                break;

            case DeviceSignOutMethod.Timeout:
                SignOutByTimeout();
                break;

            case DeviceSignOutMethod.PressResetHardKey:
                Reset();
                break;

            case DeviceSignOutMethod.PressResetSoftKey:
                SignOutByResetSoftKey();
                break;

            default:
                throw new WindjammerInvalidOperationException("Jedi Windjammer devices do not support " + EnumUtil.GetDescription(signOutMethod));
            }
            RecordEvent(DeviceWorkflowMarker.DeviceSignOutEnd);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Launches the application.
        /// </summary>
        /// <param name="device">The device.</param>
        /// <param name="deviceAsset">The device asset.</param>
        /// <returns>PluginExecutionResult</returns>
        private PluginExecutionResult LaunchApp(IDevice device, IDeviceInfo deviceAsset)
        {
            PluginExecutionResult result = new PluginExecutionResult(PluginResult.Passed);
            string buttonText            = _activityData.InitiationButton;

            try
            {
                _workflowLogger.RecordEvent(DeviceWorkflowMarker.ActivityBegin);

                AuthenticationInitMethod aim = GetAuthenticationInitMethod(_activityData.InitiationButton);
                DeviceSignOutMethod      deviceUnauthMethod = SignOutMethod.GetSignOutMethod(_activityData.UnAuthenticateMethod);
                IAuthenticator           auth = GetAuthenticator(device, deviceAsset);

                // retrieve the Authentication solution, plugin.
                IAuthenticationDriver app = GetApp(device);

                UpdateStatus("Launching authentication for " + buttonText + ".");
                if (!aim.Equals(AuthenticationInitMethod.DoNotSignIn))
                {
                    app.Launch(auth, aim);
                }
                else
                {
                    UpdateStatus("Skip Sign In :: Do not Sign In");
                }

                UpdateStatus("Logging out of device " + deviceAsset.AssetId + " - " + deviceAsset.Address + " by " + _activityData.UnAuthenticateMethod);
                if (deviceUnauthMethod.Equals(DeviceSignOutMethod.DoNotSignOut))
                {
                    UpdateStatus("Skip Sign Out :: Do Not Sign Out");
                }
                else
                {
                    app.SignOut(deviceUnauthMethod, device);
                }

                _workflowLogger.RecordEvent(DeviceWorkflowMarker.ActivityEnd);
            }
            catch (DeviceCommunicationException ex)
            {
                result = new PluginExecutionResult(PluginResult.Failed, ex.Message, "Device communication error.");
            }
            catch (DeviceInvalidOperationException ex)
            {
                result = new PluginExecutionResult(PluginResult.Failed, ex.Message, "Device automation error.");
            }
            catch (DeviceWorkflowException ex)
            {
                result = new PluginExecutionResult(PluginResult.Failed, ex, "Device workflow error.");
            }

            return(result);
        }
        /// <summary>
        /// Signs out of the device using the provided sign out method
        /// </summary>
        /// <param name="signOutMethod">The sign out method.</param>
        /// <exception cref="System.NotImplementedException"></exception>
        public void SignOut(DeviceSignOutMethod signOutMethod)
        {
            RecordInfo(DeviceWorkflowMarker.SignOutType, signOutMethod.ToString());
            switch (signOutMethod)
            {
            case DeviceSignOutMethod.PressSignOut:
                NavigateHome();
                RecordEvent(DeviceWorkflowMarker.DeviceSignOutBegin);
                PressSignOutButton();
                break;

            case DeviceSignOutMethod.Timeout:
                RecordEvent(DeviceWorkflowMarker.DeviceSignOutBegin);
                SignOutByTimeout();
                break;

            case DeviceSignOutMethod.DoNotSignOut:
                break;

            default:
                throw new DeviceInvalidOperationException("Jedi Omni devices do not support " + EnumUtil.GetDescription(signOutMethod));
            }
            RecordEvent(DeviceWorkflowMarker.DeviceSignOutEnd);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Represents an event that is raised when the sign-out operation is complete.
 /// </summary>
 /// <param name="signOutMethod">The sign out method.</param>
 /// <exception cref="NotImplementedException"></exception>
 public void SignOut(DeviceSignOutMethod signOutMethod)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets the un authenticate method.
        /// </summary>
        /// <param name="getSignOutMethod">The un authenticate method.</param>
        /// <returns></returns>
        public static DeviceSignOutMethod GetSignOutMethod(string getSignOutMethod)
        {
            DeviceSignOutMethod dum = EnumUtil.GetByDescription <DeviceSignOutMethod>(getSignOutMethod);

            return(dum);
        }