Class ClientBase
java.lang.Object
cl.netswitch.lib.client.ClientBase
Implements the common logic of a client application.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceExecutes the logic of a client action using a connected channel. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConnects to Switch and executes the specified action.protected StringReturns a formatted message built using format and arguments.protected voidPrints a formatted message using arguments.protected static voidprintCompactStackTrace(Throwable thrown) Prints a compact stack trace of a throwable in standard error.protected voidPrints a formatted message using arguments then terminates the line.protected voidregister(String name, ClientBase.Action action) Register a new test indexed by specified name.
-
Constructor Details
-
ClientBase
protected ClientBase()Constructs a newClientBaseinstance.
-
-
Method Details
-
register
Register a new test indexed by specified name.- Parameters:
name- the name of the action.action- the client action to be executed.- Throws:
NullPointerException- if an argument isnull.IllegalArgumentException- ifnamealready defined.
-
println
-
print
-
format
-
connectAndExecute
-
printCompactStackTrace
Prints a compact stack trace of a throwable in standard error. After the compact stack trace is printed, this method terminates the execution of the JVM callingSystem.exit(1).- Parameters:
thrown- the throwable whose compact stack will be printed.
-