class MastershipManager extends AbstractListenerManager<MastershipEvent, MastershipListener> implements MastershipService, MastershipAdminService, MastershipTermService,
               MetricsHelper {

    @Override
    public CompletableFuture<MastershipRole> requestRoleFor(DeviceId deviceId) {
        checkPermission(CLUSTER_WRITE);

        checkNotNull(deviceId, DEVICE_ID_NULL);
        final Context timer = startTimer(requestRoleTimer);
        return store.requestRole(deviceId).whenComplete((result, error) -> stopTimer(timer));

    }

}