{"id":37,"date":"2007-03-28T11:29:58","date_gmt":"2007-03-28T10:29:58","guid":{"rendered":"http:\/\/technologies.kmi.open.ac.uk\/msg\/developer\/msg-architecture-documentation\/"},"modified":"2007-06-14T10:58:17","modified_gmt":"2007-06-14T09:58:17","slug":"msg-architecture-documentation","status":"publish","type":"page","link":"http:\/\/technologies.kmi.open.ac.uk\/msg\/developer\/msg-architecture-documentation\/","title":{"rendered":"MSG Architecture"},"content":{"rendered":"


\nMSG Server and Client Architecture Diagram<\/em><\/p>\n

MSG AJAX Web Client<\/h3>\n\n\n
Source module: MSGClient<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

This is the main MSG user interface. You can login via this interface at http:\/\/msg.open.ac.uk\/msg<\/a> <\/p>\n

Connection, contacts, messaging and presence states are all handled via calls to the BuddyXML service described below via Javascript’s XMLHttpRequest function. An important fearture of this web client is that is supports instant notification state changes and messages. It achieves this by use of the BuddyXML wait command which is designed to hold its response until events occur. So, it could be said that the client spends most of its time waiting for responses from asynchronous requests to buddyxml service. This is important because the persistent socket communications normally used to implement an XMPP\/Jabber client are not possible in the web browser without resorting to third party plugins or applets. The ‘cost’ of doing this type of http binding may not be as significant as you might expect since actual browser socket reconnections are reduced by use of http keep-alive. <\/p>\n

BuddyXML<\/h3>\n\n\n
Source module: BuddyXML<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

BuddyXML is a service that acts as the HTTP bridge between client and jabber server. It opens a persistent XMPP connection to a Jabber server, one for each connected user (i.e. tomcat session).
\n The service maintains an internal queue of a subset of XMPP events. The events are dispatched to clients when they are requested by a call to the service.<\/p>\n

BuddyXML supports JSON style output to work around the “Same Source Connection” security constraint that applies to javascript XMLHttpRequest. This output mode is used to implement cross-server mashup integration with MSG. For example, this mode can be used to add presence, notification and click to chat functionality to other web applications or portal type environments. <\/p>\n

The purpose of the link between this service and the Openfire mashup plugin is to provide an authentication route to Openfire that doesn’t involve creating a new jabber session. The link allows a user to attach to a pre-existing session without creating multiple jabber sessions. For example, if a user logs in using MSGAlert, then logs in again using the MSG Client. BuddyXML can use this authentication route to verify credentials before attaching the client to the existing BuddyXML session.<\/p>\n

For tutorial and test page for BuddyXML service go to: http:\/\/msg.open.ac.uk\/buddyxml-tutorial\/<\/a><\/p>\n

MSG Client API<\/h3>\n\n\n
Source module: MSGClientAPI<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

This is a JavaScript library that allows a very quick route to adding MSG presence and click to chat functionality to a web site.  Note that this API uses the JSON output mode of BuddyXML to allow cross server AJAX integration. Note that although this API was designed for web integration, it was not used to implement the MSG AJAX Web Client described above. <\/p>\n

For more information go to: http:\/\/technologies.kmi.open.ac.uk\/msg\/developer\/msg-api-guide\/<\/a><\/p>\n

MSGAlert<\/h3>\n\n\n
Source module: MSGAlert<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

A small application that maintains Jabber connection and provides notification of new messages.<\/p>\n

When logging in using MSGAlert<\/em>, the application opens a connection on port 5225 to the Notifier Service.<\/em> The username, password and Jabber host are transmitted to the Notifier Service, which in turn makes a call to the BuddyXML servlet to connect to the Jabber Server.  <\/p>\n

Once connection is established, the id of the tomcat session created is returned to MSGAlert. It retains this session id which is used when launching the webclient. It allows the browser to attach to the tomcat session created by the Notifier Service.<\/p>\n

MSGAlert also supports jabber presence changes. Presence status can be set in either MSGAlert or MSG WebClient, and this status is immediately reflected in both places.<\/p>\n

Openfire Jabber Server<\/h3>\n\n\n
Source module: Openfire<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

An open source Java based Jabber\/XMPP server, provided by Ignite Realtime http:\/\/www.igniterealtime.org\/<\/a>  This server supports flexible mechanisms for overriding Authentication, User and Group provision, and facilities to extend services via plugin modules.<\/p>\n

We are currently using versions 3.3.1, but it requires a small modification to the code base to class org.jivesoftware.openfire.session.ClientSession in order to support a mismatch between authenticated username and JID username. E.g. when using session tokens for SSO authentication. <\/p>\n

Moodle MSG XML Services<\/h3>\n\n\n
 <\/td>\n<\/tr>\n<\/table>\n

These services provide a link Moodle user, group and authentication information for Openfire. wildfire-extra.jar uses these services to request moodle user information that needs to be replicated in the Openfire database. <\/p>\n

To enable the Moodle replication within wildfire-extras, set the openfire system properties e.g.:
\nmoodle.enabled = true
\nmoodle.uri=http:\/\/al2273.vledev.open.ac.uk\/ouvle\/<\/p>\n

For further information goto: http:\/\/technologies.kmi.open.ac.uk\/msg\/developer\/msg-moodle-block-installation-guide\/<\/a><\/p>\n

Wildfire-extras.jar<\/h3>\n\n\n
Source module: WildfireExtras<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

This comprises a set of Java classes that override providers of Groups, Users and Authentication within the Openfire server.<\/p>\n


\n Wildfire-extras authenticate flow chart<\/em><\/p>\n

Once a user is authenticated, this initiates a process (on another thread) that replicates information for that user. The action of this replication causes openfire user and group database to be updated with any changes that are required. When changes to user rosters are required, these are automatically propagated to any affected users that are logged in.  <\/p>\n

Mashup Plugin<\/h3>\n\n\n
Source module: WildfireMashupPlugin<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

This Openfire plugin was primarily designed to provide presence monitoring service and to allow authentication against the server without creating a jabber session. This authentication route is used to authorize BuddyXML session attachment for pre-existing user connections. For example, if a user logs in via both MSG Client and MSGAlert, these two connection sources can share a single BuddyXML session thus eliminating problems resulting from multiple jabber connections for a user.<\/p>\n

User Web Admin Plugin<\/h3>\n\n\n
Source module: WildfireUserWebAdminPlugin<\/strong><\/a><\/td>\nQuick View<\/a><\/td>\n<\/tr>\n<\/table>\n

The built-in Openfire admin console is only designed for ‘super user’ administartors, so this plugin was developed to allow ‘ordinary’ users to perform some admin operations, eg. password setting, group membership editing, uploading maps etc. This plugin can be accessed via: http:\/\/msg.open.ac.uk\/admin<\/a><\/p>\n

LDAP Server<\/h3>\n\n\n
 <\/td>\n<\/tr>\n<\/table>\n

An LDAP server can be used to provide authentication, user and group information for the Openfire Jabber Server.<\/p>\n

To configure LDAP integration with Openfire, the openfire.xml configuration file must be edited to match the user and group schema used on the LDAP server. e.g. <\/p>\n

\n

\n<<\/span><\/span>ldap<\/span><\/span>><\/span>
\n<\/span><<\/span>host<\/span>><\/span>gridmania.hlrs.de<\/span><\/<\/span>host<\/span>>
\n<<\/span>port<\/span>><\/span>636<\/span><\/<\/span>port<\/span>>
\n<<\/span>sslEnabled<\/span>><\/span>true<\/span><\/<\/span>sslEnabled<\/span>>
\n<<\/span>usernameField<\/span>><\/span>mail<\/span><\/<\/span>usernameField<\/span>>
\n<<\/span>nameField<\/span>><\/span>cn<\/span><\/<\/span>nameField<\/span>>
\n<<\/span>emailField<\/span>><\/span>mail<\/span><\/<\/span>emailField<\/span>>
\n<<\/span>baseDN<\/span>><\/span>dc=elegi,dc=org<\/span><\/<\/span>baseDN<\/span>>
\n<<\/span>adminDN<\/span>><\/span>cn=ldap-query-sansibar,ou=query-agents,dc=elegi,dc=org<\/span><\/<\/span>adminDN<\/span>>
\n<<\/span>adminPassword<\/span>><\/span>*******<\/span><\/<\/span>adminPassword<\/span>>
\n<<\/span>groupNameField<\/span>><\/span>cn<\/span><\/<\/span>groupNameField<\/span>>
\n<<\/span>groupMemberField<\/span>><\/span>member<\/span><\/<\/span>groupMemberField<\/span>>
\n<<\/span>groupDescriptionField<\/span>><\/span>description<\/span><\/<\/span>groupDescriptionField<\/span>>
\n<<\/span>posixMode<\/span>><\/span>false<\/span><\/<\/span>posixMode<\/span>>
\n<<\/span>groupSearchFilter<\/span>><\/span>(objectClass=groupOfNames)<\/span><\/<\/span>groupSearchFilter<\/span>>
\n<\/span><\/span><<\/span>debugEnabled<\/span>><\/span>false<\/span><\/<\/span>debugEnabled<\/span>>
\n<\/span><\/span><<\/span>connectionPoolEnabled<\/span>><\/span>false<\/span><\/<\/span>connectionPoolEnabled<\/span>><\/span><\/span>\n<\/p>\n

\n<<\/span>ldap<\/span><\/span>><\/span><\/p>\n<\/div>\n

Note that although Openfire has built-in classes for LDAP User and Group provision, their implementation suffers from a major drawback. It does not allow for dynamic changes to the LDAP user and group information. This means that changes are only reflected in Openfire when cached Users & Groups expire (after 6hrs) from the Openfire cache. This problem is addressed by the custom provider implementation in wildfire-extras.jar<\/strong>, where ldap users and groups are replicated in the openfire database at the point of login. <\/p>\n

To enable the LDAP replication within wildfire-extras, set the openfire system property:
\n ldap.enabled = true <\/p>\n

XMPP\/Jabber Client<\/h3>\n\n\n
 <\/td>\n<\/tr>\n<\/table>\n

Openfire implements the standard XMPP\/Jabber protocol and should allow connection via any Jabber client (e.g. BuddySpace, Spark, Exodus, Adium etc.…)<\/p>\n","protected":false},"excerpt":{"rendered":"

MSG Server and Client Architecture Diagram MSG AJAX Web Client Source module: MSGClient Quick View This is the main MSG user interface. You can login via this interface at http:\/\/msg.open.ac.uk\/msg Connection, contacts, messaging and presence states are all handled via calls to the BuddyXML service described below via Javascript’s XMLHttpRequest function. An important fearture of […]<\/p>\n","protected":false},"author":9,"featured_media":0,"parent":26,"menu_order":1,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/pages\/37"}],"collection":[{"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/pages\/37\/revisions"}],"up":[{"embeddable":true,"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/pages\/26"}],"wp:attachment":[{"href":"http:\/\/technologies.kmi.open.ac.uk\/msg\/wp-json\/wp\/v2\/media?parent=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}