org.edg.data.util
Class CommandHelpers

java.lang.Object
  |
  +--org.edg.data.util.CommandHelpers

public final class CommandHelpers
extends java.lang.Object

Some helper methods useful when writing an object which is a subclass of the CommandBase object.

Version:
$ Id:$
Author:
James Casey

Field Summary
static int DEFAULT_INSECURE_PORT
          the default port for insecure servers
static int DEFAULT_SECURE_PORT
          the default port for secure servers
 
Method Summary
static void addMappingsOptions(org.apache.commons.cli.Options opts)
           
static void addNetworkOptions(org.apache.commons.cli.Options opts)
           
static void handleRemoteException(java.rmi.RemoteException e, java.net.URL endpoint)
          Handle the various remote exception cases that we can return meaningful error messages for.
static java.net.URL makeEndpoint(org.apache.commons.cli.CommandLine line, boolean isSecure, java.lang.String servicePath)
          Make an enpoint, given a set of command line options
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SECURE_PORT

public static final int DEFAULT_SECURE_PORT
the default port for secure servers

See Also:
Constant Field Values

DEFAULT_INSECURE_PORT

public static final int DEFAULT_INSECURE_PORT
the default port for insecure servers

See Also:
Constant Field Values
Method Detail

addNetworkOptions

public static void addNetworkOptions(org.apache.commons.cli.Options opts)

addMappingsOptions

public static void addMappingsOptions(org.apache.commons.cli.Options opts)

makeEndpoint

public static java.net.URL makeEndpoint(org.apache.commons.cli.CommandLine line,
                                        boolean isSecure,
                                        java.lang.String servicePath)
                                 throws java.net.MalformedURLException,
                                        java.lang.NumberFormatException,
                                        CommandLineException
Make an enpoint, given a set of command line options

Parameters:
line -
isSecure -
servicePath -
Returns:
the endpoint
Throws:
java.net.MalformedURLException
java.lang.NumberFormatException
CommandLineException

handleRemoteException

public static void handleRemoteException(java.rmi.RemoteException e,
                                         java.net.URL endpoint)
                                  throws DataException
Handle the various remote exception cases that we can return meaningful error messages for.

Parameters:
e - the exception
endpoint - the endpoint we
Throws:
DataException - which gives better error messages.