Changeset 220
- Timestamp:
- 12/06/06 10:58:05 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/message-handling-refactor-branch/bin/run-statistics.sh
r212 r220 24 24 echo -n "Coronation incoming payloads : " 25 25 ls -A $SPOOL_DIR/coronation/incoming/payloads | wc -l 26 echo -n "Coronation errors : " 27 ls -A $SPOOL_DIR/coronation/errors | wc -l 26 28 echo 27 29 echo -n "Gnaraloo incoming directives: " … … 29 31 echo -n "Gnaraloo incoming payloads : " 30 32 ls -A $SPOOL_DIR/gnaraloo/incoming/payloads | wc -l 33 echo -n "Gnaraloo errors : " 34 ls -A $SPOOL_DIR/gnaraloo/errors | wc -l 31 35 echo 32 36 branches/message-handling-refactor-branch/src/hefeweizen_library_directive.rb
r177 r220 77 77 78 78 return result 79 end 80 81 # This method creates an error xml file and stores it to the target_directory 82 def HefeWeizenDirective.create_error_directive_and_save target_directory, common_error_description, detail_error_description, optional_file = nil 83 return nil if target_directory.nil? or common_error_description.nil? or detail_error_description.nil? 84 return nil if !FileTest.exists?(target_directory) or !FileTest.directory?(target_directory) or !FileTest.owned?(target_directory) 85 if optional_file then 86 return nil if !FileTest.exists?(optional_file) or FileTest.directory?(optional_file) or !FileTest.readable?(optional_file) 87 end 88 89 error = <<EOF 90 <?xml version="1.0" encoding="UTF-8"?> 91 <Error> 92 <Type>Directive</CpaId> 93 <DateTime>#{Time.now.to_s}</DateTime> 94 <Description>#{common_error_description}</Description> 95 <DetailDescription>#{detail_error_description}</DetailDescription> 96 EOF 97 98 if optional_file then 99 100 error += "<ErrorFileContent>" 101 error += File.read(optional_file) 102 error += "</ErrorFileContent>" 103 end 104 105 error += <<EOF 106 </Error> 107 EOF 108 time = Time.now.to_f.to_s 109 file = File.new("#{target_directory}/error_#{time}", "w") 110 file << error 111 file.sync = true 112 file.close 79 113 end 80 114 branches/message-handling-refactor-branch/src/hefeweizen_library_integration_point.rb
r177 r220 27 27 integration_point_config = Hash.new 28 28 conf.each_line { | line | 29 if line =~ /^(incoming: directive-dir:)\s*(.*)$/ or line =~ /^(incoming: payload-dir:)\s*(.*)$/ \ 30 or line =~ /^(outgoing: directive-dir:)\s*(.*)$/ or line =~ /^(outgoing: payload-dir:)\s*(.*)$/ \ 31 or line =~ /^(outgoing: error-dir:)\s*(.*)$/ then 29 if line =~ /^(incoming: directive-directory:)\s*(.*)$/ or 30 line =~ /^(incoming: payload-directory:)\s*(.*)$/ or 31 line =~ /^(outgoing: directive-directory:)\s*(.*)$/ or 32 line =~ /^(outgoing: payload-directory:)\s*(.*)$/ or 33 line =~ /^(error-directory: )\s*(.*)$/ then 32 34 @logger.debug "Integration point: #{$1} with value #{$2}." 33 35 integration_point_config[$1] = $2 … … 71 73 end 72 74 73 if usage == "outgoing: directive-dir :" then75 if usage == "outgoing: directive-directory:" then 74 76 # 75 77 # create a long living tasker that monitors this directory. … … 102 104 def get_incoming_directive_directory 103 105 @integration_config.each_pair{ | usage, path | 104 if usage == 'incoming: directive-dir :' then106 if usage == 'incoming: directive-directory:' then 105 107 return "#{@config['SPOOL_DIR']}/#{path}" 106 108 end … … 111 113 def get_incoming_payloads_directory 112 114 @integration_config.each_pair{ | usage, path | 113 if usage == 'incoming: payload-dir:' then 115 if usage == 'incoming: payload-directory:' then 116 return "#{@config['SPOOL_DIR']}/#{path}" 117 end 118 } 119 return nil 120 end 121 122 def get_error_directory 123 @integration_config.each_pair{ | usage, path | 124 if usage == 'error-directory:' then 114 125 return "#{@config['SPOOL_DIR']}/#{path}" 115 126 end
