13 Commits

Author SHA1 Message Date
giberta1
67d8b5f6c4 Add 1.1.5 entry. 2003-09-04 15:47:10 +00:00
giberta1
4bdbc1e2e1 Add Copy Mode (-cm). 2003-09-04 15:42:41 +00:00
giberta1
bf636a2cea Add -mbtm switch,
Implement message break trailer mode.
2002-11-14 13:40:24 +00:00
giberta1
00a78ea920 Add 1.1.4 entry:
Fix trim mode when tisbm off.
2002-07-29 10:00:03 +00:00
giberta1
675a925c00 Add trim_mode support whan TI swift batch mode off. 2002-07-29 09:56:18 +00:00
giberta1
33b67fe311 Add trim mode ("-tm") explanations. 2002-05-21 16:07:17 +00:00
giberta1
9174e00abe Add 1.1.3 entry:
Add trim mode support,
    Add "-tm" option,
    Add MQQueueManager() auto retry,
    Fix flush file name bad parsing bug,
    Add version, date and author print out.
2002-05-21 16:03:38 +00:00
giberta1
f390c41e76 Add version, date and author print out. 2002-05-21 15:44:45 +00:00
giberta1
e807001586 Add trim mode support,
Add "-tm" option,
Add MQQueueManager() auto retry,
Fix flush file name bad parsing bug.
2002-05-21 15:36:28 +00:00
giberta1
b3f10a6962 Add 1.1.2 entry:
Rename SWIFTABORT into SWIFTERROR,
    Add Legend printout line.
2002-05-13 16:38:12 +00:00
giberta1
49d568238e Rename SWIFTABORT message into SWIFTERROR,
Add legend message.
2002-05-13 16:28:02 +00:00
giberta1
a4bb9a9f1b Add 1.1.1 entry:
Add return code handling.
2002-05-06 10:00:34 +00:00
giberta1
781932ee0c Add System.exit() handling. 2002-05-06 09:51:49 +00:00
3 changed files with 163 additions and 30 deletions

View File

