mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Add mapreduce cleanup action
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149432516
This commit is contained in:
parent
bd7db61606
commit
5d4287a375
11 changed files with 1171 additions and 2 deletions
|
@ -14,12 +14,19 @@
|
|||
|
||||
package google.registry.batch;
|
||||
|
||||
import static google.registry.request.RequestParameters.extractOptionalBooleanParameter;
|
||||
import static google.registry.request.RequestParameters.extractOptionalIntParameter;
|
||||
import static google.registry.request.RequestParameters.extractOptionalParameter;
|
||||
|
||||
import com.google.api.services.bigquery.model.TableFieldSchema;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import dagger.multibindings.IntoMap;
|
||||
import dagger.multibindings.StringKey;
|
||||
import google.registry.request.Parameter;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* Dagger module for injecting common settings for batch actions.
|
||||
|
@ -33,4 +40,34 @@ public class BatchModule {
|
|||
static ImmutableList<TableFieldSchema> provideEntityIntegrityAlertsSchema() {
|
||||
return EntityIntegrityAlertsSchema.SCHEMA_FIELDS;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("jobName")
|
||||
static Optional<String> provideJobName(HttpServletRequest req) {
|
||||
return extractOptionalParameter(req, "jobName");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("jobId")
|
||||
static Optional<String> provideJobId(HttpServletRequest req) {
|
||||
return extractOptionalParameter(req, "jobId");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("numJobsToDelete")
|
||||
static Optional<Integer> provideNumJobsToDelete(HttpServletRequest req) {
|
||||
return extractOptionalIntParameter(req, "numJobsToDelete");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("daysOld")
|
||||
static Optional<Integer> provideDaysOld(HttpServletRequest req) {
|
||||
return extractOptionalIntParameter(req, "daysOld");
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter("force")
|
||||
static Optional<Boolean> provideForce(HttpServletRequest req) {
|
||||
return extractOptionalBooleanParameter(req, "force");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue