Custom ad-hoc command
I am implementing a cutsom ad-hoc command.
And I need to get all items from dynamic roster for user.
Can i get access to dynamic roster items from ad-hoc command and how?
In my case dynamic roster is custom java plugin (like DynamicRosterTest123.java class).
I saw roster's ad-hoc commands from box, but they use user's roster (not dynamic roster):
- If user online - from memory:
RosterAbstract rosterUtil = RosterFactory.getRosterImplementation(true)
- If user offline - from repository (database):
String rosterStr = repository.getData(ownerBareJID, null, RosterAbstract.ROSTER, null)
Thx and best regards.
Added by Artur Hefczyc over 4 years ago
You provided too little information to suggest you a good approach. Have you tried to instantiate DynamicRosterTest123.java class in your ad-hoc command and then directly retrieve the dynamic roster for a user? Good thing about this approach is that it would work regardless the user is online or offline.