3-1-402. Powers of judicial officers as to conduct of proceedings. A judicial officer has the power to:
(1) preserve and enforce order in the officer's immediate presence and in proceedings before the officer when the officer is engaged in the performance of official duties;
(2) compel obedience to the officer's official orders, as provided in this code;
(3) compel the attendance of persons to testify in a proceeding before the officer in the cases and manner provided in this code;
(4) administer oaths to persons in a proceeding pending before the officer and in all other cases in which it may be necessary in the exercise of the officer's powers and duties.