FP-Messaging-KVP

From Filtered Push Wiki
Jump to: navigation, search

Class Diagrams

Fig134733.svg

API Documentation

See Javadocs: http://filteredpush.sourceforge.net/docs/messaging/

MySQLMessageSender

The MySQLMessageSender will insert the message key value pairs into the MySQL messaging system database. These can be retrieved later by they MySQLMessageRetriever implementation of MessageRetriever. The message sender does this by extracting key value pairs from the FPMessage content (the annotation rdf/xml) and populates the appropriate JPA entities (Message and Kvp) before persisting the message data and individual key value pairs extracted from it to the database.

The message table in the database contains message metadata (i.e. messageid, the full content of the message, etc) and kvp contains all the key value pairs extracted from messages (along with a message id for that particular kvp)

MySQLRegisterInterest

Session Bean implementation class MySQLRegisterIntrest. Will register an interest with the MySQL implementation of the messaging system. Interests can be expressed as a key value pair query (such collectionCode=GH). The Interest JPA entity is populated before persisting to the interest database table.

The interest database table contains the interestid and its query.

MySQLMessageRetriever

Concrete implementation of MessageRetriever as a wrapper over a MySQL messaging system. Provides for the retrieval of messages from the MySQL messaging database. The messageretreiver is invoked by the accesspoint when a call to checkForMessages is made. Message retriever queries for a message by messageid. It will find all messages with an exact match to the messageid provided as an argument. In the case of a query where the original message is the query itself and the resultant messages (query results) are the messages we would expect to retrieve, the message retriever query returns all messages that have their inResponseTo=messageid (where messageid is provided as an argument to MessageRetriever).

The inResponseTo field points to the original message (query message) and is just the message id of that message.

JMSMessageRetriever

JMSMessageRetriever Concrete implementation of MessageRetriever as a wrapper over a JMS messaging system. Provides for the retrieval of messages from JMS.

JMSMessageSender

JMSMessageSender inserts the kvp extracted from the message content into the JMS messaging system.

Message

The persistent class for the message database table. The MessageFacade class exposes this entity and relevant stored queries to the MySQLMessageSender and Retriever. The message class contains the following named queries:

@NamedQuery(name = "Message.findAll", query = "SELECT m FROM Message m"),
@NamedQuery(name = "Message.findByMessageid", query = "SELECT m FROM Message m WHERE m.messageid = :messageid"),
@NamedQuery(name = "Message.findByInResponseTo", query = "SELECT m FROM Message m WHERE m.inResponseTo = :inResponseTo")


Interest

The persistent class for the interest database table. The InterestFacade class exposes this entity and relevant stored queries to the MySQLMessageSender and Retriever. The interest class contains the following named queries:

@NamedQuery(name = "Interest.findAll", query = "SELECT i FROM Interest i"),
@NamedQuery(name = "Interest.findByInterestid", query = "SELECT i FROM Interest i WHERE i.interestid = :interestid")


Kvp

The persistent class for the kvp database table. The KvpFacade class exposes this entity and stored queries to the MySQLMessageSender and Retriever. The Kvp class contains the following named queries:

@NamedQuery(name = "Kvp.findAll", query = "SELECT k FROM Kvp k"),
@NamedQuery(name = "Kvp.findByKvpid", query = "SELECT k FROM Kvp k WHERE k.kvpid = :kvpid"),
@NamedQuery(name = "Kvp.findByMapkey", query = "SELECT k FROM Kvp k WHERE k.mapkey = :mapkey"),
@NamedQuery(name = "Kvp.findByMapvalue", query = "SELECT k FROM Kvp k WHERE k.mapvalue = :mapvalue"),
@NamedQuery(name = "Kvp.findByTopic", query = "SELECT m FROM Kvp k JOIN k.messageid m WHERE k.mapkey = :mapkey AND k.mapvalue = :mapvalue"),
@NamedQuery(name = "Kvp.findByMessageid", query = "SELECT k FROM Kvp k WHERE k.messageid = :messageid")})