mirror of
https://github.com/google/nomulus.git
synced 2025-07-30 06:26:30 +02:00
Separate load and verify transaction from refresh transaction in RefreshDnsAction (#2055)
This commit is contained in:
parent
270fe06c34
commit
6e2bc415ef
1 changed files with 12 additions and 15 deletions
|
@ -60,21 +60,18 @@ public final class RefreshDnsAction implements Runnable {
|
||||||
if (!domainOrHostName.contains(".")) {
|
if (!domainOrHostName.contains(".")) {
|
||||||
throw new BadRequestException("URL parameter 'name' must be fully qualified");
|
throw new BadRequestException("URL parameter 'name' must be fully qualified");
|
||||||
}
|
}
|
||||||
tm().transact(
|
switch (type) {
|
||||||
() -> {
|
case DOMAIN:
|
||||||
switch (type) {
|
loadAndVerifyExistence(Domain.class, domainOrHostName);
|
||||||
case DOMAIN:
|
tm().transact(() -> requestDomainDnsRefresh(domainOrHostName));
|
||||||
loadAndVerifyExistence(Domain.class, domainOrHostName);
|
break;
|
||||||
requestDomainDnsRefresh(domainOrHostName);
|
case HOST:
|
||||||
break;
|
verifyHostIsSubordinate(loadAndVerifyExistence(Host.class, domainOrHostName));
|
||||||
case HOST:
|
tm().transact(() -> requestHostDnsRefresh(domainOrHostName));
|
||||||
verifyHostIsSubordinate(loadAndVerifyExistence(Host.class, domainOrHostName));
|
break;
|
||||||
requestHostDnsRefresh(domainOrHostName);
|
default:
|
||||||
break;
|
throw new BadRequestException("Unsupported type: " + type);
|
||||||
default:
|
}
|
||||||
throw new BadRequestException("Unsupported type: " + type);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T extends EppResource & ForeignKeyedEppResource>
|
private <T extends EppResource & ForeignKeyedEppResource>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue