public Session CreateSession(SessionCriteria criteria) { var session = new Session(Validator); // Map properties return(session); }
/// <summary> /// Read packet data from the stream /// </summary> protected override void OnRead(Stream stream) { BinarySerializer.DeserializeValue(stream, out m_SessionId); int rawCriteria; BinarySerializer.DeserializeValue(stream, out rawCriteria); m_Criteria = (SessionCriteria)rawCriteria; }
public SessionInfo[] GetActiveSessions(SessionCriteria criteria) { using (var proxy = new SessionProxy()) { if (criteria == null) { return proxy.GetActiveSessions(); } return proxy.GetActiveSessions(criteria.UserName, criteria.IPAddress, criteria.HostName, criteria.LoginTimeFrom, criteria.LoginTimeTill, criteria.LastActivityTimeFrom, criteria.LastActivityTimeTill); } }
public SessionCriteriaPredicate(string productName, string applicationName, SessionCriteria criteria) { m_ProductName = productName; m_ApplicationName = applicationName; m_Criteria = criteria; //now parse out the criteria m_ActiveSession = ((m_Criteria & SessionCriteria.ActiveSession) == SessionCriteria.ActiveSession); m_NewSessions = ((m_Criteria & SessionCriteria.NewSessions) == SessionCriteria.NewSessions); m_CompletedSessions = ((m_Criteria & SessionCriteria.CompletedSessions) == SessionCriteria.CompletedSessions); m_CrashedSessions = ((m_Criteria & SessionCriteria.CrashedSessions) == SessionCriteria.CrashedSessions); m_CriticalSessions = ((m_Criteria & SessionCriteria.CriticalSessions) == SessionCriteria.CriticalSessions); m_ErrorSessions = ((m_Criteria & SessionCriteria.ErrorSessions) == SessionCriteria.ErrorSessions); m_WarningSessions = ((m_Criteria & SessionCriteria.WarningSessions) == SessionCriteria.WarningSessions); }
public ISession StartSession(SessionCriteria criteria) { var session = Repository.GetSession(criteria); if (session == null) { session = Factory.CreateSession(criteria); } else if (!session.CanResume) { thrown new InvalidOperationException("Cannot resume the session."); } return(session); }
/// <summary> /// Create a new send session command for the specified session id and criteria /// </summary> /// <param name="sessionId"></param> /// <param name="criteria"></param> public SendSessionCommandMessage(Guid sessionId, SessionCriteria criteria) : this() { SessionId = sessionId; Criteria = criteria; }
/// <summary> /// Asynchronously send sessions to a Loupe Server using the current agent configuration /// </summary> /// <param name="sessions">The set of match rules to apply to sessions to determine what to send.</param> /// <param name="markAsRead">True to have every included session marked as read upon successful completion.</param> /// <param name="purgeSentSessions">True to have every included session removed from the local repository upon successful completion.</param> /// <param name="serverConfiguration">Optional. The connection options to use instead of the current configured server connection</param> /// <remarks>The EndSend event will be raised when the send operation completes. Because sessions are /// sent one by one, they will be individually marked as read once sent.</remarks> public void SendToServerAsync(SessionCriteria sessions, bool markAsRead, bool purgeSentSessions, ServerConfiguration serverConfiguration = null) { m_Packager.SendToServer(sessions, markAsRead, purgeSentSessions, true, serverConfiguration); }
/// <summary>Send sessions to a Loupe Server using the current agent configuration</summary> /// <remarks>The EndSend event will be raised when the send operation completes. Because sessions are /// sent one by one, they will be individually marked as read once sent.</remarks> /// <overloads>Send sessions to the Loupe Server</overloads> /// <param name="sessions">The set of match rules to apply to sessions to determine what to send.</param> /// <param name="markAsRead">True to have every included session marked as read upon successful completion.</param> /// <param name="serverConfiguration">Optional. The connection options to use instead of the current configured server connection</param> /// <exception cref="GibraltarException">The server couldn't be contacted or there was a communication error.</exception> /// <exception cref="ArgumentException">The server configuration specified is invalid.</exception> public void SendToServer(SessionCriteria sessions, bool markAsRead, ServerConfiguration serverConfiguration = null) { m_Packager.SendToServer(sessions, markAsRead, false, false, serverConfiguration); }
/// <summary> /// Asynchronously write the completed package to the provided full file name /// (without extension) and path. The extension will be set to glp automatically. /// </summary> /// <remarks>The EndSend event will be raised when the send operation completes. /// Any provided extension will be removed and replaced with the standard Loupe package extension.</remarks> /// <param name="sessions">The set of match rules to apply to sessions to determine what to send.</param> /// <param name="markAsRead">True to have every included session marked as read upon successful completion.</param> /// <param name="fullFileNamePath">The file name and path to write the final package to.</param> /// <exception cref="ArgumentNullException">A required parameter was null.</exception> /// <exception cref="ArgumentOutOfRangeException">The provided file information is not a fully qualified file name and path.</exception> public void SendToFileAsync(SessionCriteria sessions, bool markAsRead, string fullFileNamePath) { m_Packager.SendToFile(sessions, markAsRead, fullFileNamePath, true); }
public IEnumerable <Session> GetSessions(SessionCriteria criteria) { using (HistoryRepository repository = this.CreateRepository()) return(repository.GetSessions(criteria)); }
public void ShowSessionList(SessionCriteria sessionCriteria) { this.ug_sessionlist.Focus(); using (AsyncWorker<ISessionManagementView> worker = new AsyncWorker<ISessionManagementView>(_presenter, this.ug_sessionlist, new Control[] { refreshButton })) { worker.DoWork += delegate(object oDoWork, DoWorkEventArgs eDoWork) { eDoWork.Result = _presenter.GetActiveSessions(sessionCriteria); }; worker.RunWorkerCompleted += delegate(object oCompleted, RunWorkerCompletedEventArgs eCompleted) { SessionInfo[] sessions = eCompleted.Result as SessionInfo[]; if (sessions == null) { return; } this._sessionList.Clear(); foreach (SessionInfo sessionInfo in sessions) { this._sessionList.Add(sessionInfo.SessionID, sessionInfo); } this.ug_sessionlist.DataSource = sessions; this.ug_sessionlist.DataBind(); this.lbl_totalsessionnumber.Text = this.ug_sessionlist.Rows.Count.ToString(); }; worker.Run(); } }