- nextId = ClientIdentifier.create(currentFrontend, lastId.getGeneration() + 1);
- } else {
- nextId = ClientIdentifier.create(currentFrontend, initialGeneration());
+ private void onSnapshotOffer(final SnapshotOffer snapshotOffer) {
+ lastId = (ClientIdentifier) snapshotOffer.snapshot();
+ LOG.debug("{}: recovered identifier {}", persistenceId(), lastId);
+ }
+
+ private SavingClientActorBehavior onRecoveryCompleted(final RecoveryCompleted msg) {
+ final ClientIdentifier nextId;
+ if (lastId != null) {
+ if (!currentFrontend.equals(lastId.getFrontendId())) {
+ LOG.error("{}: Mismatched frontend identifier, shutting down. Current: {} Saved: {}",
+ persistenceId(), currentFrontend, lastId.getFrontendId());
+ return null;