These are things that David says he will do, along with "seeing the prosperity of your chosen." The words "I will" may be repeated here. "I will rejoice in the gladness ... and I will glory"
Here the phrase "your inheritance" refers to the Isrealites, who are Yahweh's chosen people. Here "glory" means "to boast about" something; in this case they are boasting about Yahweh. Alternate translation: "boast of your greatness with your people" or "boast with your people about you" (See: [[rc://en/ta/man/translate/figs-metonymy]])