saveSession() public method

Save a ApplicationSession object and it's requests
public saveSession ( ApplicationSession session ) : gov.va.medora.mdws.dto.BoolTO
session ApplicationSession The session object to save
return gov.va.medora.mdws.dto.BoolTO
Exemplo n.º 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));
        }
Exemplo n.º 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);
 }