From d46511d384c01d2afe1c91a5418c3df6fb215a48 Mon Sep 17 00:00:00 2001 From: agibert Date: Tue, 11 Dec 2007 16:50:50 +0000 Subject: [PATCH] Add sleep time option "-st". --- MQSSave.java | 68 +++++++++++++++++++++++++++++++++++++++++++----- ReadMe.txt | 8 +++--- ReleaseNotes.txt | 28 +++++++++++++------- 3 files changed, 84 insertions(+), 20 deletions(-) diff --git a/MQSSave.java b/MQSSave.java index efc8830..25efa1d 100644 --- a/MQSSave.java +++ b/MQSSave.java @@ -1,7 +1,7 @@ // $RCSfile: MQSSave.java,v $ -// $Revision: 1.12 $ +// $Revision: 1.13 $ // $Name: $ -// $Date: 2007/06/05 09:27:44 $ +// $Date: 2007/12/11 16:50:50 $ // $Author: agibert $ /* @@ -47,10 +47,11 @@ public class MQSSave private boolean Trim_Mode = false; private boolean MBTrailer_Mode = false; private int Total_Nb = 0, Moved_Nb = 0, Skiped_Nb = 0, Scaned_Nb = 0, Flushed_Nb = 0; - private String MQSSave_Revision = "$Revision: 1.12 $"; + private String MQSSave_Revision = "$Revision: 1.13 $"; private String MQSSave_Tag = "$Name: $"; - private String MQSSave_Date = "$Date: 2007/06/05 09:27:44 $"; + private String MQSSave_Date = "$Date: 2007/12/11 16:50:50 $"; private String MQSSave_Author = "$Author: agibert $"; + private Integer Sleep_Time = 0; @@ -242,6 +243,18 @@ public class MQSSave throw new Exception(); } } + else if ( args[argc].equals( "-st")) + { + if( argc < ( args.length + 1)) + { + Sleep_Time = Integer.parseInt( args[++argc]); + } + else + { + System.out.println( "Invalid number of command line options..."); + throw new Exception(); + } + } else if ( args[argc].equals( "-tisbm")) { if( Copy_Mode == false) @@ -500,6 +513,32 @@ public class MQSSave + //------------------------------------------------------------------------------------------------------------------------- + // + //------------------------------------------------------------------------------------------------------------------------- + + private void Stand_By(int timer) + { + if( timer > 0) + { + try + { + synchronized( this) + { + wait( timer); + } + } + catch(InterruptedException ie) + { + ie.printStackTrace(); + } + } + } + + + + + //------------------------------------------------------------------------------------------------------------------------- // //------------------------------------------------------------------------------------------------------------------------- @@ -546,6 +585,8 @@ public class MQSSave if( mode == MODE_FULLMOVE) { Counter_Print( Total_Nb++, '.'); + + Stand_By( Sleep_Time); if( Moved_Nb > 1) { @@ -582,6 +623,8 @@ public class MQSSave { // System.out.print( "FB1 "); Counter_Print( Total_Nb++, '#'); + + Stand_By( Sleep_Time); MQSDelete_Msg( input_msg); @@ -600,6 +643,8 @@ public class MQSSave // System.out.print( "FEA "); Counter_Print( Total_Nb++, '#'); + Stand_By( Sleep_Time); + MQSDelete_Msg( input_msg); } else if( msg_type.equals( TYPE_SWIFTOUT)) @@ -607,6 +652,8 @@ public class MQSSave // System.out.print( "FO "); Counter_Print( Total_Nb++, '*'); + Stand_By( Sleep_Time); + if( Flushed_Nb > 1) { Flush_File.write( Message_Break.getBytes()); @@ -691,6 +738,9 @@ public class MQSSave } Counter_Print( Total_Nb++, '~'); + + Stand_By( Sleep_Time); + break; } @@ -701,6 +751,8 @@ public class MQSSave // System.out.print( "MB "); Counter_Print( Total_Nb++, '#'); + Stand_By( Sleep_Time); + MQSDelete_Msg( input_msg); } else if( msg_type.equals( TYPE_SWIFTEND)) @@ -708,6 +760,8 @@ public class MQSSave // System.out.print( "ME "); Counter_Print( Total_Nb++, '#'); + Stand_By( Sleep_Time); + MQSDelete_Msg( input_msg); mode = MODE_SCAN; @@ -723,6 +777,8 @@ public class MQSSave // System.out.print( "MO "); Counter_Print( Total_Nb++, '.'); + Stand_By( Sleep_Time); + if( Moved_Nb > 1) { Output_File.write( Message_Break.getBytes()); @@ -795,7 +851,7 @@ public class MQSSave if( ( args.length < 2) || ( args.length > 7)) { System.out.println( "Usage: MQSSave [-qm \"Input_QueueMng_Name\"] [-mb \"message_break\"] [-tisbm [-ffn ] | -cm ] [-tm] [-mbtm] "); - System.out.println( " Default: Input QueueMng Name: (" + QMng_Name + ") Message Break: (" + Str_UnFormat( Message_Break) + ") TI Swift Batch Mode: (" + TI_Swift_Batch_Mode + ") Copy Mode: (" + Copy_Mode + ") Flush File Name: (" + Flush_File_Name + ") Trim Mode: (" + Trim_Mode + ") MsgBreak Trailer Mode: (" + MBTrailer_Mode + ")"); + System.out.println( " Default: Input QueueMng Name: (" + QMng_Name + ") Message Break: (" + Str_UnFormat( Message_Break) + ") TI Swift Batch Mode: (" + TI_Swift_Batch_Mode + ") Copy Mode: (" + Copy_Mode + ") Flush File Name: (" + Flush_File_Name + ") Sleep Time: (" + Sleep_Time + ") Trim Mode: (" + Trim_Mode + ") MsgBreak Trailer Mode: (" + MBTrailer_Mode + ")"); System.exit( 1); } @@ -805,7 +861,7 @@ public class MQSSave Arg_Parse( args); - System.out.println( "Output File Name: (" + Output_File_Name + ") Input QueueMng Name: (" + QMng_Name + ") Input MsgQue Name: (" + MsgQ_Name + ") Flush File Name: (" + Flush_File_Name + ")"); + System.out.println( "Output File Name: (" + Output_File_Name + ") Input QueueMng Name: (" + QMng_Name + ") Input MsgQue Name: (" + MsgQ_Name + ") Flush File Name: (" + Flush_File_Name + ") Sleep Time: (" + Sleep_Time + ")"); System.out.println( "Message Break: (" + Str_UnFormat( Message_Break) + ") TI Swift Batch Mode: (" + TI_Swift_Batch_Mode + ") Copy Mode: (" + Copy_Mode + ") Trim Mode: (" + Trim_Mode + ") MsgBreak Trailer Mode: (" + MBTrailer_Mode + ")"); MQSInit(); diff --git a/ReadMe.txt b/ReadMe.txt index ccd5c9f..36f4c17 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -1,8 +1,8 @@ # $RCSfile: ReadMe.txt,v $ -# $Revision: 1.4 $ +# $Revision: 1.5 $ # $Name: $ -# $Date: 2002/05/21 16:07:17 $ -# $Author: giberta1 $ +# $Date: 2007/12/11 16:50:50 $ +# $Author: agibert $ @@ -24,7 +24,7 @@ Installation: Notes: ------ - - MQSSave has been tested with MQ/Series 5.2, + - MQSSave has been tested with MQ/Series 5.2, 5.2, 5.3 and WMQ 6.0. - "-mb" argument accept a string with formated escape character: + "\n" for newline, diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index b99802b..d275fe1 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,7 +1,7 @@ # $RCSfile: ReleaseNotes.txt,v $ -# $Revision: 1.9 $ +# $Revision: 1.10 $ # $Name: $ -# $Date: 2007/06/05 09:29:21 $ +# $Date: 2007/12/11 16:50:50 $ # $Author: agibert $ @@ -9,7 +9,15 @@ -------------------------------------------------------------------------------- -MQSSave V 1.2.0 - A. Gibert - 05/06/07 +MQSSave V 1.3.0 - C. Colin / A. Gibert - 2007/12/10 +-------------------------------------------------------------------------------- + +Add sleep time option "-st". + + + +-------------------------------------------------------------------------------- +MQSSave V 1.2.0 - A. Gibert - 2007/06/05 -------------------------------------------------------------------------------- Add queue manager name option "-qm". @@ -17,7 +25,7 @@ Add queue manager name option "-qm". -------------------------------------------------------------------------------- -MQSSave V 1.1.5 - A. Gibert - 04/09/03 +MQSSave V 1.1.5 - A. Gibert - 2003/09/04 -------------------------------------------------------------------------------- Add message break trailer mode support, @@ -28,7 +36,7 @@ Add "-cm" option. -------------------------------------------------------------------------------- -MQSSave V 1.1.4 - A. Gibert - 29/07/02 +MQSSave V 1.1.4 - A. Gibert - 2002/07/29 -------------------------------------------------------------------------------- Fix trim mode support when tisbm off. @@ -36,7 +44,7 @@ Fix trim mode support when tisbm off. -------------------------------------------------------------------------------- -MQSSave V 1.1.3 - A. Gibert - 21/05/02 +MQSSave V 1.1.3 - A. Gibert - 2002/05/21 -------------------------------------------------------------------------------- Add trim mode support, @@ -48,7 +56,7 @@ Add version, date and author print out. -------------------------------------------------------------------------------- -MQSSave V 1.1.2 - A. Gibert - 13/05/02 +MQSSave V 1.1.2 - A. Gibert - 2002/05/13 -------------------------------------------------------------------------------- Rename SWIFTABORT into SWIFTERROR, @@ -57,7 +65,7 @@ Add Legend printout line. -------------------------------------------------------------------------------- -MQSSave V 1.1.1 - A. Gibert - 06/05/02 +MQSSave V 1.1.1 - A. Gibert - 2002/05/06 -------------------------------------------------------------------------------- Add return code handling. @@ -65,7 +73,7 @@ Add return code handling. -------------------------------------------------------------------------------- -MQSSave V 1.1.0 - A. Gibert - 03/05/02 +MQSSave V 1.1.0 - A. Gibert - 2002/05/03 -------------------------------------------------------------------------------- Add TI Swift batch mode support, @@ -77,7 +85,7 @@ Fix MQSSave usage print: replace MQSLoad by MSSave ! -------------------------------------------------------------------------------- -MQSSave V 1.0.0 - A. Gibert - 23/04/02 +MQSSave V 1.0.0 - A. Gibert - 2002/04/23 -------------------------------------------------------------------------------- First release.