Changeset 4730
- Timestamp:
- 06/23/08 21:54:57 (5 months ago)
- Files:
-
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/EC2 (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/Exception (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/Exception/AmazonSimpleDBException.cs (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/Exception/Error.cs (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/Exception/ErrorResponse.cs (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/Nuxleus.Extension.Aws.csproj (modified) (1 diff)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/S3 (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/SQS (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Model/Domain.cs (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Model/Item.cs (added)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Task/PutAttributes.cs (modified) (1 diff)
- trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Task/Query.cs (modified) (6 diffs)
- trunk/nuxleus/Source/Nuxleus.Extension/Nuxleus.Extension.csproj (modified) (3 diffs)
- trunk/nuxleus/Source/Nuxleus.Web/HttpHandler/NuxleusHttpAsyncXmlServiceOperationHandler.cs (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/nuxleus/Source/Nuxleus.Extension.Aws/Nuxleus.Extension.Aws.csproj
r4729 r4730 146 146 </ItemGroup> 147 147 <ItemGroup> 148 <Folder Include="EC2\" /> 149 <Folder Include="S3\" /> 150 <Folder Include="SQS\" /> 148 151 <Folder Include="Utils\" /> 149 152 </ItemGroup> trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Task/PutAttributes.cs
r4729 r4730 56 56 } 57 57 58 /// <summary> 59 /// 60 /// </summary> 61 /// <typeparam name="T"></typeparam> 62 /// <param name="responseList"></param> 63 /// <returns>IEnumerable<IAsync></returns> 58 64 public IEnumerable<IAsync> Invoke<T>(Dictionary<IRequest, T> responseList) { 59 65 Init(); trunk/nuxleus/Source/Nuxleus.Extension.Aws/SimpleDB/Task/Query.cs
r4729 r4730 3 3 using System.Xml.Serialization; 4 4 using Nuxleus.Asynchronous; 5 using Nuxleus.Extension.Log; 5 6 6 7 namespace Nuxleus.Extension.Aws.SimpleDb { … … 18 19 IResponse m_response; 19 20 21 /// <summary> 22 /// gets or sets the domain name to query 23 /// </summary> 20 24 [XmlElementAttribute(ElementName = "DomainName")] 21 25 public String DomainName { … … 26 30 } 27 31 32 /// <summary> 33 /// gets or sets the query expression 34 /// </summary> 28 35 [XmlElementAttribute(ElementName = "QueryExpression")] 29 36 public String QueryExpression { … … 36 43 } 37 44 45 /// <summary> 46 /// gets or sets the maximum number of items to return in the result 47 /// </summary> 38 48 [XmlElementAttribute(ElementName = "MaxNumberOfItems")] 39 49 public String MaxNumberOfItems { … … 42 52 } 43 53 54 /// <summary> 55 /// gets or sets the token that should be used if more results exist 56 /// </summary> 44 57 [XmlElementAttribute(ElementName = "NextToken")] 45 58 public String NextToken { … … 50 63 #region ITask Members 51 64 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> 56 68 public IRequest Request { 57 69 get { throw new NotImplementedException(); } trunk/nuxleus/Source/Nuxleus.Extension/Nuxleus.Extension.csproj
r4649 r4730 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 <ProductVersion>9.0. 20706</ProductVersion>6 <ProductVersion>9.0.30428</ProductVersion> 7 7 <SchemaVersion>2.0</SchemaVersion> 8 8 <ProjectGuid>{3EC9EEB0-71CA-4F71-BF8E-AAF0365D4234}</ProjectGuid> … … 50 50 </PropertyGroup> 51 51 <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> 52 56 <Reference Include="System" /> 53 57 <Reference Include="System.configuration" /> … … 62 66 <ItemGroup> 63 67 <Compile Include="Agent.cs" /> 68 <Compile Include="Log\Log.cs" /> 64 69 <Compile Include="Properties\AssemblyInfo.cs" /> 65 70 <Compile Include="StringUtils\Substring.cs" /> trunk/nuxleus/Source/Nuxleus.Web/HttpHandler/NuxleusHttpAsyncXmlServiceOperationHandler.cs
r4728 r4730 32 32 using Nuxleus.Agent; 33 33 using System.Xml.XPath; 34 using Nuxleus.Extension.Log; 34 35 35 36 namespace Nuxleus.Web.HttpHandler { … … 62 63 bool m_USE_MEMCACHED; 63 64 static HashAlgorithm m_hashAlgorithm = HashAlgorithm.SHA1; 64 XmlWriter m_debugXmlWriter;65 65 string m_lastModifiedKey; 66 66 string m_lastModifiedDate; … … 69 69 TransformRequest m_request; 70 70 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();76 71 77 72 public void ProcessRequest ( HttpContext context ) { … … 90 85 91 86 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); 93 88 m_CONTENT_IS_MEMCACHED = false; 94 89 m_USE_MEMCACHED = false; … … 109 104 m_xmlReaderDictionary = m_xmlServiceOperationManager.XmlReaderDictionary; 110 105 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); 112 107 m_nuxleusAsyncResult = new Nuxleus.Agent.NuxleusAsyncResult(cb, extraData); 113 108 m_callback = cb; … … 131 126 for (int i = 0; headers.MoveNext(); i++) { 132 127 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]); 134 129 } 135 130 bool hasXmlSourceChanged = m_xmlServiceOperationManager.HasXmlSourceChanged(m_context.RequestXmlETag, requestUri); … … 160 155 case "GET": 161 156 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 } 197 188 } 198 189 case "PUT": { … … 214 205 Process: 215 206 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); 218 209 219 210 XPathNavigator navigator = m_xmlServiceOperationManager.GetXPathNavigator(m_context.RequestXmlETag, requestUri); … … 221 212 // initialReader = reader; 222 213 //} 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)); 224 215 //} 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()); 227 218 XPathServiceOperationNavigator serviceOperationReader = new XPathServiceOperationNavigator(context, m_context, m_transformContext, navigator, m_request, m_response, m_xslTransformationManager); 228 219 m_response = serviceOperationReader.Process(); 229 220 230 221 } catch (Exception e) { 231 m_logger.DebugFormat("Error: {0} in transformation.", e.Message);222 this.LogDebug("Error: {0} in transformation.", e.Message); 232 223 m_exception = e; 233 224 WriteError(); … … 237 228 238 229 CompleteCall: 239 m_logger.Debug("CompleteCall reached");230 this.LogDebug("CompleteCall reached"); 240 231 if (m_lastModifiedDate == String.Empty) { 241 232 m_lastModifiedDate = DateTime.UtcNow.ToString("r"); … … 256 247 } 257 248 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); 259 250 m_memcachedClient.Set(m_context.GetRequestHashcode(true).ToString(), output, DateTime.Now.AddHours(24)); 260 251 m_memcachedClient.Set(m_lastModifiedKey, m_lastModifiedDate); … … 262 253 //} 263 254 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); 265 256 m_stopwatch.Reset(); 266 257 }
