public class LaunchArgHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ACTION_CONTINUE
Returned by the handleArgs methods when all arguments have been
parsed and the SIP Communicator launch can continue.
|
static int |
ACTION_CONTINUE_LOCK_DISABLED
Returned by the handleArgs methods when all arguments have been
successfully parsed and one of them indicates that the user has requested
a multi instance launch.
|
static int |
ACTION_ERROR
Returned by the handleArgs method when parsing the arguments
has failed or if no arguments were passed and an instance of SC was
already launched.
|
static int |
ACTION_EXIT
Returned by the handleArgs methods when the arguments that have
been parsed do not require for SIP Communicator to be started and the
Launcher is supposed to exit.
|
static int |
ERROR_CODE_ALREADY_STARTED
The error code returned when we try to launch SIP Communicator while
there is already a running instance and there were no arguments that we
forward to that instance.
|
static int |
ERROR_CODE_CREATE_DIR_FAILED
The error code that we return when we fail to create a directory that has
been specified with the -c|--config option.
|
static int |
ERROR_CODE_UNKNOWN_ARG
The error code returned when we couldn't parse one of the options.
|
Modifier and Type | Method and Description |
---|---|
int |
getErrorCode()
Returns an error code that could help identify an error when
handleArgs returns ACTION_ERROR or 0 if everything went fine.
|
static LaunchArgHandler |
getInstance()
Creates a singleton instance of the LauncherArgHandler if necessary and
returns a reference to it.
|
int |
handleArgs(java.lang.String[] args)
Does the actual argument handling.
|
void |
handleConcurrentInvocationRequestArgs(java.lang.String[] args)
Called when the user has tried to launch a second instance of
SIP Communicator while a first one was already running.
|
void |
handleHelpArg()
Prints a help message containing usage instructions and descriptions of
all options currently supported by Jitsi.
|
void |
handleUnknownArg(java.lang.String arg)
Prints an error message and then prints the help message.
|
void |
setDelegationPeer(ArgDelegationPeer delegationPeer)
Sets the delegationPeer that would be handling all URIs passed
as command line arguments to SIP Communicator.
|
public static final int ACTION_EXIT
public static final int ACTION_CONTINUE
public static final int ACTION_ERROR
public static final int ACTION_CONTINUE_LOCK_DISABLED
public static final int ERROR_CODE_UNKNOWN_ARG
public static final int ERROR_CODE_ALREADY_STARTED
public static final int ERROR_CODE_CREATE_DIR_FAILED
public static LaunchArgHandler getInstance()
public int handleArgs(java.lang.String[] args)
args
- the arguments the way we have received them from the main()
method.public void handleUnknownArg(java.lang.String arg)
arg
- the unknown argument we need to printpublic void handleHelpArg()
public int getErrorCode()
public void setDelegationPeer(ArgDelegationPeer delegationPeer)
delegationPeer
- the delegationPeer that should handle URIs
or null if we'd like to unset a previously set peer.public void handleConcurrentInvocationRequestArgs(java.lang.String[] args)
args
- the args that we need to handle.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.