se.citerus.dddsample.interfaces.booking.web
Class CargoAdminController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by org.springframework.web.servlet.mvc.multiaction.MultiActionController
                      extended by se.citerus.dddsample.interfaces.booking.web.CargoAdminController
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller, org.springframework.web.servlet.mvc.LastModified

public final class CargoAdminController
extends org.springframework.web.servlet.mvc.multiaction.MultiActionController

Handles cargo booking and routing. Operates against a dedicated remoting service facade, and could easily be rewritten as a thick Swing client. Completely separated from the domain layer, unlike the tracking user interface.

In order to successfully keep the domain model shielded from user interface considerations, this approach is generally preferred to the one taken in the tracking controller. However, there is never any one perfect solution for all situations, so we've chosen to demonstrate two polarized ways to build user interfaces.

See Also:
CargoTrackingController

Field Summary
 
Fields inherited from class org.springframework.web.servlet.mvc.multiaction.MultiActionController
DEFAULT_COMMAND_NAME, LAST_MODIFIED_METHOD_SUFFIX, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
CargoAdminController()
           
 
Method Summary
 void assignItinerary(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RouteAssignmentCommand command)
           
 void changeDestination(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void initBinder(javax.servlet.http.HttpServletRequest request, org.springframework.web.bind.ServletRequestDataBinder binder)
           
 java.util.Map list(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 java.util.Map pickNewDestination(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void register(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RegistrationCommand command)
           
 java.util.Map registrationForm(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 java.util.Map selectItinerary(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void setBookingServiceFacade(BookingServiceFacade bookingServiceFacade)
           
 java.util.Map show(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class org.springframework.web.servlet.mvc.multiaction.MultiActionController
bind, createBinder, getCommandName, getExceptionHandler, getLastModified, getMethodNameResolver, getValidators, getWebBindingInitializer, handleNoSuchRequestHandlingMethod, handleRequestInternal, initBinder, invokeNamedMethod, newCommandObject, setDelegate, setMethodNameResolver, setValidators, setWebBindingInitializer
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CargoAdminController

public CargoAdminController()
Method Detail

initBinder

protected void initBinder(javax.servlet.http.HttpServletRequest request,
                          org.springframework.web.bind.ServletRequestDataBinder binder)
                   throws java.lang.Exception
Overrides:
initBinder in class org.springframework.web.servlet.mvc.multiaction.MultiActionController
Throws:
java.lang.Exception

registrationForm

public java.util.Map registrationForm(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
                               throws java.lang.Exception
Throws:
java.lang.Exception

register

public void register(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response,
                     RegistrationCommand command)
              throws java.lang.Exception
Throws:
java.lang.Exception

list

public java.util.Map list(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws java.lang.Exception
Throws:
java.lang.Exception

show

public java.util.Map show(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws java.lang.Exception
Throws:
java.lang.Exception

selectItinerary

public java.util.Map selectItinerary(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response)
                              throws java.lang.Exception
Throws:
java.lang.Exception

assignItinerary

public void assignItinerary(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            RouteAssignmentCommand command)
                     throws java.lang.Exception
Throws:
java.lang.Exception

pickNewDestination

public java.util.Map pickNewDestination(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

changeDestination

public void changeDestination(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws java.lang.Exception
Throws:
java.lang.Exception

setBookingServiceFacade

public void setBookingServiceFacade(BookingServiceFacade bookingServiceFacade)


Copyright © 2009. All Rights Reserved.