mirror of
https://github.com/google/nomulus.git
synced 2025-07-20 09:46:03 +02:00
Remove unnecessary "throws" declarations
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201058582
This commit is contained in:
parent
a7256f5edd
commit
5d80f124ca
377 changed files with 2297 additions and 2373 deletions
|
@ -396,7 +396,7 @@ public class BigqueryConnection implements AutoCloseable {
|
|||
public ListenableFuture<DestinationTable> load(
|
||||
DestinationTable dest,
|
||||
SourceFormat sourceFormat,
|
||||
Iterable<String> sourceUris) throws Exception {
|
||||
Iterable<String> sourceUris) {
|
||||
Job job = new Job()
|
||||
.setConfiguration(new JobConfiguration()
|
||||
.setLoad(new JobConfigurationLoad()
|
||||
|
@ -441,7 +441,7 @@ public class BigqueryConnection implements AutoCloseable {
|
|||
* <p>Returns a ListenableFuture that holds the ImmutableTable on success.
|
||||
*/
|
||||
public ListenableFuture<ImmutableTable<Integer, TableFieldSchema, Object>>
|
||||
queryToLocalTable(String querySql) throws Exception {
|
||||
queryToLocalTable(String querySql) {
|
||||
Job job = new Job()
|
||||
.setConfiguration(new JobConfiguration()
|
||||
.setQuery(new JobConfigurationQuery()
|
||||
|
@ -459,8 +459,7 @@ public class BigqueryConnection implements AutoCloseable {
|
|||
*
|
||||
* <p>Returns the results of the query in an ImmutableTable on success.
|
||||
*/
|
||||
public ImmutableTable<Integer, TableFieldSchema, Object> queryToLocalTableSync(String querySql)
|
||||
throws Exception {
|
||||
public ImmutableTable<Integer, TableFieldSchema, Object> queryToLocalTableSync(String querySql) {
|
||||
Job job = new Job()
|
||||
.setConfiguration(new JobConfiguration()
|
||||
.setQuery(new JobConfigurationQuery()
|
||||
|
|
|
@ -193,7 +193,7 @@ class ChildEntityReader<R extends EppResource, I extends ImmutableObject> extend
|
|||
}
|
||||
|
||||
@Override
|
||||
public void beginShard() throws IOException {
|
||||
public void beginShard() {
|
||||
eppResourceEntityReader.beginShard();
|
||||
}
|
||||
|
||||
|
|
|
@ -434,7 +434,7 @@ public class EppInput extends ImmutableObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String marshal(String ignored) throws Exception {
|
||||
public String marshal(String ignored) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class OfyFilter implements Filter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
public void init(FilterConfig config) {
|
||||
// Make sure that we've registered all types before we do anything else with Objectify.
|
||||
ObjectifyService.initOfy();
|
||||
}
|
||||
|
|
|
@ -43,12 +43,12 @@ public class EnumToAttributeAdapter<E extends Enum<E> & EnumToAttributeAdapter.E
|
|||
|
||||
// Enums that can be unmarshalled from input can override this.
|
||||
@Override
|
||||
public E unmarshal(EnumShim shim) throws Exception {
|
||||
public E unmarshal(EnumShim shim) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final EnumShim marshal(E enumeration) throws Exception {
|
||||
public final EnumShim marshal(E enumeration) {
|
||||
EnumShim shim = new EnumShim();
|
||||
shim.s = enumeration.getXmlName();
|
||||
return shim;
|
||||
|
|
|
@ -18,7 +18,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
|
||||
import com.jcraft.jsch.ChannelSftp;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* {@link ChannelSftp} wrapper that implements {@link Closeable}.
|
||||
|
@ -41,7 +40,7 @@ final class JSchSftpChannel implements Closeable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
public void close() {
|
||||
channel.disconnect();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import com.jcraft.jsch.Session;
|
|||
import com.jcraft.jsch.SftpException;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.Duration;
|
||||
|
@ -118,7 +117,7 @@ final class JSchSshSession implements Closeable {
|
|||
|
||||
/** @see com.jcraft.jsch.Session#disconnect() */
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
public void close() {
|
||||
session.disconnect();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ import google.registry.model.contact.ContactResource;
|
|||
import google.registry.rde.imports.RdeParser.RdeHeader;
|
||||
import google.registry.xjc.JaxbFragment;
|
||||
import google.registry.xjc.rdecontact.XjcRdeContactElement;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -74,8 +73,7 @@ public class RdeContactInput extends Input<JaxbFragment<XjcRdeContactElement>> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends InputReader<JaxbFragment<XjcRdeContactElement>>> createReaders()
|
||||
throws IOException {
|
||||
public List<? extends InputReader<JaxbFragment<XjcRdeContactElement>>> createReaders() {
|
||||
int numReaders = this.numReaders;
|
||||
RdeHeader header = newParser().getHeader();
|
||||
int numberOfContacts = header.getContactCount().intValue();
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RdeContactReader extends InputReader<JaxbFragment<XjcRdeContactElem
|
|||
}
|
||||
|
||||
@Override
|
||||
public JaxbFragment<XjcRdeContactElement> next() throws IOException {
|
||||
public JaxbFragment<XjcRdeContactElement> next() {
|
||||
if (count < maxResults) {
|
||||
if (parser == null) {
|
||||
parser = newParser();
|
||||
|
|
|
@ -31,7 +31,6 @@ import google.registry.model.domain.DomainResource;
|
|||
import google.registry.rde.imports.RdeParser.RdeHeader;
|
||||
import google.registry.xjc.JaxbFragment;
|
||||
import google.registry.xjc.rdedomain.XjcRdeDomainElement;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -74,8 +73,7 @@ public class RdeDomainInput extends Input<JaxbFragment<XjcRdeDomainElement>> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends InputReader<JaxbFragment<XjcRdeDomainElement>>> createReaders()
|
||||
throws IOException {
|
||||
public List<? extends InputReader<JaxbFragment<XjcRdeDomainElement>>> createReaders() {
|
||||
int numReaders = this.numReaders;
|
||||
RdeHeader header = newParser().getHeader();
|
||||
int numberOfDomains = header.getDomainCount().intValue();
|
||||
|
|
|
@ -79,7 +79,7 @@ public class RdeDomainReader extends InputReader<JaxbFragment<XjcRdeDomainElemen
|
|||
}
|
||||
|
||||
@Override
|
||||
public JaxbFragment<XjcRdeDomainElement> next() throws IOException {
|
||||
public JaxbFragment<XjcRdeDomainElement> next() {
|
||||
if (count < maxResults) {
|
||||
if (parser == null) {
|
||||
parser = newParser();
|
||||
|
|
|
@ -29,7 +29,6 @@ import google.registry.model.host.HostResource;
|
|||
import google.registry.rde.imports.RdeParser.RdeHeader;
|
||||
import google.registry.xjc.JaxbFragment;
|
||||
import google.registry.xjc.rdehost.XjcRdeHostElement;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -74,8 +73,7 @@ public class RdeHostInput extends Input<JaxbFragment<XjcRdeHostElement>> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<? extends InputReader<JaxbFragment<XjcRdeHostElement>>> createReaders()
|
||||
throws IOException {
|
||||
public List<? extends InputReader<JaxbFragment<XjcRdeHostElement>>> createReaders() {
|
||||
int numReaders = this.numReaders;
|
||||
RdeHeader header = createParser().getHeader();
|
||||
int numberOfHosts = header.getHostCount().intValue();
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RdeHostReader extends InputReader<JaxbFragment<XjcRdeHostElement>>
|
|||
}
|
||||
|
||||
@Override
|
||||
public JaxbFragment<XjcRdeHostElement> next() throws IOException {
|
||||
public JaxbFragment<XjcRdeHostElement> next() {
|
||||
if (count < maxResults) {
|
||||
if (parser == null) {
|
||||
parser = newParser();
|
||||
|
|
|
@ -22,7 +22,6 @@ import com.google.common.io.Resources;
|
|||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.util.ResourceUtils;
|
||||
import google.registry.util.SqlTemplate;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.LocalDate;
|
||||
|
@ -51,7 +50,7 @@ public final class ActivityReportingQueryBuilder implements QueryBuilder {
|
|||
|
||||
/** Returns the aggregate query which generates the activity report from the saved view. */
|
||||
@Override
|
||||
public String getReportQuery() throws IOException {
|
||||
public String getReportQuery() {
|
||||
return String.format(
|
||||
"#standardSQL\nSELECT * FROM `%s.%s.%s`",
|
||||
projectId,
|
||||
|
@ -61,7 +60,7 @@ public final class ActivityReportingQueryBuilder implements QueryBuilder {
|
|||
|
||||
/** Sets the month we're doing activity reporting for, and returns the view query map. */
|
||||
@Override
|
||||
public ImmutableMap<String, String> getViewQueryMap() throws IOException {
|
||||
public ImmutableMap<String, String> getViewQueryMap() {
|
||||
LocalDate firstDayOfMonth = yearMonth.toLocalDate(1);
|
||||
// The pattern-matching is inclusive, so we subtract 1 day to only report that month's data.
|
||||
LocalDate lastDayOfMonth = yearMonth.toLocalDate(1).plusMonths(1).minusDays(1);
|
||||
|
@ -70,7 +69,7 @@ public final class ActivityReportingQueryBuilder implements QueryBuilder {
|
|||
|
||||
/** Returns a map from view name to its associated SQL query. */
|
||||
private ImmutableMap<String, String> createQueryMap(
|
||||
LocalDate firstDayOfMonth, LocalDate lastDayOfMonth) throws IOException {
|
||||
LocalDate firstDayOfMonth, LocalDate lastDayOfMonth) {
|
||||
|
||||
ImmutableMap.Builder<String, String> queriesBuilder = ImmutableMap.builder();
|
||||
String operationalRegistrarsQuery =
|
||||
|
@ -141,7 +140,7 @@ public final class ActivityReportingQueryBuilder implements QueryBuilder {
|
|||
}
|
||||
|
||||
/** Returns {@link String} for file in {@code reporting/sql/} directory. */
|
||||
private static String getQueryFromFile(String filename) throws IOException {
|
||||
private static String getQueryFromFile(String filename) {
|
||||
return ResourceUtils.readResourceUtf8(getUrl(filename));
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ public class IcannHttpReporter {
|
|||
return success;
|
||||
}
|
||||
|
||||
private XjcIirdeaResult parseResult(byte[] content) throws XmlException, IOException {
|
||||
private XjcIirdeaResult parseResult(byte[] content) throws XmlException {
|
||||
XjcIirdeaResponseElement response =
|
||||
XjcXmlTransformer.unmarshal(
|
||||
XjcIirdeaResponseElement.class, new ByteArrayInputStream(content));
|
||||
|
|
|
@ -15,14 +15,13 @@
|
|||
package google.registry.reporting.icann;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.io.IOException;
|
||||
|
||||
/** Interface defining the necessary methods to construct ICANN reporting SQL queries. */
|
||||
public interface QueryBuilder {
|
||||
|
||||
/** Returns a map from an intermediary view's table name to the query that generates it. */
|
||||
ImmutableMap<String, String> getViewQueryMap() throws IOException;
|
||||
ImmutableMap<String, String> getViewQueryMap();
|
||||
|
||||
/** Returns a query that retrieves the overall report from the previously generated view. */
|
||||
String getReportQuery() throws IOException;
|
||||
String getReportQuery();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import com.google.common.io.Resources;
|
|||
import google.registry.config.RegistryConfig.Config;
|
||||
import google.registry.util.ResourceUtils;
|
||||
import google.registry.util.SqlTemplate;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
|
@ -52,7 +51,7 @@ public final class TransactionsReportingQueryBuilder implements QueryBuilder {
|
|||
|
||||
/** Returns the aggregate query which generates the transactions report from the saved view. */
|
||||
@Override
|
||||
public String getReportQuery() throws IOException {
|
||||
public String getReportQuery() {
|
||||
return String.format(
|
||||
"#standardSQL\nSELECT * FROM `%s.%s.%s`",
|
||||
projectId,
|
||||
|
@ -62,7 +61,7 @@ public final class TransactionsReportingQueryBuilder implements QueryBuilder {
|
|||
|
||||
/** Sets the month we're doing transactions reporting for, and returns the view query map. */
|
||||
@Override
|
||||
public ImmutableMap<String, String> getViewQueryMap() throws IOException {
|
||||
public ImmutableMap<String, String> getViewQueryMap() {
|
||||
// Set the earliest date to to yearMonth on day 1 at 00:00:00
|
||||
DateTime earliestReportTime = yearMonth.toLocalDate(1).toDateTime(new LocalTime(0, 0, 0));
|
||||
// Set the latest date to yearMonth on the last day at 23:59:59.999
|
||||
|
@ -72,7 +71,7 @@ public final class TransactionsReportingQueryBuilder implements QueryBuilder {
|
|||
|
||||
/** Returns a map from view name to its associated SQL query. */
|
||||
private ImmutableMap<String, String> createQueryMap(
|
||||
DateTime earliestReportTime, DateTime latestReportTime) throws IOException {
|
||||
DateTime earliestReportTime, DateTime latestReportTime) {
|
||||
|
||||
ImmutableMap.Builder<String, String> queriesBuilder = ImmutableMap.builder();
|
||||
String registrarIanaIdQuery =
|
||||
|
@ -179,7 +178,7 @@ public final class TransactionsReportingQueryBuilder implements QueryBuilder {
|
|||
}
|
||||
|
||||
/** Returns {@link String} for file in {@code reporting/sql/} directory. */
|
||||
private static String getQueryFromFile(String filename) throws IOException {
|
||||
private static String getQueryFromFile(String filename) {
|
||||
return ResourceUtils.readResourceUtf8(getUrl(filename));
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ final class AllocateDomainCommand extends MutatingEppToolCommand {
|
|||
private final List<Key<DomainApplication>> applicationKeys = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected String postExecute() throws Exception {
|
||||
protected String postExecute() {
|
||||
return ofy()
|
||||
.transactNewReadOnly(
|
||||
() -> {
|
||||
|
|
|
@ -65,7 +65,7 @@ class AppEngineConnection implements Connection {
|
|||
memoize(() -> xsrfTokenManager.generateToken(getUserId()));
|
||||
|
||||
@Override
|
||||
public void prefetchXsrfToken() throws IOException {
|
||||
public void prefetchXsrfToken() {
|
||||
// Cause XSRF token to be fetched, and then stay resident in cache (since it's memoized).
|
||||
xsrfToken.get();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class CheckSnapshotCommand implements RemoteApiCommand {
|
|||
private String snapshotName;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
Iterable<DatastoreBackupInfo> backups =
|
||||
DatastoreBackupService.get().findAllByNamePrefix(snapshotName);
|
||||
if (Iterables.isEmpty(backups)) {
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.File;
|
|||
/** Compare two database backups. */
|
||||
class CompareDbBackups {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
public static void main(String[] args) {
|
||||
if (args.length != 2) {
|
||||
System.err.println("Usage: compare_db_backups <directory1> <directory2>");
|
||||
return;
|
||||
|
|
|
@ -71,7 +71,7 @@ public abstract class ConfirmingCommand implements Command {
|
|||
* Perform any post-execution steps (e.g. verifying the result), and return a description String
|
||||
* to be printed if non-empty.
|
||||
*/
|
||||
protected String postExecute() throws Exception {
|
||||
protected String postExecute() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.beust.jcommander.Parameter;
|
|||
import com.beust.jcommander.Parameters;
|
||||
import com.google.common.base.Ascii;
|
||||
import google.registry.util.Idn;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/** Command to convert IDN labels to/from punycode. */
|
||||
|
@ -34,7 +33,7 @@ final class ConvertIdnCommand implements Command {
|
|||
private List<String> mainParameters;
|
||||
|
||||
@Override
|
||||
public void run() throws IOException {
|
||||
public void run() {
|
||||
for (String label : mainParameters) {
|
||||
if (label.startsWith(ACE_PREFIX)) {
|
||||
System.out.println(Idn.toUnicode(Ascii.toLowerCase(label)));
|
||||
|
|
|
@ -62,7 +62,7 @@ class CreateCdnsTld extends ConfirmingCommand {
|
|||
private ManagedZone managedZone;
|
||||
|
||||
@Override
|
||||
protected void init() throws IOException, GeneralSecurityException {
|
||||
protected void init() {
|
||||
managedZone =
|
||||
new ManagedZone()
|
||||
.setDescription(description)
|
||||
|
|
|
@ -56,7 +56,7 @@ final class CreateCreditBalanceCommand extends MutatingCommand {
|
|||
private DateTime effectiveTime;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
public void init() {
|
||||
Registrar registrar =
|
||||
checkArgumentPresent(
|
||||
Registrar.loadByClientId(clientId), "Registrar %s not found", clientId);
|
||||
|
|
|
@ -68,7 +68,7 @@ final class CreateCreditCommand extends MutatingCommand {
|
|||
private DateTime effectiveTime;
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
DateTime now = DateTime.now(UTC);
|
||||
Registrar registrar =
|
||||
checkArgumentPresent(
|
||||
|
|
|
@ -81,7 +81,7 @@ abstract class CreateOrUpdatePremiumListCommand extends ConfirmingCommand
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String prompt() throws Exception {
|
||||
protected String prompt() {
|
||||
return String.format(
|
||||
"You are about to save the premium list %s with %d items: ", name, inputLineCount);
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ abstract class CreateOrUpdateRegistrarCommand extends MutatingCommand {
|
|||
@Nullable
|
||||
abstract Registrar getOldRegistrar(String clientId);
|
||||
|
||||
protected void initRegistrarCommand() throws Exception {}
|
||||
protected void initRegistrarCommand() {}
|
||||
|
||||
@Override
|
||||
protected final void init() throws Exception {
|
||||
|
|
|
@ -269,7 +269,7 @@ abstract class CreateOrUpdateTldCommand extends MutatingCommand {
|
|||
/** Subclasses can override this to assert that the command can be run in this environment. */
|
||||
void assertAllowedEnvironment() {}
|
||||
|
||||
protected abstract void initTldCommand() throws Exception;
|
||||
protected abstract void initTldCommand();
|
||||
|
||||
@Override
|
||||
protected final void init() throws Exception {
|
||||
|
|
|
@ -58,7 +58,7 @@ final class CreateRegistrarCommand extends CreateOrUpdateRegistrarCommand
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void initRegistrarCommand() throws Exception {
|
||||
protected void initRegistrarCommand() {
|
||||
checkArgument(mainParameters.size() == 1, "Must specify exactly one client identifier.");
|
||||
checkArgumentNotNull(emptyToNull(password), "--password is a required field");
|
||||
checkArgumentNotNull(registrarName, "--name is a required field");
|
||||
|
@ -95,7 +95,7 @@ final class CreateRegistrarCommand extends CreateOrUpdateRegistrarCommand
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String postExecute() throws Exception {
|
||||
protected String postExecute() {
|
||||
if (!createGoogleGroups) {
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class CreateRegistrarGroupsCommand extends ConfirmingCommand
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void init() throws IOException {
|
||||
protected void init() {
|
||||
for (String clientId : clientIds) {
|
||||
Registrar registrar =
|
||||
checkArgumentPresent(
|
||||
|
|
|
@ -53,7 +53,7 @@ class CreateTldCommand extends CreateOrUpdateTldCommand {
|
|||
private Money initialRenewBillingCost;
|
||||
|
||||
@Override
|
||||
protected void initTldCommand() throws Exception {
|
||||
protected void initTldCommand() {
|
||||
checkArgument(initialTldState == null || tldStateTransitions.isEmpty(),
|
||||
"Don't pass both --initial_tld_state and --tld_state_transitions");
|
||||
checkArgument(initialRenewBillingCost == null || renewBillingCostTransitions.isEmpty(),
|
||||
|
|
|
@ -41,7 +41,7 @@ final class DeleteCreditCommand extends MutatingCommand {
|
|||
private long creditId;
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
Registrar registrar =
|
||||
checkArgumentPresent(
|
||||
Registrar.loadByClientId(clientId), "Registrar %s not found", clientId);
|
||||
|
|
|
@ -43,7 +43,7 @@ final class DeletePremiumListCommand extends ConfirmingCommand implements Remote
|
|||
private String name;
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
checkArgument(
|
||||
doesPremiumListExist(name),
|
||||
"Cannot delete the premium list %s because it doesn't exist.",
|
||||
|
@ -62,7 +62,7 @@ final class DeletePremiumListCommand extends ConfirmingCommand implements Remote
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String execute() throws Exception {
|
||||
protected String execute() {
|
||||
deletePremiumList(premiumList);
|
||||
return String.format("Deleted premium list '%s'.\n", premiumList.getName());
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ final class DeleteReservedListCommand extends MutatingCommand {
|
|||
private String name;
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
checkArgument(
|
||||
ReservedList.get(name).isPresent(),
|
||||
"Cannot delete the reserved list %s because it doesn't exist.",
|
||||
|
|
|
@ -52,7 +52,7 @@ final class DeleteTldCommand extends ConfirmingCommand implements RemoteApiComma
|
|||
* accidental deletion of established TLDs with domains on them.
|
||||
*/
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
registry = Registry.get(tld);
|
||||
checkState(registry.getTldType().equals(TldType.TEST), "Cannot delete a real TLD");
|
||||
|
||||
|
@ -77,7 +77,7 @@ final class DeleteTldCommand extends ConfirmingCommand implements RemoteApiComma
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String execute() throws Exception {
|
||||
protected String execute() {
|
||||
ofy().transactNew(new VoidWork() {
|
||||
@Override
|
||||
public void vrun() {
|
||||
|
|
|
@ -25,7 +25,7 @@ public class DeployInvoicingPipelineCommand implements Command {
|
|||
@Inject InvoicingPipeline invoicingPipeline;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
invoicingPipeline.deploy();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public class GenerateAllocationTokensCommand implements RemoteApiCommand {
|
|||
private static final int BATCH_SIZE = 20;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
int tokensSaved = 0;
|
||||
do {
|
||||
ImmutableSet<AllocationToken> tokens =
|
||||
|
|
|
@ -79,7 +79,7 @@ final class GenerateEscrowDepositCommand implements RemoteApiCommand {
|
|||
@Inject @Named("rde-report") Queue queue;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
|
||||
if (tlds.isEmpty()) {
|
||||
throw new ParameterException("At least one TLD must be specified");
|
||||
|
|
|
@ -47,7 +47,7 @@ public final class GetLrpTokenCommand implements RemoteApiCommand {
|
|||
private boolean includeHistory = false;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
checkArgument(
|
||||
(tokenString == null) == (assignee != null),
|
||||
"Exactly one of either token or assignee must be specified.");
|
||||
|
|
|
@ -21,7 +21,7 @@ import google.registry.model.SchemaVersion;
|
|||
@Parameters(commandDescription = "Generate a model schema file")
|
||||
final class GetSchemaCommand implements Command {
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
System.out.println(SchemaVersion.getSchema());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ final class GetSchemaTreeCommand implements Command {
|
|||
private Multimap<Class<?>, Class<?>> superclassToSubclasses;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
// Get the @Parent type for each class.
|
||||
Map<Class<?>, Class<?>> entityToParentType = new HashMap<>();
|
||||
for (Class<?> clazz : ALL_CLASSES) {
|
||||
|
|
|
@ -36,7 +36,7 @@ final class HelpCommand implements Command {
|
|||
private List<String> mainParameters = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
String target = getOnlyElement(mainParameters, null);
|
||||
if (target == null) {
|
||||
jcommander.usage();
|
||||
|
|
|
@ -49,7 +49,7 @@ final class ListCursorsCommand implements RemoteApiCommand {
|
|||
private boolean filterEscrowEnabled;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
List<String> lines = new ArrayList<>();
|
||||
for (String tld : Registries.getTlds()) {
|
||||
Registry registry = Registry.get(tld);
|
||||
|
|
|
@ -84,7 +84,7 @@ class LoadTestCommand extends ConfirmingCommand implements ServerSideCommand {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkExecutionState() throws Exception {
|
||||
protected boolean checkExecutionState() {
|
||||
if (RegistryToolEnvironment.get() == RegistryToolEnvironment.PRODUCTION) {
|
||||
System.err.println("You may not run a load test against production.");
|
||||
return false;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class LockDomainCommand extends LockOrUnlockDomainCommand {
|
|||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@Override
|
||||
protected void initMutatingEppToolCommand() throws Exception {
|
||||
protected void initMutatingEppToolCommand() {
|
||||
// Project all domains as of the same time so that argument order doesn't affect behavior.
|
||||
DateTime now = DateTime.now(UTC);
|
||||
for (String domain : getDomains()) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public abstract class MutatingEppToolCommand extends EppToolCommand {
|
|||
boolean dryRun;
|
||||
|
||||
@Override
|
||||
protected boolean checkExecutionState() throws Exception {
|
||||
protected boolean checkExecutionState() {
|
||||
checkArgument(!(force && isDryRun()), "--force and --dry_run are incompatible");
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ final class PendingEscrowCommand implements RemoteApiCommand {
|
|||
PendingDepositChecker checker;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
System.out.println(
|
||||
SORTER
|
||||
.sortedCopy(checker.getTldsAndWatermarksPendingDepositForRdeAndBrda().values())
|
||||
|
|
|
@ -41,7 +41,7 @@ public final class ResaveEntitiesCommand extends MutatingCommand {
|
|||
List<String> mainParameters;
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
for (List<String> batch : partition(mainParameters, BATCH_SIZE)) {
|
||||
for (String websafeKey : batch) {
|
||||
ImmutableObject entity = ofy().load().key(Key.<ImmutableObject>create(websafeKey)).now();
|
||||
|
|
|
@ -37,7 +37,7 @@ final class ResaveEnvironmentEntitiesCommand implements RemoteApiCommand {
|
|||
private static final int BATCH_SIZE = 10;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
batchSave(Registry.class);
|
||||
batchSave(Registrar.class);
|
||||
batchSave(RegistrarContact.class);
|
||||
|
|
|
@ -47,7 +47,7 @@ public final class ResaveEppResourceCommand extends MutatingCommand {
|
|||
protected String uniqueId;
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
Key<? extends EppResource> resourceKey = checkArgumentNotNull(
|
||||
type.getKey(uniqueId, DateTime.now(UTC)),
|
||||
"Could not find active resource of type %s: %s", type, uniqueId);
|
||||
|
|
|
@ -25,7 +25,7 @@ interface ServerSideCommand extends RemoteApiCommand {
|
|||
/** An http connection to AppEngine. */
|
||||
interface Connection {
|
||||
|
||||
void prefetchXsrfToken() throws IOException;
|
||||
void prefetchXsrfToken();
|
||||
|
||||
String send(String endpoint, Map<String, ?> params, MediaType contentType, byte[] payload)
|
||||
throws IOException;
|
||||
|
|
|
@ -221,7 +221,7 @@ final class SetupOteCommand extends ConfirmingCommand implements RemoteApiComman
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String prompt() throws Exception {
|
||||
protected String prompt() {
|
||||
// Each underlying command will confirm its own operation as well, so just provide
|
||||
// a summary of the steps in this command.
|
||||
if (eapOnly) {
|
||||
|
|
|
@ -248,7 +248,7 @@ public class ShellCommand implements Command {
|
|||
*
|
||||
* <p>Dumps the last line of output prior to doing this.
|
||||
*/
|
||||
private void emitSuccess() throws IOException {
|
||||
private void emitSuccess() {
|
||||
System.out.println(SUCCESS);
|
||||
System.out.flush();
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ public class ShellCommand implements Command {
|
|||
*
|
||||
* <p>Dumps the last line of output prior to doing this.
|
||||
*/
|
||||
private void emitFailure(Throwable e) throws IOException {
|
||||
private void emitFailure(Throwable e) {
|
||||
System.out.println(
|
||||
FAILURE
|
||||
+ e.getClass().getName()
|
||||
|
|
|
@ -100,7 +100,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
ImmutableSortedSet<String> existingDsData;
|
||||
|
||||
@Override
|
||||
protected void initMutatingEppToolCommand() throws ParseException {
|
||||
protected void initMutatingEppToolCommand() {
|
||||
superuser = true;
|
||||
DateTime now = DateTime.now(UTC);
|
||||
ImmutableSet<String> newHostsSet = ImmutableSet.copyOf(newHosts);
|
||||
|
@ -176,7 +176,7 @@ final class UniformRapidSuspensionCommand extends MutatingEppToolCommand {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String postExecute() throws Exception {
|
||||
protected String postExecute() {
|
||||
if (undo) {
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class UnlockDomainCommand extends LockOrUnlockDomainCommand {
|
|||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@Override
|
||||
protected void initMutatingEppToolCommand() throws Exception {
|
||||
protected void initMutatingEppToolCommand() {
|
||||
// Project all domains as of the same time so that argument order doesn't affect behavior.
|
||||
DateTime now = DateTime.now(UTC);
|
||||
for (String domain : getDomains()) {
|
||||
|
|
|
@ -65,7 +65,7 @@ final class UpdateApplicationStatusCommand extends MutatingCommand {
|
|||
private String clientId = "CharlestonRoad";
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
checkArgumentPresent(
|
||||
Registrar.loadByClientId(clientId), "Registrar with client ID %s not found", clientId);
|
||||
for (final String applicationId : ids) {
|
||||
|
|
|
@ -62,7 +62,7 @@ final class UpdateClaimsNoticeCommand implements RemoteApiCommand {
|
|||
private String acceptedTime;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
public void run() {
|
||||
final LaunchNotice launchNotice = LaunchNotice.create(
|
||||
tcnId, validatorId, DateTime.parse(expirationTime), DateTime.parse(acceptedTime));
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ final class UpdateCursorsCommand extends MutatingCommand {
|
|||
private DateTime newTimestamp;
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
if (isNullOrEmpty(tlds)) {
|
||||
Cursor cursor = ofy().load().key(Cursor.createGlobalKey(cursorType)).now();
|
||||
stageEntityChange(cursor, Cursor.createGlobal(cursorType, newTimestamp));
|
||||
|
|
|
@ -127,7 +127,7 @@ class UpdateTldCommand extends CreateOrUpdateTldCommand {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void initTldCommand() throws Exception {
|
||||
protected void initTldCommand() {
|
||||
// Due to per-instance caching on Registry, different instances can end up in different TLD
|
||||
// states at the same time, so --set_current_tld_state should never be used in production.
|
||||
checkArgument(
|
||||
|
|
|
@ -51,12 +51,12 @@ final class UploadClaimsListCommand extends ConfirmingCommand implements RemoteA
|
|||
}
|
||||
|
||||
@Override
|
||||
protected String prompt() throws Exception {
|
||||
protected String prompt() {
|
||||
return String.format("\nNew claims list:\n%s", claimsList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String execute() throws IOException {
|
||||
public String execute() {
|
||||
claimsList.save();
|
||||
return String.format("Successfully uploaded claims list %s", claimsListFilename);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.Objects;
|
|||
public class PopulateNullRegistrarFieldsCommand extends MutatingCommand {
|
||||
|
||||
@Override
|
||||
protected void init() throws Exception {
|
||||
protected void init() {
|
||||
for (Registrar registrar : ofy().load().type(Registrar.class).ancestor(getCrossTldKey())) {
|
||||
Builder changeBuilder = registrar.asBuilder();
|
||||
changeBuilder.setRegistrarName(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue