public SystemSessionService(
     ISystemClient systemClient,
     ISystemSettings systemSettings)
 {
     _systemClient = systemClient;
     _systemId     = systemSettings.SystemId;
 }
 public SystemSessionNode(
     int accessingSystemId,
     string passCode,
     ISystemClient systemClient,
     int systemId)
 {
     AccessingSystemId = accessingSystemId;
     _passCode         = passCode;
     _systemClient     = systemClient;
     _systemId         = systemId;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SampleService"/> class.
 /// </summary>
 /// <param name="sdkClientSettings">Instance of the <see cref="_sdkClientSettings"/>.</param>
 /// <param name="systemClient">Instance of the <see cref="ISystemClient"/> interface.</param>
 /// <param name="userClient">Instance of the <see cref="IUserClient"/> interface.</param>
 /// <param name="userViewsClient">Instance of the <see cref="IUserViewsClient"/> interface.</param>
 public SampleService(
     SdkClientSettings sdkClientSettings,
     ISystemClient systemClient,
     IUserClient userClient,
     IUserViewsClient userViewsClient)
 {
     _sdkClientSettings = sdkClientSettings;
     _systemClient      = systemClient;
     _userClient        = userClient;
     _userViewsClient   = userViewsClient;
 }
Пример #4
0
        public bool Login()
        {
            AuthenticationState authentication = AuthenticationState.Unknown;

            _systemClient = new SystemClientHttp(_dpmTarget);
            TpsLogManager <Semafone> .Debug("Created SystemClientHttp using" + _dpmTarget + " for " + _webSocket);

            _telephonyClient = new TelephonyClientHttp(_dpmTarget);
            TpsLogManager <Semafone> .Debug("Created TelephonyClientHttp using" + _dpmTarget + " for " + _webSocket);

            _secureDataClient = new SecureDataClientHttp(_dpmTarget);
            TpsLogManager <Semafone> .Debug("Created SecureDataClientHttp using" + _dpmTarget + " for " + _webSocket);

            try
            {
                // Attempt to login to the DPM (Semafone), the SemafoneClientSession reference
                // passed in will be filled with our session information
                authentication = _systemClient.Login(ClientSession);
            }
            catch (SemafoneClientException e)
            {
                TpsLogManager <Semafone> .Error("Failed to login to Semafone" + " for " + _webSocket + ": " + e.Message + e.StackTrace);

                if (e.Error != null)
                {
                    TpsLogManager <Semafone> .Error("Failed to EnterSecureMode : " + e.Error.cause);
                }
            }

            try
            {
                if (authentication != AuthenticationState.Authenticated)
                {
                    // If we failed to login, we cannot proceed
                    TpsLogManager <Semafone> .Error("Not authenticated, cannot proceed");
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                TpsLogManager <Semafone> .Error("Failed to login to Semafone: Checking Authentication state :  " + e.Message + e.StackTrace);
            }
            return(false);
        }