edu.sdsc.inca
Class Consumer

java.lang.Object
  extended by edu.sdsc.inca.Component
      extended by edu.sdsc.inca.Consumer

public class Consumer
extends edu.sdsc.inca.Component

Starts up a Jetty server to server our Inca webapp. Reads configuration params from standard properties, waits for webapp to start, and then adds the configuration params to the webapp. This allows the password to be passed via stdin.

Author:
Shava Smallen <ssmallen@sdsc.edu>

Field Summary
static java.lang.String AGENT_BEAN_ID
           
static java.lang.String CONFIG_ID
           
static java.lang.String CONSUMER_OPTS
           
static java.lang.String DEPOT_BEAN_ID
           
 
Fields inherited from class edu.sdsc.inca.Component
authenticate, cert, certPath, COMPONENT_OPTS, hostname, key, keyPath, logFile, password, port, trusted, trustedPath
 
Constructor Summary
Consumer()
           
 
Method Summary
 java.util.Properties getClientConfiguration()
          Returns configuration properties for clients (e.g., agent and depot).
 java.lang.String getTempPath()
          Returns the path where the server stores temporary files.
 boolean isRunning()
          Determine if Jetty server is running.
static void main(java.lang.String[] args)
          Start up the consumer server.
 void setClientConfiguration(java.util.Properties props)
          Sets the configuration properties for clients (e.g., agent and depot).
 void setConfiguration(java.util.Properties config)
          Read in the configuration for the consumer from the specified properties list.
 void setTempPath(java.lang.String path)
          Sets the directory path where the Server stores temporary files.
 void shutdown()
           
 void startConsumer()
          Runs a Jetty server.
 
Methods inherited from class edu.sdsc.inca.Component
addTrustedCert, configComponent, createSocket, getAuthenticate, getCertificate, getCertificatePath, getHostname, getKey, getKeyPath, getLogFile, getPassword, getPort, getTrustedCertificates, getTrustedPath, getUri, openResourceStream, readCredentials, readVersion, setAuthenticate, setCertificatePath, setHostname, setKeyPath, setLogFile, setPassword, setPort, setTrustedPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGENT_BEAN_ID

public static final java.lang.String AGENT_BEAN_ID
See Also:
Constant Field Values

CONFIG_ID

public static final java.lang.String CONFIG_ID
See Also:
Constant Field Values

DEPOT_BEAN_ID

public static final java.lang.String DEPOT_BEAN_ID
See Also:
Constant Field Values

CONSUMER_OPTS

public static final java.lang.String CONSUMER_OPTS
Constructor Detail

Consumer

public Consumer()
Method Detail

getClientConfiguration

public java.util.Properties getClientConfiguration()
Returns configuration properties for clients (e.g., agent and depot).

Returns:
a list of configuration properties for clients

getTempPath

public java.lang.String getTempPath()
Returns the path where the server stores temporary files.

Returns:
the temp directory path

isRunning

public boolean isRunning()
Determine if Jetty server is running.

Returns:
True if Jetty server is running and false otherwise.

setClientConfiguration

public void setClientConfiguration(java.util.Properties props)
Sets the configuration properties for clients (e.g., agent and depot).

Parameters:
props - a list of configuration properties for clients

setConfiguration

public void setConfiguration(java.util.Properties config)
                      throws edu.sdsc.inca.ConfigurationException
Read in the configuration for the consumer from the specified properties list.

Overrides:
setConfiguration in class edu.sdsc.inca.Component
Parameters:
config - A list of configuration options for the consumer
Throws:
ConfigurationException

setTempPath

public void setTempPath(java.lang.String path)
                 throws edu.sdsc.inca.ConfigurationException
Sets the directory path where the Server stores temporary files.

Parameters:
path - the temporary directory path
Throws:
ConfigurationException - if the path can't be read from the classpath

shutdown

public void shutdown()

startConsumer

public void startConsumer()
                   throws java.lang.Exception
Runs a Jetty server.

Throws:
java.lang.Exception - if unable to start up Jetty server and consumer threads

main

public static void main(java.lang.String[] args)
Start up the consumer server.

Parameters:
args - array of command line arguments to configure the consumer.