For the purpose of maintaining order and avoiding the disruption in the provision of law enforcement services and the operation of the county jail, the highest ranking deputy sheriff in the office of the sheriff shall discharge the duties of the sheriff when any of the following apply:

(1) When the office of the sheriff is vacant and until a successor is qualified.

Terms Used In Alabama Code 36-22-3.1

(2) When the sheriff is incompetent to act.
(3) When the sheriff is imprisoned.
(4) In any criminal proceeding involving the discharge of the duties of the office of the sheriff in which the sheriff is a party.
(5) In any case when directed by the judge of probate.