OF-284: Additional commands for XEP-0133 (#2381)
* OF-284: Add Missing Commands for XEP-0133 "Service Administration"
This commit adds almost all ad-hoc commands that are defined in XEP-0133, but were missing in Openfire.
Notable exceptions:
- Get User Password - I deem it unsafe to store/expose plaintext credentials
- Get User Last Login Time - Openfire does not track this data
- Get User Statistics
- Set Message of the Day - MotD functionality could possibly be added in the MotD plugin
- Edit Message of the Day
- Delete Message of the Day
- Set Welcome Message - Welcome message functionality could possibly be added in the Registration plugin
- Delete Welcome Message
- Restart Service - Unsafe: what if the stop works, but the start does not?
- Shut Down Service - Unsafe: we'll end up with admins complaining about an unreachable server
Prior to this, an optional SessionData object was passed along when executing stages of an ad-hoc command. This object was non-null only when the command had multiple stages. The rationale for this was that only multi-staged commands needed to carry over session state.
The session data also includes a bit of metadata (the JID of the actor executing the command). This is desirable to have even when executing only a one-stage command.
This commit makes the sessionData instance a non-optional argument.
* OF-284: Switch AuthenticateUser to use jid-single
To be consistent with other fields, and makes sense anyway. Was causing an issue with Spark's registry of fields when 2 fields in the same namespace had different types.
OF-2781: Prevent ClassCastException when creating SerializingCache
The newly created cache gets wrapped (so that its implementation can be changed on the fly, when clustering starts or stops). The previous implementation caused a ClassCastException that is herein prevented.
OF-2782: Unsure SerializingCache retains functionality after cluster state change
When a server joins or leaves a cluster, all clustered caches are recreated. SerializingCaches should be recreated as such.
OF-2768: set `creationDate` and `modificationDate` to null by default
When the implementation of the `UserProvider` does not provide a
valid `creationDate` or `modificationDate` we want to default to
null instead of setting those values to now.