(1) To preserve and enforce order in his immediate presence and in the proceedings before him, when he is engaged in the performance of a duty imposed on him by law;
(2) To compel obedience to his lawful orders;
(3) To compel the attendance of persons to testify in a proceeding pending before him; and
(4) To administer oaths to persons in a proceeding pending before him, and in all other cases where it may be necessary in the exercise of his powers or the performances of his duties.