edu.jhu.tmaj.servlet.request.impl
Class UpdateRequest

java.lang.Object
  extended by edu.jhu.tmaj.servlet.request.BaseRequest
      extended by edu.jhu.tmaj.servlet.request.impl.UpdateRequest
All Implemented Interfaces:
CommandRequest, java.io.Serializable

public final class UpdateRequest
extends BaseRequest
implements java.io.Serializable

Modifies the specified bean in the database with either an update, insert, or delete. The individual bean is responsible for verifying if the user has permission to execute the action. Based upon the request type, the bean will execute either the commit(),insert(), or delete() method.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.jhu.tmaj.servlet.request.BaseRequest
password, username
 
Constructor Summary
UpdateRequest(JBean bean, UpdateRequestType requestType)
           
 
Method Summary
 CommandResponse processRequest(UserBean userBean)
          Calls either the commit(), insert(), or delete() method on the Bean provided.
 java.lang.String toString()
           
 
Methods inherited from class edu.jhu.tmaj.servlet.request.BaseRequest
executeCommand, getPassword, getUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UpdateRequest

public UpdateRequest(JBean bean,
                     UpdateRequestType requestType)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

processRequest

public CommandResponse processRequest(UserBean userBean)
                               throws java.sql.SQLException
Calls either the commit(), insert(), or delete() method on the Bean provided. The action is verified for security reasons before executing. The bean is returned in the response, since in the case of an insert(), the user would need to know the ID assigned by the database.

Specified by:
processRequest in class BaseRequest
Throws:
java.sql.SQLException