@@ -1,11 +1,11 @@
// $RCSfile: MQSSave.java,v $
// $Revision: 1.4 $
// $Revision: 1.11 $
// $Name: $
// $Date: 2002/05/03 17:12:58 $
// $Date: 2003/09/04 15:42:41 $
// $Author: giberta1 $
/*
* MQSSave.java - MQ/Seires queue to data file saver
* MQSSave.java - MQ/Series queue to data file saver
* Copyright (C) 2002 Arnaud G. Gibert
* arnaud.gibert@misys.com
* www.misys.com
@@ -35,7 +35,7 @@ import java.text.*;
public class MQSSave
{
private MQQueueManager QMng;
private MQQueueManager QMng = null;
private String QMng_Name = "";
private MQQueue MsgQ;
private String MsgQ_Name;
@@ -43,7 +43,15 @@ public class MQSSave
private String Output_File_Name, Flush_File_Name = "flush.txt";
private String Message_Break = "\r\n";
private boolean TI_Swift_Batch_Mode = false;
private boolean Copy_Mode = false;
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.11 $";
private String MQSSave_Tag = "$Name: $";
private String MQSSave_Date = "$Date: 2003/09/04 15:42:41 $";
private String MQSSave_Author = "$Author: giberta1 $";
@@ -214,7 +222,7 @@ public class MQSSave
{
if( argc < ( args.length + 1))
{
Flush_File_Name = Str_Format( args[++argc]);
Flush_File_Name = args[++argc];
}
else
{
@@ -223,10 +231,38 @@ public class MQSSave
}
}
else if ( args[argc].equals( "-tisbm"))
{
if( Copy_Mode == false)
{
TI_Swift_Batch_Mode = true;
}
else
{
System.out.println( "Invalid command line option combination: -tisbm and -cm...");
throw new Exception();
}
}
else if ( args[argc].equals( "-cm"))
{
if( TI_Swift_Batch_Mode == false)
{
Copy_Mode = true;
}
else
{
System.out.println( "Invalid command line option combination: -tisbm and -cm...");
throw new Exception();
}
}
else if ( args[argc].equals( "-tm"))
{
Trim_Mode = true;
}
else if ( args[argc].equals( "-mbtm"))
{
MBTrailer_Mode = true;
}
else
{
Output_File_Name = args[argc++];
MsgQ_Name = args[argc++];
@@ -257,6 +293,12 @@ public class MQSSave
//-------------------------------------------------------------------------------------------------------------------------
private void MQSInit() throws Exception
{
short retry = 0;
final short RETRY_MAX = 10;
while( QMng == null)
{
try
{
@@ -265,9 +307,15 @@ public class MQSSave
}
catch( Exception Expt)
{
System.out.print("!");
if( retry++ > RETRY_MAX)
{
throw Expt;
}
}
}
try
{
@@ -457,7 +505,7 @@ public class MQSSave
String msg_type;
final String TYPE_SWIFTBEGIN = "SWIFTBEGIN";
final String TYPE_SWIFTEND = "SWIFTEND ";
final String TYPE_SWIFTABORT = "SWIFTABORT";
final String TYPE_SWIFTERROR = "SWIFTERROR";
final String TYPE_SWIFTOUT = "SWIFTOUT ";
boolean get_first = false;
boolean first_flush = true;
@@ -495,10 +543,19 @@ public class MQSSave
buffer_byte = new byte[ input_msg.getMessageLength()];
input_msg.readFully( buffer_byte);
if( Trim_Mode)
{
String buffer_string = new String( buffer_byte).trim();
buffer_byte = buffer_string.getBytes();
}
Output_File.write( buffer_byte, 0, buffer_byte.length);
if( Copy_Mode == false )
{
MQSDelete_Msg( input_msg);
}
}
else
{
msg_type = input_msg.readString( MSGTYPE_LEN);
@@ -515,6 +572,7 @@ public class MQSSave
Counter_Print( Total_Nb++, '#');
MQSDelete_Msg( input_msg);
first_flush = false;
}
else
@@ -525,7 +583,7 @@ public class MQSSave
first_flush = true;
}
}
else if( msg_type.equals( TYPE_SWIFTEND) || msg_type.equals( TYPE_SWIFTABORT))
else if( msg_type.equals( TYPE_SWIFTEND) || msg_type.equals( TYPE_SWIFTERROR))
{
// System.out.print( "FEA ");
Counter_Print( Total_Nb++, '#');
@@ -546,6 +604,12 @@ public class MQSSave
buffer_byte = new byte[ input_msg.getMessageLength() - MSGTYPE_LEN - FILLER_LEN];
input_msg.readFully( buffer_byte);
if( Trim_Mode)
{
String buffer_string = new String( buffer_byte).trim();
buffer_byte = buffer_string.getBytes();
}
Flush_File.write( buffer_byte, 0, buffer_byte.length);
MQSDelete_Msg( input_msg);
@@ -588,7 +652,7 @@ public class MQSSave
get_first = true;
first_scan = true;
}
else if( msg_type.equals( TYPE_SWIFTABORT))
else if( msg_type.equals( TYPE_SWIFTERROR))
{
// System.out.print( "SA ");
@@ -637,7 +701,7 @@ public class MQSSave
mode = MODE_SCAN;
get_first = true;
}
else if( msg_type.equals( TYPE_SWIFTABORT))
else if( msg_type.equals( TYPE_SWIFTERROR))
{
System.out.println( "Internal error: (" + msg_type + ") found during Move!");
throw new Exception();
@@ -656,6 +720,12 @@ public class MQSSave
buffer_byte = new byte[ input_msg.getMessageLength() - MSGTYPE_LEN - FILLER_LEN];
input_msg.readFully( buffer_byte);
if( Trim_Mode)
{
String buffer_string = new String( buffer_byte).trim();
buffer_byte = buffer_string.getBytes();
}
Output_File.write( buffer_byte, 0, buffer_byte.length);
MQSDelete_Msg( input_msg);
@@ -675,6 +745,11 @@ public class MQSSave
}
while( input_msg != null);
if( MBTrailer_Mode)
{
Output_File.write( Message_Break.getBytes());
}
System.out.println( "\n");
}
@@ -703,11 +778,14 @@ public class MQSSave
try
{
System.out.println("MQSSave: " + MQSSave_Tag + " / " + MQSSave_Date + " / " + MQSSave_Author);
if( ( args.length < 2) || ( args.length > 7))
{
System.out.println( "Usage: MQSSave [-mb \"message_break\"] [-tisbm [-ffn <Flush_File_Name>]] <Output_File_Name> <Input_MsgQueue_Name>");
System.out.println( " Default: Message Break: (" + Str_UnFormat( Message_Break) + ") TI Swift Batch Mode: (" + TI_Swift_Batch_Mode + ") Flush File Name: (" + Flush_File_Name + ")");
System.out.println( "Usage: MQSSave [-mb \"message_break\"] [-tisbm [-ffn <Flush_File_Name>] | -cm ] [-tm] [-mbtm] <Output_File_Name> <Input_MsgQueue_Name>");
System.out.println( " Default: 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.exit( 1);
}
else
{
@@ -716,7 +794,7 @@ public class MQSSave
Arg_Parse( args);
System.out.println( "Output File Name: (" + Output_File_Name + ") Input MsgQue Name: (" + MsgQ_Name + ") Flush File Name: (" + Flush_File_Name + ")");
System.out.println( "Message Break: (" + Str_UnFormat( Message_Break) + ") TI Swift Batch Mode: (" + TI_Swift_Batch_Mode + ")");
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();
@@ -726,6 +804,7 @@ public class MQSSave
if( TI_Swift_Batch_Mode)
{
System.out.println( "Legend: .: Saved *: Flushed #: Skiped ~: Scaned");
Flush_File = new BufferedOutputStream( new FileOutputStream( Flush_File_Name));
}
@@ -788,6 +867,8 @@ public class MQSSave
MQSDeInit();
System.out.println( "MQS Save Completed !");
System.exit( 0);
}
}
@@ -795,6 +876,8 @@ public class MQSSave
{
System.out.println("Exception: (" + Expt + ") !");
Expt.printStackTrace();
System.exit( 1);
}
}

View File

@@ -1,7 +1,7 @@
# $RCSfile: ReadMe.txt,v $
# $Revision: 1.3 $
# $Revision: 1.4 $
# $Name: $
# $Date: 2002/05/03 17:23:49 $
# $Date: 2002/05/21 16:07:17 $
# $Author: giberta1 $
@@ -39,6 +39,8 @@ Notes:
- The Flush File is only used when TI Swift Batch Mode is enabled (by setting "-tisbm" command line switch).
- When trim mode is enabled (by setting "-tm" command line switch), all the trailing spaces are removed.
- By default Message break is "\r\n",
- By default Flush File Name is "flush.txt".

View File

@@ -1,13 +1,61 @@
# $RCSfile: ReleaseNotes.txt,v $
# $Revision: 1.3 $
# $Revision: 1.8 $
# $Name: $
# $Date: 2002/05/03 17:15:36 $
# $Date: 2003/09/04 15:47:10 $
# $Author: giberta1 $
--------------------------------------------------------------------------------
MQSSave V 1.1.5 - A. Gibert - 04/09/03
--------------------------------------------------------------------------------
Add message break trailer mode support,
Add -mbtm option,
Add copy mode support,
Add "-cm" option.
--------------------------------------------------------------------------------
MQSSave V 1.1.4 - A. Gibert - 29/07/02
--------------------------------------------------------------------------------
Fix trim mode support when tisbm off.
--------------------------------------------------------------------------------
MQSSave V 1.1.3 - A. Gibert - 21/05/02
--------------------------------------------------------------------------------
Add trim mode support,
Add "-tm" option,
Add MQQueueManager() auto retry,
Fix flush file name bad parsing bug,
Add version, date and author print out.
--------------------------------------------------------------------------------
MQSSave V 1.1.2 - A. Gibert - 13/05/02
--------------------------------------------------------------------------------
Rename SWIFTABORT into SWIFTERROR,
Add Legend printout line.
--------------------------------------------------------------------------------
MQSSave V 1.1.1 - A. Gibert - 06/05/02
--------------------------------------------------------------------------------
Add return code handling.
--------------------------------------------------------------------------------
MQSSave V 1.1.0 - A. Gibert - 03/05/02
--------------------------------------------------------------------------------