google-nomulus/java/google/registry
nickfelt f742ac8056 Refactor RequestHandler to handle request component construction
This refactors RequestHandler so that it handles the construction of the request
component itself, rather than being handed a pre-built request component
instance constructed by the invoking servlet.

The motivation for this change is so that RequestHandler can be extended in
future CLs to compute authentication results, and can provide those results as
an available binding in the constructed request component.  An alternative
approach could have been to compute the authentication results within
RequestModule itself, but I think it's clearer to keep business logic like
that outside of Dagger providers.

This CL makes the following individual changes:

- Adds request component builders, which implement a RequestComponentBuilder
  interface so they can all be manipulated by RequestHandler

- Instead of obtaining request components via factory methods on the global
  components, one now can have global-scoped bindings just inject the request
  component builders (which requires adding a module to each global component
  declaring the subcomponent).  This follows the recommended approach here:
  http://google.github.io/dagger/subcomponents.html

- Instead of exposing request components on the global component interface,
  we now expose module-specific subclasses of RequestHandler that @Inject the
  appropriate request component builder's provider and pass it to the superclass
  (note that inheritance isn't strictly necessary here but saves boilerplate)

- RequestHandler now takes the Provider<RequestComponentBuilder> and builds
  the component itself using its own fresh RequestModule instance. This provides
  some nice encapsulation but is mainly needed for adding a RequestAuthModule
  in future work.

- RequestHandler also takes UserService now, which can be provided via Dagger
  by the subclass.  Longer-term that will go away in favor of instead providing
  AuthStrategy instances, some of which will use UserService internally.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138815648
2016-11-15 10:49:05 -05:00
..
backup Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
batch Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
bigquery Use correct <a> tag syntax in javadoc @see tag 2016-11-02 15:19:34 -04:00
braintree Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
builddefs Change all references to Domain Registry to Nomulus 2016-10-14 16:58:07 -04:00
config Set svID in ConfigModule instead of hard-coding it 2016-11-10 12:29:53 -05:00
cron Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
dns Clean up ConfigModule 2016-11-10 11:19:58 -05:00
eclipse Fix build error by adding testonly=1 to eclipse BUILD file 2016-11-10 12:30:20 -05:00
env Get rid of ReferenceUnions entirely 2016-11-15 10:42:58 -05:00
export Make driveFolderId on Registry entity optional 2016-11-15 10:38:20 -05:00
flows Remove as-of date from argument list for extra create flow logic 2016-11-15 10:46:04 -05:00
gcs Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
groups Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
idn Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
keyring/api Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
loadtest Fix double-URL-encoding bug in LoadTestAction 2016-11-02 15:19:34 -04:00
mapreduce Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
model Add missing @Nullable annotations to ForeignKeyIndex load methods 2016-11-15 10:44:32 -05:00
module Refactor RequestHandler to handle request component construction 2016-11-15 10:49:05 -05:00
monitoring Use correct <a> tag syntax in javadoc @see tag 2016-11-02 15:19:34 -04:00
pricing Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
rdap Switch over to non-ReferenceUnion fields on DomainBase 2016-11-02 15:19:34 -04:00
rde Use correct <a> tag syntax in javadoc @see tag 2016-11-02 15:19:34 -04:00
request Refactor RequestHandler to handle request component construction 2016-11-15 10:49:05 -05:00
security Convert RegistrarServlet to RegistrarAction 2016-11-02 15:19:34 -04:00
storage/drive Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
tldconfig/idn Use correct <a> tag syntax in javadoc @see tag 2016-11-02 15:19:34 -04:00
tmch Use correct <a> tag syntax in javadoc @see tag 2016-11-02 15:19:34 -04:00
tools Add Google Cloud Storage helper for non-GAE environment 2016-11-10 12:30:00 -05:00
ui Don't throw an exception on orphaned contacts 2016-11-10 11:27:32 -05:00
util Add retry logic to CreateLrpTokensCommand 2016-11-10 11:26:03 -05:00
whois Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
xjc Make essential Bazel packages publicly visible 2016-10-24 11:57:00 -04:00
xml Use correct <a> tag syntax in javadoc @see tag 2016-11-02 15:19:34 -04:00
BUILD Fix Bazel visibility rules 2016-10-24 11:57:00 -04:00
repositories.bzl Revert change to Guava 20 until we get it working properly 2016-11-02 15:19:34 -04:00