BackupService { void validateRequestingSender(InternalDistributedMember sender) { Set allIds = cache.getDistributionManager().addAllMembershipListenerAndGetAllIds(membershipListener); if (!allIds.contains(sender)) { abortBackup(); throw new IllegalStateException("The member requesting a backup has already departed"); } } BackupService(InternalCache cache); HashSet<PersistentID> prepareBackup(InternalDistributedMember sender, BackupWriter writer); HashSet<PersistentID> doBackup(); void waitForBackup(); DiskStoreBackup getBackupForDiskStore(DiskStoreImpl diskStore); boolean deferDrfDelete(DiskStoreImpl diskStore, Oplog oplog); boolean deferCrfDelete(DiskStoreImpl diskStore, Oplog oplog); void abortBackup(); static final String TEMPORARY_DIRECTORY_FOR_BACKUPS; }
@Test public void throwsExceptionWhenBackupRequesterHasLeftDistributedSystem() { InternalDistributedMember oldSender = new InternalDistributedMember("localhost", 5556); assertThatThrownBy(() -> backupService.validateRequestingSender(oldSender)) .isInstanceOf(IllegalStateException.class); }