- Add message priority option "-mp",

- Fix usage print out.
This commit is contained in:
agibert 2008-12-18 17:23:36 +00:00
parent 87802fb8c3
commit c939079819
2 changed files with 26 additions and 10 deletions

View File

@ -1,7 +1,7 @@
// $RCSfile: MQSLoad.java,v $
// $Revision: 1.19 $
// $Revision: 1.20 $
// $Name: $
// $Date: 2008/12/12 10:48:54 $
// $Date: 2008/12/18 17:23:36 $
// $Author: agibert $
/*
@ -35,9 +35,9 @@ import com.ibm.mq.*;
public class MQSLoad
{
private String MQSLoad_Revision = "$Revision: 1.19 $";
private String MQSLoad_Revision = "$Revision: 1.20 $";
private String MQSLoad_Tag = "$Name: $";
private String MQSLoad_Date = "$Date: 2008/12/12 10:48:54 $";
private String MQSLoad_Date = "$Date: 2008/12/18 17:23:36 $";
private String MQSLoad_Author = "$Author: agibert $";
private MQQueueManager QMng = null;
private String QMng_Name = "";
@ -46,6 +46,7 @@ public class MQSLoad
private int MsgQ_Open_Options = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING;
private boolean Character_Convert = false;
private int Character_Set = 1208;
private int Message_Priority = MQC.MQPRI_PRIORITY_AS_Q_DEF;
private int Sleep_Time = 0;
private String Field_Break = "";
private String Message_Break = "\r\n";
@ -240,6 +241,18 @@ public class MQSLoad
throw new Exception();
}
}
else if ( args[argc].equals( "-mp"))
{
if( argc < ( args.length + 1))
{
Message_Priority = Integer.parseInt( args[++argc]);
}
else
{
System.out.println( "Invalid number of command line options...");
throw new Exception();
}
}
else if ( args[argc].equals( "-st"))
{
if( argc < ( args.length + 1))
@ -657,6 +670,7 @@ public class MQSLoad
}
output_msg.characterSet = Character_Set;
output_msg.priority = Message_Priority;
work_win_size = 1024 * 64;
break_win_size = Field_Break.length() + message_break.length;
@ -783,8 +797,9 @@ public class MQSLoad
private void Usage_Print( ) throws Exception
{
System.out.println( "Usage: MQSLoad [-qm \"Output_QueueMng_Name\"] [-cc] [-cs \"character_set\"] [-st \"sleep_time\"] [-fb \"field_break\"] [-mb \"message_break\"] [-mt \"message_tail\"] [-kmb] [-ms \"message_skip\"] [-mc \"message_count\"] [-rc \"repeat_count\"] <Output_MsgQueue_Name> <Input_File_Name>");
System.out.println( " Default: Output QueueMng Name: (" + QMng_Name + ") Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")");
System.out.println( "Usage: MQSLoad [-qm \"Output_QueueMng_Name\"] [-cc] [-cs \"character_set\"] [-mp \"message_priority\"] [-st \"sleep_time\"] [-fb \"field_break\"] [-mb \"message_break\"] [-mt \"message_tail\"] [-kmb] [-ms \"message_skip\"] [-mc \"message_count\"] [-rc \"repeat_count\"] <Output_MsgQueue_Name> <Input_File_Name>");
System.out.println( "");
System.out.println( " Default: Output QueueMng Name: (" + QMng_Name + ") Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Message Priority: (" + Message_Priority + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")");
}
@ -798,7 +813,7 @@ public class MQSLoad
private void Args_Print( ) throws Exception
{
System.out.println( "Output QueueMng Name: (" + QMng_Name + ") Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")");
System.out.println( "Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")");
System.out.println( "Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Message Priority: (" + Message_Priority + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")");
}

View File

@ -1,7 +1,7 @@
# $RCSfile: ReleaseNotes.txt,v $
# $Revision: 1.14 $
# $Revision: 1.15 $
# $Name: $
# $Date: 2008/12/12 00:00:31 $
# $Date: 2008/12/18 17:23:36 $
# $Author: agibert $
@ -9,7 +9,7 @@
--------------------------------------------------------------------------------
MQSLoad V 2.0.0 - A. Gibert - 2008/12/11
MQSLoad V 2.0.0 - A. Gibert - 2008/12/18
--------------------------------------------------------------------------------
- Major code rewrite and cleanup,
@ -18,6 +18,7 @@ MQSLoad V 2.0.0 - A. Gibert - 2008/12/11
- Add repeat count option "-rc",
- Add character set option "-cs",
- Add character convert option "-cc",
- Add message priority option "-mp",
- Fix Java 1.4 compatibility.