google-nomulus/java/google/registry/tools
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
..
javascrap Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
params Add GenerateSpec11Action and SafeBrowsing evaluation 2018-08-10 13:46:48 -04:00
server Refactor EppXmlTransformer to be in the model/ package 2018-12-12 13:22:34 -05:00
soy Add a nomulus renew_domain command 2018-06-06 15:16:09 -04:00
AllocateDomainCommand.java Refactor EppXmlTransformer to be in the model/ package 2018-12-12 13:22:34 -05:00
AppEngineAdminApiModule.java Use local credential to deploy beam pipelines 2018-12-05 16:07:54 -05:00
AppEngineConnection.java Add option --non_live_versions to set_num_instances command 2018-12-03 18:58:05 -05:00
AuthModule.java Add an option to perform login on remote machines 2018-12-12 13:22:34 -05:00
BigqueryCommand.java Use @DefaultCredential for Cloud API access in GAE 2018-09-20 11:19:36 -04:00
BigqueryParameters.java Use @DefaultCredential for Cloud API access in GAE 2018-09-20 11:19:36 -04:00
BUILD Add an option to perform login on remote machines 2018-12-12 13:22:34 -05:00
CanonicalizeLabelsCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
CheckDomainClaimsCommand.java Default to admin registrar in check_domain commands 2018-09-08 00:19:53 -04:00
CheckDomainCommand.java Default to admin registrar in check_domain commands 2018-09-08 00:19:53 -04:00
CheckSnapshotCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
Command.java Allow AppEngineConnection to target services other than "tools" 2018-09-08 00:10:06 -04:00
CommandRunner.java Add a "shell" pseudo-command to nomulus tool 2018-03-19 18:22:01 -04:00
CommandUtilities.java Fix CommandUtilities to fail gracefully if stdin is unavailable 2017-02-06 16:45:23 -05:00
CommandWithConnection.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
CommandWithRemoteApi.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
ComparableEntity.java Implement ComparableEntity class 2017-09-12 15:51:50 -04:00
CompareDbBackups.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
ConfirmingCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
ConvertIdnCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
CountDomainsCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
CreateAnchorTenantCommand.java Refactor StringGenerator bindings 2018-10-22 19:06:35 -04:00
CreateCdnsTld.java Use @DefaultCredential for Cloud API access in GAE 2018-09-20 11:19:36 -04:00
CreateContactCommand.java Refactor StringGenerator bindings 2018-10-22 19:06:35 -04:00
CreateDomainCommand.java Refactor StringGenerator bindings 2018-10-22 19:06:35 -04:00
CreateHostCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
CreateOrUpdateDomainCommand.java Allow square bracket expansion when specifying nameservers 2018-08-10 13:44:25 -04:00
CreateOrUpdatePremiumListCommand.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
CreateOrUpdateRegistrarCommand.java Handle Purchase Order numbers explicitly in billing pipeline 2018-09-20 11:19:36 -04:00
CreateOrUpdateReservedListCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
CreateOrUpdateTldCommand.java Delete all Limited Release Program (LRP) code 2018-08-20 14:28:16 -04:00
CreatePremiumListCommand.java Clean up some code quality issues 2017-12-01 22:14:06 -05:00
CreateRegistrarCommand.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
CreateRegistrarGroupsCommand.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
CreateReservedListCommand.java Refer to Datastore everywhere correctly by its capitalized form 2017-02-17 12:12:12 -05:00
CreateSandboxTldCommand.java Add a command-line tool suitable for tech support usage 2018-09-20 11:19:36 -04:00
CreateTldCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
CurlCommand.java Fix --content-type and --data inputs in curl command 2018-12-03 19:15:33 -05:00
DeleteAllocationTokensCommand.java Add nomulus command for deleting AllocationTokens 2018-10-03 11:54:10 -04:00
DeleteDomainCommand.java Add flag to delete domain immediately in nomulus too 2018-05-30 12:18:54 -04:00
DeleteHostCommand.java Add delete_host nomulus tool command 2017-05-03 11:08:02 -04:00
DeletePremiumListCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
DeleteReservedListCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
DeleteTldCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
DeployInvoicingPipelineCommand.java Refactor beam invoicing pipeline into its own package 2018-07-17 22:08:13 -04:00
DeploySpec11PipelineCommand.java Correct wrong description of command 2018-09-14 11:50:43 -04:00
DomainApplicationInfoCommand.java Don't prompt to confirm non-mutating nomulus EPP tool commands 2018-04-10 16:53:18 -04:00
EncryptEscrowDepositCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
EppToolCommand.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
EscrowDepositEncryptor.java Simplify the RyDE API 2018-07-17 22:03:53 -04:00
ExecuteEppCommand.java Do not use InjectRule to mock stdin in ExecuteEppCommandTest 2018-10-22 18:46:36 -04:00
GenerateAllocationTokensCommand.java Refactor StringGenerator bindings 2018-10-22 19:06:35 -04:00
GenerateApplicationsReportCommand.java Refactor EppXmlTransformer to be in the model/ package 2018-12-12 13:22:34 -05:00
GenerateAuctionDataCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GenerateDnsReportCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GenerateEscrowDepositCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GenerateLordnCommand.java Refactor LordnTask to LordnTaskUtils 2018-10-22 18:59:48 -04:00
GenerateZoneFilesCommand.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
GetApplicationCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
GetApplicationIdsCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GetAppliedLabelsCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GetClaimsListCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GetContactCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
GetDomainCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
GetEppResourceCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
GetHistoryEntriesCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GetHostCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
GetKeyringSecretCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GetRegistrarCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GetResourceByKeyCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GetRoutingMapCommand.java Add golden files for request component routing maps 2017-06-05 18:17:09 -04:00
GetSchemaCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
GetSchemaTreeCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
GetTldCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GhostrydeCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
GtechTool.java Add the 'login' command to gtech_tool 2018-12-13 15:12:25 -05:00
HashCertificateCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
HelpCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
Injector.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
LevelDbLogReader.java Create a LevelDBLogReader class for java 2017-08-29 16:25:33 -04:00
ListCursorsCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
ListDomainsCommand.java Default to REAL TLDs in nomulus list_domains command 2018-10-22 18:53:16 -04:00
ListHostsCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ListObjectsCommand.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
ListPremiumListsCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ListRegistrarsCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ListReservedListsCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
ListTldsCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
LoadSnapshotCommand.java Remove more unnecessary "throws" declarations 2018-06-27 15:28:52 -04:00
LoadTestCommand.java Refactor AppEngineConnection 2018-10-29 15:34:12 -04:00
LockDomainCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
LockOrUnlockDomainCommand.java Default clientId to registry's registrar in domain lock commands 2018-06-06 15:17:36 -04:00
logging.properties Automated g4 rollback of changelist 212879670. 2018-10-03 11:50:47 -04:00
LoggingParameters.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
LoginCommand.java Add an option to perform login on remote machines 2018-12-12 13:22:34 -05:00
LogoutCommand.java Migrate to Flogger (green) 2018-05-30 12:18:54 -04:00
MutatingCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
MutatingEppToolCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
NonMutatingEppToolCommand.java Don't prompt to confirm non-mutating nomulus EPP tool commands 2018-04-10 16:53:18 -04:00
package-info.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
PendingEscrowCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
RecordAccumulator.java Create an entity record accumulator 2017-09-12 15:51:50 -04:00
RegistrarContactCommand.java Add registrar contact to OTE registrars 2018-10-22 18:58:06 -04:00
RegistryCli.java Use local credential to deploy beam pipelines 2018-12-05 16:07:54 -05:00
RegistryTool.java Add an unrenew_domain command to nomulus tool 2018-12-12 13:22:34 -05:00
RegistryToolComponent.java Add an unrenew_domain command to nomulus tool 2018-12-12 13:22:34 -05:00
RegistryToolEnvironment.java Restore original System Properties after tests 2018-11-14 11:57:23 -05:00
RemoteApiOptionsUtil.java Use self-managed credential in remote api installer 2018-12-05 16:02:28 -05:00
RenewDomainCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
RequestFactoryModule.java Use local credential to deploy beam pipelines 2018-12-05 16:07:54 -05:00
ResaveEntitiesCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
ResaveEnvironmentEntitiesCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
ResaveEppResourceCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
SendEscrowReportToIcannCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
SetNumInstancesCommand.java Add option --non_live_versions to set_num_instances command 2018-12-03 18:58:05 -05:00
SetupOteCommand.java Change OTE "fake" address state to a valid value 2018-11-14 11:59:04 -05:00
ShellCommand.java Make OutputEncapsulator a CommandRunner 2018-11-12 14:51:40 -05:00
UniformRapidSuspensionCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
UnlockDomainCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
UnrenewDomainCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
UpdateApplicationStatusCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
UpdateClaimsNoticeCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
UpdateCursorsCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
UpdateDomainCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
UpdateKmsKeyringCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
UpdatePremiumListCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
UpdateRegistrarCommand.java Make Registrar load methods return Optionals instead of Nullables 2017-08-01 16:58:59 -04:00
UpdateReservedListCommand.java Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00
UpdateSandboxTldCommand.java Add a command-line tool suitable for tech support usage 2018-09-20 11:19:36 -04:00
UpdateServerLocksCommand.java Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
UpdateSmdCommand.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
UpdateTldCommand.java Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00
UploadClaimsListCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00
ValidateEscrowDepositCommand.java Simplify the Ghostryde API 2018-06-27 15:28:53 -04:00
ValidateLoginCredentialsCommand.java Require SSL certificate hash on login by default 2018-12-12 13:22:34 -05:00
VerifyOteCommand.java Make the verify OT&E action more performant 2018-12-03 19:07:36 -05:00
WhoisQueryCommand.java Rename RemoteApiCommand to CommandWithRemoteApi 2018-09-08 00:12:31 -04:00