deleteSession() public method

Delete a session by it's ID and all the corresponding saved requests
public deleteSession ( string sessionId ) : gov.va.medora.mdws.dto.BoolTO
sessionId string The session ID to be deleted
return gov.va.medora.mdws.dto.BoolTO
Beispiel #1
0
        /// <summary>
        /// Using the configured SQL connection string, opens a connection to the database and attempts
        /// to wrtie a record from the ApplicationSessions table
        /// </summary>
        /// <returns>BoolTO with true value if read was successful, FaultTO otherwise</returns>
        public BoolTO canWrite()
        {
            UsageDao           dao       = new UsageDao(_connectionString);
            string             sessionId = gov.va.medora.utils.StringUtils.getNCharRandom(24);
            ApplicationSession session   = new ApplicationSession(sessionId, System.Net.IPAddress.Loopback.ToString(), DateTime.Now);

            session.End           = DateTime.Now;
            session.LocalhostName = System.Net.IPAddress.Loopback.ToString();
            ApplicationRequest request = new ApplicationRequest(sessionId, new Uri("http://mdws.va.gov/getSomething"), DateTime.Now, DateTime.Now, "<Soap>...</Soap>", "<Soap>...</Soap>");

            session.Requests.Add(request);
            dao.saveSession(session);
            return(dao.deleteSession(sessionId));
        }
Beispiel #2
0
 /// <summary>
 /// Using the configured SQL connection string, opens a connection to the database and attempts
 /// to wrtie a record from the ApplicationSessions table 
 /// </summary>
 /// <returns>BoolTO with true value if read was successful, FaultTO otherwise</returns>
 public BoolTO canWrite()
 {
     UsageDao dao = new UsageDao(_connectionString);
     string sessionId = gov.va.medora.utils.StringUtils.getNCharRandom(24);
     ApplicationSession session = new ApplicationSession(sessionId, System.Net.IPAddress.Loopback.ToString(), DateTime.Now);
     session.End = DateTime.Now;
     session.LocalhostName = System.Net.IPAddress.Loopback.ToString();
     ApplicationRequest request = new ApplicationRequest(sessionId, new Uri("http://mdws.va.gov/getSomething"), DateTime.Now, DateTime.Now, "<Soap>...</Soap>", "<Soap>...</Soap>");
     session.Requests.Add(request);
     dao.saveSession(session);
     return dao.deleteSession(sessionId);
 }