+ private void onSelectOwner(SelectOwner selectOwner) {
+ String currentOwner = getCurrentOwner(selectOwner.getEntityPath());
+ if(Strings.isNullOrEmpty(currentOwner)) {
+ String entityType = EntityOwnersModel.entityTypeFromEntityPath(selectOwner.getEntityPath());
+ writeNewOwner(selectOwner.getEntityPath(), newOwner(selectOwner.getAllCandidates(),
+ entityOwnershipStatistics.byEntityType(entityType),
+ selectOwner.getOwnerSelectionStrategy()));
+
+ Cancellable cancellable = entityToScheduledOwnershipTask.get(selectOwner.getEntityPath());
+ if(cancellable != null){
+ if(!cancellable.isCancelled()){
+ cancellable.cancel();
+ }
+ entityToScheduledOwnershipTask.remove(selectOwner.getEntityPath());
+ }
+ }
+ }
+