public interface LocalSoneDatabase {
Optional<LocalSone> getLocalSone(String localSoneId);
- Sone registerLocalSone(OwnIdentity ownIdentity);
+ LocalSone registerLocalSone(OwnIdentity ownIdentity);
String getLastInsertFingerprint(Sone sone);
void setLastInsertFingerprint(Sone sone, String lastInsertFingerprint);
}
@Override
- public Sone registerLocalSone(OwnIdentity ownIdentity) {
- final Sone localSone = loadLocalSone(ownIdentity);
+ public LocalSone registerLocalSone(OwnIdentity ownIdentity) {
+ final LocalSone localSone = loadLocalSone(ownIdentity);
localSones.add(ownIdentity.getId());
return localSone;
}
- private Sone loadLocalSone(OwnIdentity ownIdentity) {
- Sone localSone = newSoneBuilder().local().from(ownIdentity).build();
+ private LocalSone loadLocalSone(OwnIdentity ownIdentity) {
+ LocalSone localSone = (LocalSone) newSoneBuilder().local().from(ownIdentity).build();
localSone.setLatestEdition(
Optional.fromNullable(
Longs.tryParse(ownIdentity.getProperty(LATEST_EDITION_PROPERTY)))
return localSone;
}
- public void loadSone(Sone sone) {
+ public void loadSone(LocalSone sone) {
long soneTime = configurationLoader.getLocalSoneTime(sone.getId());
if (soneTime == -1) {
return;