Add Keep Message Break support,

Add -kmb option.
This commit is contained in:
giberta1 2002-05-02 17:09:35 +00:00
parent d02756a1f2
commit eafca20611

View File

@ -1,7 +1,7 @@
// $RCSfile: MQSLoad.java,v $ // $RCSfile: MQSLoad.java,v $
// $Revision: 1.4 $ // $Revision: 1.5 $
// $Name: $ // $Name: $
// $Date: 2002/04/23 15:07:47 $ // $Date: 2002/05/02 17:09:35 $
// $Author: giberta1 $ // $Author: giberta1 $
/* /*
@ -43,6 +43,7 @@ public class MQSLoad
private String File_Name; private String File_Name;
private String Field_Break = ""; private String Field_Break = "";
private String Message_Break = "\r\n"; private String Message_Break = "\r\n";
private boolean Keep_Message_Break = false;
@ -221,6 +222,10 @@ public class MQSLoad
throw new Exception(); throw new Exception();
} }
} }
else if ( args[argc].equals( "-kmb"))
{
Keep_Message_Break = true;
}
else else
{ {
MsgQ_Name = args[argc++]; MsgQ_Name = args[argc++];
@ -439,6 +444,11 @@ public class MQSLoad
if( next_message <= cur_window_size) if( next_message <= cur_window_size)
{ {
// System.out.println( "* Write Msg CurPos: (" + cur_pos + ")"); // System.out.println( "* Write Msg CurPos: (" + cur_pos + ")");
if( Keep_Message_Break)
{
output_msg.writeString( Message_Break);
}
output_msg.messageId = MQC.MQMI_NONE; output_msg.messageId = MQC.MQMI_NONE;
MQSPut_Msg( output_msg); MQSPut_Msg( output_msg);
output_msg.clearMessage(); output_msg.clearMessage();
@ -498,8 +508,8 @@ public class MQSLoad
if( ( args.length < 2) || ( args.length > 6)) if( ( args.length < 2) || ( args.length > 6))
{ {
System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] <Output_MsgQueue_Name> <Input_File_Name>"); System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] [-kmb] <Output_MsgQueue_Name> <Input_File_Name>");
System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ")"); System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")");
} }
else else
{ {
@ -508,7 +518,7 @@ public class MQSLoad
Arg_Parse( args); Arg_Parse( args);
System.out.println( "Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")"); System.out.println( "Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")");
System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ")"); System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")");
MQSInit(); MQSInit();