Change all uses of legacy sharedFields to use EppResource fields

This is the penultimate step of migrating away from sharedFields. The next step is to remove them entirely.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=116364048
This commit is contained in:
mcilwain 2016-03-04 08:27:27 -08:00 committed by Justine Tunney
parent 675ec8f086
commit 363c812d10
7 changed files with 11 additions and 34 deletions

View file

@ -35,7 +35,6 @@ import com.googlecode.objectify.annotation.Embed;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.IgnoreSave;
import com.googlecode.objectify.annotation.Index;
import com.googlecode.objectify.annotation.OnLoad;
import com.googlecode.objectify.condition.IfNull;
import org.joda.time.DateTime;
@ -62,6 +61,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable,
// TODO(b/19035583): Remove this after touching all resources and waiting long enough to be sure
// we don't need to reload old commit logs.
@XmlTransient
@Deprecated
SharedFields sharedFields = new SharedFields();
/** The ID of the registrar that is currently sponsoring this resource. */
@ -272,25 +272,6 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable,
TransferData transferData;
}
/** Read sharedFields values into their new locations. */
// TODO(b/25442343,b/19035583): Remove this.
@OnLoad
public void loadLegacySharedFields() {
currentSponsorClientId = sharedFields.currentSponsorClientId;
creationClientId = sharedFields.creationRegistryClientId;
lastEppUpdateClientId = sharedFields.lastUpdateRegistryClientId;
creationTime = sharedFields.creationTime;
deletionTime = sharedFields.deletionTime;
lastEppUpdateTime = sharedFields.lastUpdateTime;
lastTransferTime = sharedFields.lastTransferTime;
status = sharedFields.statusValues == null
? null
: FluentIterable.from(sharedFields.statusValues)
.transform(StatusValue.LEGACY_CONVERTER.reverse())
.toSet();
transferData = sharedFields.transferData;
}
/** Abstract builder for {@link EppResource} types. */
public abstract static class Builder<T extends EppResource, B extends Builder<?, ?>>
extends GenericBuilder<T, B> {