This repository holds a collection of little helpers for the XMPP Smack library. They are written in Scala.
Most of the helpers are just wrappers for an easier (but also less powerful) API of existing Smack functionalities.
WARNING: They might be incomplete and unstable so be careful ;-)
XEP-0133 is a recommendation for best practices for service-level administration of servers and components using Ad-Hoc Commands.
- Add User
- Delete User
- Disable User
- Re-Enable User
- Change User Password
val serviceAdmin = new ServiceAdministration( connection, "example.org" )
serviceAdmin.addUser("new@example.org", "secret")
serviceAdmin.deleteUser("old@example.org")
serviceAdmin.disableUser("badguy@example.org")
serviceAdmin.reEnableUser("goodguy@example.org")
serviceAdmin.changeUserPassword("goodguy@example.org", "newSecret")
XEP-0222 and XEP-0223 define best practices for using the XMPP publish-subscribe extension to persistently store semi-public/private data objects.
val db = new PubSubStorage( connection )
val storageNode = db.createNode("myNodeId")
val myObj = storageNode.get("myItemId") match {
case o:Some[MyObjClass] => MyObjClass.fromXmlNode(o)
case None => throw new Exception("could not load object")
}
myObj.changeSomething()
storageNode.set(myObj.toXmlNode, myObj.getId)