[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] finding out from MsgUnit weather it is publish or subscribe message



Hi Michael,

Michael Atighetchi wrote:
How can I found out from a MsgUnit weather it is a publish or
subscribe message ?

You don't use MsgUnits when subscribing so if you have a msgUnit in the client interface, then it is a publish/publishOneway/publishArray, an update or the return of a get.

I noticed that KeyData has .isQuery, but no .isPublish or .isSubscribe
? Would it be hard to add these in ?

if isQuery is true then the KeyData object is a QueryKeyData which is used in erase, get, unSubscribe and subscribe.

If isQuery is false, then it is a MsgKeyData which is used in publish, update and in the return value in get.

If you need a finer division than query/Message then we could add the methods you suggested (or a String getType() method returning "publish" ...). But are you really working directly with KeyData ? in the org.xmlBlaster.client.key package there are a set of decorators which should be used instead.


Michele