|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectParkNPark.common.CommandLineParser
public class CommandLineParser
Parses a command line using GNU GetOpt
Nested Class Summary | |
---|---|
static class |
CommandLineParser.AcceptedParameters
Enumeration of the accepted commands that the caller wants |
Field Summary | |
---|---|
protected boolean |
appendLogs
When true, logs should be appended; when false, logs should be overwritten |
protected int |
detectionTimeout
The wait timeout to use during fault detections |
protected boolean |
faultInjection
Whether or not fault injection is enabled |
protected int |
faultInjectionMaxDelay
The maximum delay of the fault injection in milliseconds |
protected int |
faultInjectionMinDelay
The minimum delay of the fault injection in milliseconds |
protected int |
getLotsModeCount
When not 0, how many invocations of getLotsMode should be performed |
protected int |
interRequestTime
The inter-request time in this test run in milliseconds |
private String |
jdbcPassword
The JDBC password |
protected String |
jdbcURL
The JDBC URL |
private String |
jdbcUsername
The JDBC user name |
protected boolean |
killOnly
When true, the testing manager will only kill everything |
protected boolean |
neverGiveUp
When true, never give up when trying to contact the server |
protected int |
numClients
The number of clients in this test run |
protected int |
numServers
The number of servers in this test run |
protected String |
projectRoot
Our project root folder |
protected int |
recoveryTimeout
The wait timeout to use during fault recoveries |
protected int |
replySize
The reply size of the server messages in this test run in bytes |
Constructor Summary | |
---|---|
CommandLineParser()
|
Method Summary | |
---|---|
int |
getFaultDetectionTimeout()
Returns the fault detection timeout |
int |
getFaultInjectionMaxDelay()
Returns the maximum delay of the fault injector in milliseconds |
int |
getFaultInjectionMinDelay()
Returns the minimum delay of the fault injector in milliseconds |
int |
getFaultRecoveryTimeout()
Returns the fault recovery timeout |
int |
getGetLotsModeCount()
When not 0, how many invocations of getLotsMode should be performed |
int |
getInterRequestTime()
Returns the inter-request time in this test run |
String |
getJDBCPassword()
Returns the JDBC password |
String |
getJDBCURL()
Returns the JDBC URL |
String |
getJDBCUsername()
Returns the JDBC username |
int |
getNumClients()
Returns the number of clients in this test run |
int |
getNumServers()
Returns the number of servers in this test run |
String |
getProjectRoot()
Returns the project root folder or null if none was given in the command line arguments |
int |
getReplySize()
Returns the reply size of the server messages in this test run |
protected void |
help(String name,
Set<CommandLineParser.AcceptedParameters> acceptedParameters)
Writes out our command line help text to stdout using the given program name |
boolean |
isFaultInjectionEnabled()
Returns true when fault injection is enabled or false when it is disabled |
boolean |
parseCommandLine(String name,
String[] args,
Set<CommandLineParser.AcceptedParameters> acceptedParameters)
Parses the given command line for the given program name and returns true if the command line was successfully parsed or false if the program should exit |
boolean |
shouldAppendLogs()
Returns true when log files should be appended or false when logs files should be overwritten |
boolean |
shouldKillOnly()
Returns whether or not the testing manager should only kill everything and exit |
boolean |
shouldNeverGiveUp()
Returns true when the program should never give up when trying to reach a server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int replySize
protected int numClients
protected int numServers
protected int interRequestTime
protected boolean faultInjection
protected boolean appendLogs
protected boolean neverGiveUp
protected int faultInjectionMinDelay
protected int faultInjectionMaxDelay
protected String projectRoot
protected int getLotsModeCount
protected boolean killOnly
protected int detectionTimeout
protected int recoveryTimeout
protected String jdbcURL
private String jdbcUsername
private String jdbcPassword
Constructor Detail |
---|
public CommandLineParser()
Method Detail |
---|
public boolean parseCommandLine(String name, String[] args, Set<CommandLineParser.AcceptedParameters> acceptedParameters)
name
- The name of the programargs
- The arguments passed in from the command lineacceptedParameters
- Set of accepted parameters that the caller is interested in
protected void help(String name, Set<CommandLineParser.AcceptedParameters> acceptedParameters)
name
- The program name to use when displaying the command line helpacceptedParameters
- Set of accepted parameters that the caller is interested inpublic int getInterRequestTime()
public int getNumClients()
public int getNumServers()
public int getReplySize()
public boolean isFaultInjectionEnabled()
public int getFaultInjectionMinDelay()
public int getFaultInjectionMaxDelay()
public boolean shouldAppendLogs()
public boolean shouldNeverGiveUp()
public boolean shouldKillOnly()
public String getProjectRoot()
public int getGetLotsModeCount()
public int getFaultRecoveryTimeout()
public int getFaultDetectionTimeout()
public String getJDBCURL()
public String getJDBCUsername()
public String getJDBCPassword()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |