google-nomulus/java/google/registry/flows
mcilwain 4491b7b909 Make loadByForeignKey() and related methods return Optional
This is safer and addresses a common source of confusion in the codebase because it's always explicit that the resource returned may not be present, whether because it's soft-deleted when projected to the given time or because it never existed in the first place.

In production code, the presence of the returned value is always checked. In test code, its presence is assumed using .get() where that is expected and convenient, as it not being present will throw an NPE that will cause the test to fail anyway.

Note that the roughly equivalent reloadResourceByForeignKey(), which is widely used in test code, is not having this same treatment applied to it. That is out of the scope of this CL, and has much smaller returns anyway because it's only used in tests (where the unexpected absence of a given resource would just cause the test to fail).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=225424002
2018-12-14 11:24:49 -05:00
..
annotations Make FlowRunner log ICANN activity report field name 2017-03-27 13:32:57 -04:00
async Test AsyncFlowMetrics without mock 2018-10-22 19:10:01 -04:00
contact Update lastEppUpdateTime and lastEppUpdateClientId when necessary 2018-12-03 19:13:55 -05:00
custom Remove unnecessary generic type arguments 2017-11-21 18:17:31 -05:00
domain Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
exceptions Allow domain transfers with 0 period and in auto-renew grace period 2017-10-04 16:16:45 -04:00
host Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
picker Default missing type= argument to "registration" in launch:create EPP extension 2018-04-02 16:22:54 -04:00
poll Remove leniency on poll message ID format without years in them 2018-02-20 15:12:43 -05:00
session Use AuthenticatedRegistrarAccessor in EppConsoleAction 2018-12-03 18:51:40 -05:00
soy Remove autoescape="strict" attributes from Soy templates. 2017-10-04 16:16:45 -04:00
BUILD Clean up annotation imports in BUILD files 2018-06-27 15:28:53 -04:00
CheckApiAction.java Start using non-EPP-flow-wrapping implementation in CheckAPI 2018-06-27 15:28:52 -04:00
CheckApiMetrics.java Add metrics for the new Check API 2018-06-18 17:44:04 -04:00
EppConsoleAction.java Use AuthenticatedRegistrarAccessor in EppConsoleAction 2018-12-03 18:51:40 -05:00
EppController.java Refactor EppXmlTransformer to be in the model/ package 2018-12-12 13:22:34 -05:00
EppException.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppMetrics.java Move metrics dependencies to artifacts under Maven groupId com.google.monitoring-client 2018-01-04 17:12:35 -05:00
EppRequestHandler.java Refactor EppXmlTransformer to be in the model/ package 2018-12-12 13:22:34 -05:00
EppRequestSource.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
EppTlsAction.java Remove checking of SNI headers 2018-09-14 21:34:44 -04:00
EppToolAction.java Change @Auth to an AutoValue, and created a set of predefined Auths 2017-08-01 16:33:10 -04:00
EppXmlSanitizer.java Fix bugs exposed by testing with Gradle 2018-10-17 11:44:41 -04:00
ExtensionManager.java Migrate to Flogger (green) 2018-05-30 12:18:54 -04:00
Flow.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowComponent.java Add extensibility framework for allocation tokens 2018-02-01 21:54:29 -05:00
FlowMetadata.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowModule.java Add more absent clTrid unit tests 2018-06-27 15:28:52 -04:00
FlowReporter.java Remove redundant inputXml log in EPP flows 2018-06-18 17:56:15 -04:00
FlowRunner.java Stop exporting EPP flow metrics to BigQuery 2018-10-08 16:59:29 -04:00
FlowScope.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
FlowUtils.java Refactor EppXmlTransformer to be in the model/ package 2018-12-12 13:22:34 -05:00
GaeUserCredentials.java Use AuthenticatedRegistrarAccessor in EppConsoleAction 2018-12-03 18:51:40 -05:00
HttpSessionMetadata.java Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00
PasswordOnlyTransportCredentials.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ResourceFlowUtils.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
ServerTridProvider.java Clean up some code quality issues 2017-12-01 22:14:06 -05:00
ServerTridProviderImpl.java Refactor out creation of server TRIDs so they can be tested 2017-04-13 10:55:47 -04:00
ServerTridProviderModule.java Refactor out creation of server TRIDs so they can be tested 2017-04-13 10:55:47 -04:00
SessionMetadata.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
StatelessRequestSessionMetadata.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
TlsCredentials.java Require SSL certificate hash on login by default 2018-12-12 13:22:34 -05:00
TransactionalFlow.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
TransportCredentials.java Clean up some code quality issues 2017-12-01 22:14:06 -05:00