mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 16:37:13 +02:00
Allow RdeStagingAction to be invoked manually
RdeStagingAction always processed all RDE and BRDA deposits currently outstanding, updating the cursors appropriately and kicking off the upload job. Sometimes we don't want all that. We just want to create a specific deposit by hand, without modifying the cursors or uploading. This CL adds parameters to support that. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=152415959
This commit is contained in:
parent
08009e755f
commit
4f94464eaf
8 changed files with 499 additions and 25 deletions
|
@ -15,6 +15,7 @@
|
|||
package google.registry.rde;
|
||||
|
||||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.base.Optional;
|
||||
import google.registry.model.common.Cursor.CursorType;
|
||||
import google.registry.model.rde.RdeMode;
|
||||
import java.io.Serializable;
|
||||
|
@ -27,15 +28,67 @@ public abstract class PendingDeposit implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 3141095605225904433L;
|
||||
|
||||
/**
|
||||
* True if deposits should be generated via manual operation, which does not update the cursor,
|
||||
* and saves the generated deposits in a special manual subdirectory tree.
|
||||
*/
|
||||
public abstract boolean manual();
|
||||
|
||||
/** TLD for which a deposit should be generated. */
|
||||
public abstract String tld();
|
||||
|
||||
/** Watermark date for which a deposit should be generated. */
|
||||
public abstract DateTime watermark();
|
||||
|
||||
/** Which type of deposit to generate: full (RDE) or thin (BRDA). */
|
||||
public abstract RdeMode mode();
|
||||
public abstract CursorType cursor();
|
||||
public abstract Duration interval();
|
||||
|
||||
/** The cursor type to update (not used in manual operation). */
|
||||
public abstract Optional<CursorType> cursor();
|
||||
|
||||
/** Amount of time to increment the cursor (not used in manual operation). */
|
||||
public abstract Optional<Duration> interval();
|
||||
|
||||
/**
|
||||
* Subdirectory of bucket/manual in which files should be placed, including a trailing slash (used
|
||||
* only in manual operation).
|
||||
*/
|
||||
public abstract Optional<String> directoryWithTrailingSlash();
|
||||
|
||||
/**
|
||||
* Revision number for generated files; if absent, use the next available in the sequence (used
|
||||
* only in manual operation).
|
||||
*/
|
||||
public abstract Optional<Integer> revision();
|
||||
|
||||
static PendingDeposit create(
|
||||
String tld, DateTime watermark, RdeMode mode, CursorType cursor, Duration interval) {
|
||||
return new AutoValue_PendingDeposit(tld, watermark, mode, cursor, interval);
|
||||
return new AutoValue_PendingDeposit(
|
||||
false,
|
||||
tld,
|
||||
watermark,
|
||||
mode,
|
||||
Optional.of(cursor),
|
||||
Optional.of(interval),
|
||||
Optional.<String>absent(),
|
||||
Optional.<Integer>absent());
|
||||
}
|
||||
|
||||
static PendingDeposit createInManualOperation(
|
||||
String tld,
|
||||
DateTime watermark,
|
||||
RdeMode mode,
|
||||
String directoryWithTrailingSlash,
|
||||
Optional<Integer> revision) {
|
||||
return new AutoValue_PendingDeposit(
|
||||
true,
|
||||
tld,
|
||||
watermark,
|
||||
mode,
|
||||
Optional.<CursorType>absent(),
|
||||
Optional.<Duration>absent(),
|
||||
Optional.of(directoryWithTrailingSlash),
|
||||
revision);
|
||||
}
|
||||
|
||||
PendingDeposit() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue