uk.ac.starlink.ttools.server
Class ServletEnvironment

java.lang.Object
  extended by uk.ac.starlink.ttools.server.ServletEnvironment
All Implemented Interfaces:
uk.ac.starlink.task.Environment, TableEnvironment

public class ServletEnvironment
extends Object
implements TableEnvironment

Execution environment which can be used from a servlet.

Since:
6 Oct 2008
Author:
Mark Taylor

Constructor Summary
ServletEnvironment(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, uk.ac.starlink.table.StarTableFactory tableFactory, uk.ac.starlink.table.StarTableOutput tableOutput, uk.ac.starlink.table.jdbc.JDBCAuthenticator jdbcAuth)
          Constructor.
 
Method Summary
 void acquireValue(uk.ac.starlink.task.Parameter param)
           
 void clearValue(uk.ac.starlink.task.Parameter param)
           
 PrintStream getErrorStream()
           
 uk.ac.starlink.table.jdbc.JDBCAuthenticator getJdbcAuthenticator()
          Returns a JDBC authenticator suitable for use in this environment.
 String[] getNames()
           
 PrintStream getOutputStream()
           
 uk.ac.starlink.table.StarTableFactory getTableFactory()
          Returns a table factory suitable for use in this environment.
 uk.ac.starlink.table.StarTableOutput getTableOutput()
          Returns a table output marshaller suitable for use in this environment.
 boolean isDebug()
          Indicates whether we are running in debug mode.
 boolean isHelp()
          Returns true if the parameters passed into this environment reprsent a request for help.
 boolean isStrictVotable()
          Determines whether votables are to be parsed in strict mode.
 void setDebug(boolean debug)
          Sets whether we are running in debug mode.
 void setStrictVotable(boolean strictVot)
          Sets whether votables should be parsed in strict mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletEnvironment

public ServletEnvironment(javax.servlet.ServletRequest request,
                          javax.servlet.ServletResponse response,
                          uk.ac.starlink.table.StarTableFactory tableFactory,
                          uk.ac.starlink.table.StarTableOutput tableOutput,
                          uk.ac.starlink.table.jdbc.JDBCAuthenticator jdbcAuth)
                   throws IOException
Constructor.

Parameters:
request - servlet request
response - servlet response
tableFactory - table factory
tableOutput - table output
jdbcAuth - JDBC authenticator
Throws:
IOException
Method Detail

acquireValue

public void acquireValue(uk.ac.starlink.task.Parameter param)
                  throws uk.ac.starlink.task.TaskException
Specified by:
acquireValue in interface uk.ac.starlink.task.Environment
Throws:
uk.ac.starlink.task.TaskException

clearValue

public void clearValue(uk.ac.starlink.task.Parameter param)
Specified by:
clearValue in interface uk.ac.starlink.task.Environment

getNames

public String[] getNames()
Specified by:
getNames in interface uk.ac.starlink.task.Environment

getOutputStream

public PrintStream getOutputStream()
Specified by:
getOutputStream in interface uk.ac.starlink.task.Environment

getErrorStream

public PrintStream getErrorStream()
Specified by:
getErrorStream in interface uk.ac.starlink.task.Environment

getTableFactory

public uk.ac.starlink.table.StarTableFactory getTableFactory()
Description copied from interface: TableEnvironment
Returns a table factory suitable for use in this environment.

Specified by:
getTableFactory in interface TableEnvironment
Returns:
table factory

getTableOutput

public uk.ac.starlink.table.StarTableOutput getTableOutput()
Description copied from interface: TableEnvironment
Returns a table output marshaller suitable for use in this environment.

Specified by:
getTableOutput in interface TableEnvironment
Returns:
table output

getJdbcAuthenticator

public uk.ac.starlink.table.jdbc.JDBCAuthenticator getJdbcAuthenticator()
Description copied from interface: TableEnvironment
Returns a JDBC authenticator suitable for use in this environment.

Specified by:
getJdbcAuthenticator in interface TableEnvironment
Returns:
JDBC authenticator

isDebug

public boolean isDebug()
Description copied from interface: TableEnvironment
Indicates whether we are running in debug mode.

Specified by:
isDebug in interface TableEnvironment
Returns:
true iff debugging output is required

setDebug

public void setDebug(boolean debug)
Description copied from interface: TableEnvironment
Sets whether we are running in debug mode.

Specified by:
setDebug in interface TableEnvironment
Parameters:
debug - set true if you want debugging messages

isStrictVotable

public boolean isStrictVotable()
Description copied from interface: TableEnvironment
Determines whether votables are to be parsed in strict mode.

Specified by:
isStrictVotable in interface TableEnvironment
Returns:
true if VOTables will be interpreted strictly in accordance with the standard

setStrictVotable

public void setStrictVotable(boolean strictVot)
Description copied from interface: TableEnvironment
Sets whether votables should be parsed in strict mode.

Specified by:
setStrictVotable in interface TableEnvironment
Parameters:
strictVot - true if VOTables should be interpreted strictly in accordance with the standard

isHelp

public boolean isHelp()
Returns true if the parameters passed into this environment reprsent a request for help.

Returns:
true for help request


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.