Believe it or not, but this was a common occurrence for actual people during the American Civil War. Composers from both sides of the war wrote and published many songs honoring individual politicians, generals, and victorious campaigns, including—
Every U.S. Military General and Admiral also gets a relatively simple series of ruffles and flourishes (which are played on drums and bugles, respectively), one of each per star (4 for a full General/Admiral, 3 for a Lieutenant General/Vice Admiral, etc.).
The President, incidentally, also gets four ruffles and flourishes...followed by "Hail to the Chief."
Individual warships can have a "Ship's Song," usually either as an appropriated popular song with some symbolic connection to the ship, or lyrics set to the tune of another song. Sometimes, an original composition is created by composers or artists in honor of the ship.
Jeremy Woolstenhulme composed a "musical portrait" for the first USS Constitution, one of the original six sailing frigates of the U.S. Navy and the most famous of them all—"Old Ironsides, Champion of the Seas."
Despite being about the First Patriotic War, when Napoleon was driven out of Russia in a brutal winter campaign, and including leitmotifs from both God Save The Tsar and La Marseillaise, the 1812 Overture by Pyotr Ilych Tchaikovsiy is still used to denote Independence Day in the United States. For added Irony-points, the version used is often the post-1917 version, which replaces the leitmotif from God Save The Tsar with one from Slavsya Rus, by Mikhail Glinka. This arrangement was one promoted by the Soviet Union, so as to avoid having to expose their citizenry to God Save The Tsar.
Beethoven's 5th Symphony was appropriated as a Leit Motif for the Western Allies in World War II for a number of reasons. The first bar matched the Morse Code for the letter V (dot-dot-dot-dash). V was for Victory, and the two fingered hand gesture popularized by Churchill. The propaganda value of Germany's greatest composer was being used against Germany was not lost, either.