uk.ac.ebi.intenz.webapp.controller
Class DatabaseCommand

java.lang.Object
  extended by uk.ac.ebi.intenz.webapp.controller.Command
      extended by uk.ac.ebi.intenz.webapp.controller.DatabaseCommand
Direct Known Subclasses:
SearchCommand, SearchECCommand, SearchIDCommand, SearchPreliminaryCommand, SearchProposedCommand, UnknownDatabaseCommand

public abstract class DatabaseCommand
extends Command

A database command always relies on a connection to the database.

Version:
0.9 - 21-July-2003
Author:
Michael Darsow

Field Summary
protected  Connection con
           
protected  javax.servlet.ServletContext context
           
protected  String databaseErrorMessage
           
protected  EnzymeEntryMapper enzymeEntryMapper
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
 
Constructor Summary
DatabaseCommand()
           
 
Method Summary
protected  void close()
           
protected  void closeConnection()
          Closes the database connection or forwards to an error page if any error occured.
protected  void finalize()
           
protected  void forward(String target)
          Forwards to the given target.
 void init(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Connection con)
          Initialises the attributes which will be used to extract information for the command execution.
 
Methods inherited from class uk.ac.ebi.intenz.webapp.controller.Command
process
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

databaseErrorMessage

protected final String databaseErrorMessage
See Also:
Constant Field Values

context

protected javax.servlet.ServletContext context

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response

con

protected Connection con

enzymeEntryMapper

protected final EnzymeEntryMapper enzymeEntryMapper
Constructor Detail

DatabaseCommand

public DatabaseCommand()
Method Detail

init

public void init(javax.servlet.ServletContext context,
                 javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response,
                 Connection con)
Initialises the attributes which will be used to extract information for the command execution.

Parameters:
context - The servlet context.
request - The request object.
response - The response object.
con - A logical connection.

forward

protected void forward(String target)
                throws javax.servlet.ServletException,
                       IOException
Forwards to the given target.

Parameters:
target - A valid URI.
Throws:
javax.servlet.ServletException
IOException

closeConnection

protected void closeConnection()
                        throws javax.servlet.ServletException,
                               IOException
Closes the database connection or forwards to an error page if any error occured.

Throws:
javax.servlet.ServletException
IOException

close

protected void close()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2013 EMBL-EBI. All Rights Reserved.