Changeset 4730 for trunk/nuxleus

Show
Ignore:
Timestamp:
06/23/08 21:54:57 (5 months ago)
Author:
xmlhacker
Message:

various extensions to the slow developing SOAP framework

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/nuxleus/Source/Nuxleus.Extension.Aws/Nuxleus.Extension.Aws.csproj

    r4729 r4730  
    146146  </ItemGroup> 
    147147  <ItemGroup> 
     148    <Folder Include="EC2\" /> 
     149    <Folder Include="S3\" /> 
     150    <Folder Include="SQS\" /> 
    148151    <Folder Include="Utils\" /> 
    149152  </ItemGroup> 
  • trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Task/PutAttributes.cs

    r4729 r4730  
    5656        } 
    5757 
     58        /// <summary> 
     59        ///  
     60        /// </summary> 
     61        /// <typeparam name="T"></typeparam> 
     62        /// <param name="responseList"></param> 
     63        /// <returns>IEnumerable<IAsync></returns> 
    5864        public IEnumerable<IAsync> Invoke<T>(Dictionary<IRequest, T> responseList) { 
    5965            Init(); 
  • trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Task/Query.cs

    r4729 r4730  
    33using System.Xml.Serialization; 
    44using Nuxleus.Asynchronous; 
     5using Nuxleus.Extension.Log; 
    56 
    67namespace Nuxleus.Extension.Aws.SimpleDb { 
     
    1819        IResponse m_response; 
    1920 
     21        /// <summary> 
     22        /// gets or sets the domain name to query 
     23        /// </summary> 
    2024        [XmlElementAttribute(ElementName = "DomainName")] 
    2125        public String DomainName { 
     
    2630        } 
    2731 
     32        /// <summary> 
     33        /// gets or sets the query expression 
     34        /// </summary> 
    2835        [XmlElementAttribute(ElementName = "QueryExpression")] 
    2936        public String QueryExpression { 
     
    3643        } 
    3744 
     45        /// <summary> 
     46        /// gets or sets the maximum number of items to return in the result 
     47        /// </summary> 
    3848        [XmlElementAttribute(ElementName = "MaxNumberOfItems")] 
    3949        public String MaxNumberOfItems { 
     
    4252        } 
    4353 
     54        /// <summary> 
     55        /// gets or sets the token that should be used if more results exist 
     56        /// </summary> 
    4457        [XmlElementAttribute(ElementName = "NextToken")] 
    4558        public String NextToken { 
     
    5063        #region ITask Members 
    5164 
    52         public RequestType RequestType { 
    53             get { throw new NotImplementedException(); } 
    54         } 
    55  
     65        /// <summary> 
     66        /// gets the <c>IRequest</c> for this <c>ITask</c> 
     67        /// </summary> 
    5668        public IRequest Request { 
    5769            get { throw new NotImplementedException(); } 
  • trunk/nuxleus/Source/Nuxleus.Extension/Nuxleus.Extension.csproj

    r4649 r4730  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 
    6     <ProductVersion>9.0.20706</ProductVersion> 
     6    <ProductVersion>9.0.30428</ProductVersion> 
    77    <SchemaVersion>2.0</SchemaVersion> 
    88    <ProjectGuid>{3EC9EEB0-71CA-4F71-BF8E-AAF0365D4234}</ProjectGuid> 
     
    5050  </PropertyGroup> 
    5151  <ItemGroup> 
     52    <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL"> 
     53      <SpecificVersion>False</SpecificVersion> 
     54      <HintPath>..\Dependencies\log4net.dll</HintPath> 
     55    </Reference> 
    5256    <Reference Include="System" /> 
    5357    <Reference Include="System.configuration" /> 
     
    6266  <ItemGroup> 
    6367    <Compile Include="Agent.cs" /> 
     68    <Compile Include="Log\Log.cs" /> 
    6469    <Compile Include="Properties\AssemblyInfo.cs" /> 
    6570    <Compile Include="StringUtils\Substring.cs" /> 
  • trunk/nuxleus/Source/Nuxleus.Web/HttpHandler/NuxleusHttpAsyncXmlServiceOperationHandler.cs

    r4728 r4730  
    3232using Nuxleus.Agent; 
    3333using System.Xml.XPath; 
     34using Nuxleus.Extension.Log; 
    3435 
    3536namespace Nuxleus.Web.HttpHandler { 
     
    6263        bool m_USE_MEMCACHED; 
    6364        static HashAlgorithm m_hashAlgorithm = HashAlgorithm.SHA1; 
    64         XmlWriter m_debugXmlWriter; 
    6565        string m_lastModifiedKey; 
    6666        string m_lastModifiedDate; 
     
    6969        TransformRequest m_request; 
    7070        TransformResponse m_response; 
    71         NuxleusAgentAsyncRequest m_transformRequest; 
    72         Transform.Agent m_agent; 
    73         IAsyncResult m_asyncResult; 
    74         XmlReader initialReader; 
    75         static ILog m_logger = Web.Agent<NuxleusHttpAsyncXmlServiceOperationHandler>.GetBasicLogger(); 
    7671 
    7772        public void ProcessRequest ( HttpContext context ) { 
     
    9085 
    9186            FileInfo fileInfo = new FileInfo(context.Request.MapPath(context.Request.CurrentExecutionFilePath)); 
    92             m_logger.DebugFormat("File Date: {0}; File Length: {1}", fileInfo.LastWriteTimeUtc, fileInfo.Length); 
     87            this.LogDebug("File Date: {0}; File Length: {1}", fileInfo.LastWriteTimeUtc, fileInfo.Length); 
    9388            m_CONTENT_IS_MEMCACHED = false; 
    9489            m_USE_MEMCACHED = false; 
     
    109104            m_xmlReaderDictionary = m_xmlServiceOperationManager.XmlReaderDictionary; 
    110105            m_context = new Context(context, m_hashAlgorithm, m_hashkey, fileInfo, fileInfo.LastWriteTimeUtc, fileInfo.Length); 
    111             m_logger.DebugFormat("File Date: {0}; File Length: {1}", m_context.RequestXmlFileInfo.LastWriteTimeUtc, m_context.RequestXmlFileInfo.Length); 
     106            this.LogDebug("File Date: {0}; File Length: {1}", m_context.RequestXmlFileInfo.LastWriteTimeUtc, m_context.RequestXmlFileInfo.Length); 
    112107            m_nuxleusAsyncResult = new Nuxleus.Agent.NuxleusAsyncResult(cb, extraData); 
    113108            m_callback = cb; 
     
    131126            for (int i = 0; headers.MoveNext(); i++) { 
    132127                string local = context.Request.Headers.AllKeys[i].ToString(); 
    133                 m_logger.DebugFormat("KeyName: {0}, KeyValue: {1}", local, context.Request.Headers[local]); 
     128                this.LogDebug("KeyName: {0}, KeyValue: {1}", local, context.Request.Headers[local]); 
    134129            } 
    135130            bool hasXmlSourceChanged = m_xmlServiceOperationManager.HasXmlSourceChanged(m_context.RequestXmlETag, requestUri); 
     
    160155                    case "GET": 
    161156                    case "HEAD": 
    162                     case "POST": { 
    163                             //string name = String.Format("Name: {0}", context.Request.QueryString["name"]); 
    164                             //m_logger.DebugFormat("QueryString Length: {0}", context.Request.QueryString.Count); 
    165                             //m_logger.DebugFormat(name); 
    166                             //m_logger.DebugFormat("If-None-Match: {0}, RequestHashCode: {1}", context.Request.Headers["If-None-Match"], m_requestHashcode); 
    167                             //m_logger.DebugFormat(context.Request.Path); 
    168                             //if (context.Request.Headers["If-None-Match"] == m_requestHashcode) { 
    169                             //    m_logger.Debug("They matched."); 
    170                             //    m_logger.DebugFormat("Use memcached: {0}, KeyExists: {1}, XmlSource Changed: {2}", m_USE_MEMCACHED, m_memcachedClient.KeyExists(m_lastModifiedKey), hasXmlSourceChanged); 
    171                             //    m_logger.DebugFormat("Last Modified Key Value: {0}", m_lastModifiedKey); 
    172                             //    if (m_USE_MEMCACHED && m_memcachedClient.KeyExists(m_lastModifiedKey) && !hasXmlSourceChanged) { 
    173                             //        m_lastModifiedDate = (string)m_memcachedClient.Get(m_lastModifiedKey); 
    174                             //        m_logger.DebugFormat("Last Modified Date: {0}", m_lastModifiedDate); 
    175                             //        if (context.Request.Headers["If-Modified-Since"] == m_lastModifiedDate) { 
    176  
    177                             //            context.Response.StatusCode = 304; 
    178                             //            m_returnOutput = false; 
    179                             //            goto CompleteCall; 
    180                             //        } else { 
    181                             //            goto Process; 
    182                             //        } 
    183                             //    } else if (m_CONTENT_IS_MEMCACHED) { 
    184                             //        goto CompleteCall; 
    185                             //    } else { 
    186                             //        goto Process; 
    187                             //    } 
    188                             //} else { 
    189                             //    m_logger.Debug("Headers do not match.  Beginning transformation process..."); 
    190                             //    m_returnOutput = true; 
    191                             //    goto Process; 
    192                             //} 
    193                             //break; 
    194  
    195                             m_returnOutput = true; 
    196                             goto Process; 
     157                    case "POST": {                      
     158                            string name = String.Format("Name: {0}", context.Request.QueryString["name"]); 
     159                            this.LogDebug("QueryString Length: {0}", context.Request.QueryString.Count); 
     160                            this.LogDebug(name); 
     161                            this.LogDebug("If-None-Match: {0}, RequestHashCode: {1}", context.Request.Headers["If-None-Match"], m_requestHashcode); 
     162                            this.LogDebug(context.Request.Path); 
     163                            if (context.Request.Headers["If-None-Match"] == m_requestHashcode) { 
     164                                this.LogDebug("They matched."); 
     165                                this.LogDebug("Use memcached: {0}, KeyExists: {1}, XmlSource Changed: {2}", m_USE_MEMCACHED, m_memcachedClient.KeyExists(m_lastModifiedKey), hasXmlSourceChanged); 
     166                                this.LogDebug("Last Modified Key Value: {0}", m_lastModifiedKey); 
     167                                if (m_USE_MEMCACHED && m_memcachedClient.KeyExists(m_lastModifiedKey) && !hasXmlSourceChanged) { 
     168                                    m_lastModifiedDate = (string)m_memcachedClient.Get(m_lastModifiedKey); 
     169                                    this.LogDebug("Last Modified Date: {0}", m_lastModifiedDate); 
     170                                    if (context.Request.Headers["If-Modified-Since"] == m_lastModifiedDate) { 
     171 
     172                                        context.Response.StatusCode = 304; 
     173                                        m_returnOutput = false; 
     174                                        goto CompleteCall; 
     175                                    } else { 
     176                                        goto Process; 
     177                                    } 
     178                                } else if (m_CONTENT_IS_MEMCACHED) { 
     179                                    goto CompleteCall; 
     180                                } else { 
     181                                    goto Process; 
     182                                } 
     183                            } else { 
     184                                this.LogDebug("Headers do not match.  Beginning transformation process..."); 
     185                                m_returnOutput = true; 
     186                                goto Process; 
     187                            } 
    197188                        } 
    198189                    case "PUT": { 
     
    214205        Process: 
    215206            try { 
    216                 m_logger.Debug("Processing Transformation"); 
    217                 m_logger.DebugFormat("Request XML ETag Value: {0}, Request URI: {1}", m_context.RequestXmlETag, requestUri); 
     207                this.LogDebug("Processing Transformation"); 
     208                this.LogDebug("Request XML ETag Value: {0}, Request URI: {1}", m_context.RequestXmlETag, requestUri); 
    218209 
    219210                XPathNavigator navigator = m_xmlServiceOperationManager.GetXPathNavigator(m_context.RequestXmlETag, requestUri); 
     
    221212                //    initialReader = reader; 
    222213                //} else { 
    223                 //    m_logger.DebugFormat("XmlReaders are the same object: {0}", initialReader.Equals(reader)); 
     214                //    this.LogDebug("XmlReaders are the same object: {0}", initialReader.Equals(reader)); 
    224215                //} 
    225                 //m_logger.DebugFormat("XML Reader Value: {0}", reader.ReadOuterXml()); 
    226                 //m_logger.DebugFormat("XML Reader Hash: {0}", reader.GetHashCode()); 
     216                //this.LogDebug("XML Reader Value: {0}", reader.ReadOuterXml()); 
     217                //this.LogDebug("XML Reader Hash: {0}", reader.GetHashCode()); 
    227218                XPathServiceOperationNavigator serviceOperationReader = new XPathServiceOperationNavigator(context, m_context, m_transformContext, navigator, m_request, m_response, m_xslTransformationManager); 
    228219                m_response = serviceOperationReader.Process(); 
    229220 
    230221            } catch (Exception e) { 
    231                 m_logger.DebugFormat("Error: {0} in transformation.", e.Message); 
     222                this.LogDebug("Error: {0} in transformation.", e.Message); 
    232223                m_exception = e; 
    233224                WriteError(); 
     
    237228 
    238229        CompleteCall: 
    239             m_logger.Debug("CompleteCall reached"); 
     230            this.LogDebug("CompleteCall reached"); 
    240231            if (m_lastModifiedDate == String.Empty) { 
    241232                m_lastModifiedDate = DateTime.UtcNow.ToString("r"); 
     
    256247            } 
    257248            if (!m_CONTENT_IS_MEMCACHED && m_USE_MEMCACHED) { 
    258                 m_logger.DebugFormat("Adding Last Modified Key: {0}", m_lastModifiedKey); 
     249                this.LogDebug("Adding Last Modified Key: {0}", m_lastModifiedKey); 
    259250                m_memcachedClient.Set(m_context.GetRequestHashcode(true).ToString(), output, DateTime.Now.AddHours(24)); 
    260251                m_memcachedClient.Set(m_lastModifiedKey, m_lastModifiedDate); 
     
    262253            //} 
    263254            m_stopwatch.Stop(); 
    264             m_logger.DebugFormat("Total processing time: {0} ms", m_stopwatch.ElapsedMilliseconds); 
     255            this.LogDebug("Total processing time: {0} ms", m_stopwatch.ElapsedMilliseconds); 
    265256            m_stopwatch.Reset(); 
    266257        }