mirror of
https://github.com/google/nomulus
synced 2026-01-08 07:11:44 +00:00
Change EppMetric.Builder to use @AutoValue.Builder
Getting rid of builder boilerplate makes my heart sing. Since we can no longer @Inject the Builder() constructor, this change adds a provider in WhiteboxModule that calls a special builderForRequest() factory method, which gets passed a request ID and Clock and preserves the existing EppMetric magic that sets the start and end time for you. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132714432
This commit is contained in:
@@ -18,6 +18,7 @@ import static google.registry.flows.EppXmlTransformer.unmarshal;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Optional;
|
||||
import google.registry.flows.FlowModule.EppExceptionInProviderException;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
@@ -55,7 +56,7 @@ public final class EppController {
|
||||
boolean isDryRun,
|
||||
boolean isSuperuser,
|
||||
byte[] inputXmlBytes) {
|
||||
metricBuilder.setClientId(sessionMetadata.getClientId());
|
||||
metricBuilder.setClientId(Optional.fromNullable(sessionMetadata.getClientId()));
|
||||
metricBuilder.setPrivilegeLevel(isSuperuser ? "SUPERUSER" : "NORMAL");
|
||||
try {
|
||||
EppInput eppInput;
|
||||
|
||||
Reference in New Issue
Block a user