Changeset 220

Show
Ignore:
Timestamp:
12/06/06 10:58:05 (2 years ago)
Author:
sacha
Message:

moved error directory per party to a different location
added create error directive method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/message-handling-refactor-branch/bin/run-statistics.sh

    r212 r220  
    2424echo -n "Coronation incoming payloads  : " 
    2525ls -A $SPOOL_DIR/coronation/incoming/payloads | wc -l 
     26echo -n "Coronation errors             : " 
     27ls -A $SPOOL_DIR/coronation/errors | wc -l 
    2628echo 
    2729echo -n "Gnaraloo incoming directives: " 
     
    2931echo -n "Gnaraloo incoming payloads  : " 
    3032ls -A $SPOOL_DIR/gnaraloo/incoming/payloads | wc -l 
     33echo -n "Gnaraloo errors             : " 
     34ls -A $SPOOL_DIR/gnaraloo/errors | wc -l 
    3135echo 
    3236 
  • branches/message-handling-refactor-branch/src/hefeweizen_library_directive.rb

    r177 r220  
    7777 
    7878        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> 
     96EOF 
     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> 
     107EOF 
     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 
    79113      end 
    80114 
  • branches/message-handling-refactor-branch/src/hefeweizen_library_integration_point.rb

    r177 r220  
    2727            integration_point_config = Hash.new 
    2828            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 
    3234                @logger.debug "Integration point: #{$1} with value #{$2}." 
    3335                integration_point_config[$1] = $2 
     
    7173          end 
    7274           
    73           if usage == "outgoing: directive-dir:" then 
     75          if usage == "outgoing: directive-directory:" then 
    7476            # 
    7577            # create a long living tasker that monitors this directory. 
     
    102104      def get_incoming_directive_directory 
    103105        @integration_config.each_pair{ | usage, path | 
    104           if usage == 'incoming: directive-dir:' then 
     106          if usage == 'incoming: directive-directory:' then 
    105107            return "#{@config['SPOOL_DIR']}/#{path}" 
    106108          end 
     
    111113      def get_incoming_payloads_directory 
    112114        @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 
    114125            return "#{@config['SPOOL_DIR']}/#{path}" 
    115126          end