|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.midp.exampleapp.messageservice.MQeMessageService
This implements a message service and aims to wrap an mqe queue manager and provide all basic functionality with a simpler interface.
This means that all queue and queue manager creation and administration will be done via this class.
Functions can be split up as follows:
Message Service Functions --------------------------------------------- getMessageConsumer() getQMname() getStartupParameters() setStartupParameters() messageArrived() [inherited from MQeMessageListenerInterface] processAlias() Queue Manager Functions --------------------------------------------- createListener() Messaging Functions --------------------------------------------- primeAdminMessage() processAdminMessage()
Field Summary | |
static short[] |
version
|
Fields inherited from interface examples.midp.exampleapp.messageservice.MQeMessageServiceConstants |
DEFAULT_BASEDIRNAME, DEFAULT_CHANNEL, DEFAULT_CHANNELATTRRULES, DEFAULT_COMPRESSOR, DEFAULT_CRYPTOR, DEFAULT_EVENTLOG, DEFAULT_FASTNETWORK, DEFAULT_FILEREGISTRY, DEFAULT_LISTENERADAPTER, DEFAULT_LISTENERPORT, DEFAULT_MAXCHANNELS, DEFAULT_MSGLOG, DEFAULT_NETWORK, DEFAULT_PIN, DEFAULT_PRIVATEREGISTRY, DEFAULT_QUEUEMANAGER, DEFAULT_TIMEINTERVAL, DEFAULT_TRACE, DEFAULT_TRANSPORTER |
Constructor Summary | |
MQeMessageService()
|
Method Summary | |
boolean |
checkAdminReply(MQeAdminMsg replyMsg)
Check to see if a good reply was received. |
void |
close()
Closes the message service, allowing it to tidy up. |
protected void |
closeQM()
Closes down the queue manager. |
void |
createConnection(java.lang.String onQMgr,
java.lang.String name,
java.lang.String adapter,
java.lang.String parms,
java.lang.String options)
Create a new connection definition. |
void |
createHomeServerQueue(java.lang.String onQMgr,
java.lang.String qm,
java.lang.String q,
long pollTime)
Creates a home server queue. |
void |
createListener(java.lang.String listenerName)
Create a new listener and start it running. |
void |
createLocalQueue(java.lang.String onQMgr,
java.lang.String q,
boolean sync)
Creates a new (simple) local queue with no cryptor or compressor. |
void |
createLocalQueue(java.lang.String onQMgr,
java.lang.String q,
boolean sync,
java.lang.String compressor,
java.lang.String cryptor)
Creates a new local queue. |
void |
createQueueManager()
Creates the queue manager. |
void |
createRemoteQueue(java.lang.String onQMgr,
java.lang.String qm,
java.lang.String q,
boolean sync)
Creates a new (simple) remote queue with no cryptor of compressor. |
void |
createRemoteQueue(java.lang.String onQMgr,
java.lang.String qm,
java.lang.String q,
boolean sync,
java.lang.String compressor,
java.lang.String cryptor)
Creates a new remote queue. |
void |
createStoreAndForwardQueue(java.lang.String onQMgr,
java.lang.String qm,
java.lang.String q)
Creates a store and forward queue. |
void |
emptyQueue(java.lang.String queueManagerName,
java.lang.String queueName)
Deletes all messages from a named queue. |
MQeMsgObject |
getMessage(java.lang.String queueManagerName,
java.lang.String queueName,
MQeFields filter)
Get a message from a given queue manager/queue. |
MessageConsumer |
getMessageConsumer()
Returns a reference to the GUI object that handles consumption of messages. |
java.lang.String |
getQMname()
Gets the name of the local queue manager. |
MQeMsgObject |
getSecureMessage(java.lang.String queueManagerName,
java.lang.String queueName,
MQeFields filter,
MQeAttribute attribute)
Gets a secure message from a given queue manager/queue. |
MQeMessageServiceParameters |
getStartupParameters()
Returns the startup parameters given to the message service when it was initialized. |
void |
messageArrived(MQeMessageEvent e)
Processes a new message event. |
void |
monitorQueue(java.lang.String queueManagerName,
java.lang.String queueName)
Setup a monitor that will check for new messages on a queue. |
void |
open()
Performs the processing needed to activate the system. |
MQeFields |
primeAdminMsg(java.lang.String onQMgr,
MQeAdminMsg msg)
Prime an admin message. |
MQeAdminMsg |
processAdminMsg(java.lang.String onQMgr,
MQeAdminMsg msg)
Send the admin message, wait for a reply and check for success. |
void |
processAlias()
Process the class alias names in the configuration data. |
void |
processMessages(java.lang.String queueManagerName,
java.lang.String queueName,
MQeFields match)
Process any messages that match a filter on a given queue. |
void |
sendMessage(java.lang.String queueManagerName,
java.lang.String queueName,
MQeMsgObject message)
Send a message to a given queue manager/queue. |
void |
sendSecureMessage(java.lang.String queueManagerName,
java.lang.String queueName,
MQeMsgObject message,
MQeAttribute attribute)
Send a secure message to a given queue manager/queue. |
void |
setMessageConsumer(MessageConsumer GUI)
Let the message service know the graphical component that can display messages. |
void |
setStartupParameters(MQeMessageServiceParameters parms)
Set the object that contains any parameters required to start the message service. |
void |
updateQueueManager(java.lang.String onQMgr,
MQeFields parms)
Change the characteristics of a queue manager. |
MQeMsgObject |
waitForReply(java.lang.String onQMgr,
java.lang.String onQueue,
MQeFields msgTest)
Wait a while for a message to turn up on a queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static short[] version
Constructor Detail |
public MQeMessageService()
Method Detail |
public boolean checkAdminReply(MQeAdminMsg replyMsg) throws java.lang.Exception
replyMsg
- Reply message to check
java.lang.Exception
public void close() throws java.lang.Exception
Although this only calls closeQMgr, in the future, other things may also require being closed.
close
in interface MessageService
java.lang.Exception
protected void closeQM() throws java.lang.Exception
java.lang.Exception
public void createConnection(java.lang.String onQMgr, java.lang.String name, java.lang.String adapter, java.lang.String parms, java.lang.String options) throws java.lang.Exception
createConnection
in interface MessageService
onQMgr
- Which QMgr to send the admin messagename
- Name of the connectionadapter
- Adapter plus base parms to be usedparms
- Connection parametersoptions
- Connection options
java.lang.Exception
public void createListener(java.lang.String listenerName) throws java.lang.Exception
This function can be divided into 2 parts
- the creation of the listener
- the starting of the listener
listenerName
- The name of listener
java.lang.Exception
public void createHomeServerQueue(java.lang.String onQMgr, java.lang.String qm, java.lang.String q, long pollTime) throws java.lang.Exception
createHomeServerQueue
in interface MessageService
onQMgr
- Which QMgr to send the admin messageqm
- Queue manager the queue resides onq
- Name of the queuepollTime
- The polltime for checking for messages
java.lang.Exception
public void createLocalQueue(java.lang.String onQMgr, java.lang.String q, boolean sync) throws java.lang.Exception
onQMgr
- The queue manager that the queue is located onq
- The name of the queuesync
- True for a synchronous queue, false for async
java.lang.Exception
public void createLocalQueue(java.lang.String onQMgr, java.lang.String q, boolean sync, java.lang.String compressor, java.lang.String cryptor) throws java.lang.Exception
createLocalQueue
in interface MessageService
onQMgr
- The queue manager that the queue is located onq
- The name of the queuesync
- True for a synchronous queue, false for asynccompressor
- The compressor class to usecryptor
- The cryptor class to use
java.lang.Exception
public void createQueueManager() throws java.lang.Exception
createQueueManager
in interface MessageService
java.lang.Exception
public void createRemoteQueue(java.lang.String onQMgr, java.lang.String qm, java.lang.String q, boolean sync) throws java.lang.Exception
onQMgr
- Which QMgr to send the admin messageqm
- Queue manager the queue resides onq
- Name of the queuesync
- True for synchronous, false for asynchronous
java.lang.Exception
public void createRemoteQueue(java.lang.String onQMgr, java.lang.String qm, java.lang.String q, boolean sync, java.lang.String compressor, java.lang.String cryptor) throws java.lang.Exception
createRemoteQueue
in interface MessageService
onQMgr
- Which QMgr to send the admin messageqm
- Queue manager the queue resides onq
- Name of the queuesync
- True for synchronous, false for asynchronouscompressor
- The compressor class to usecryptor
- The cryptor class to use
java.lang.Exception
public void createStoreAndForwardQueue(java.lang.String onQMgr, java.lang.String qm, java.lang.String q) throws java.lang.Exception
createStoreAndForwardQueue
in interface MessageService
onQMgr
- Which QMgr to send the admin messageqm
- Queue manager the queue resides onq
- Name of the queue
java.lang.Exception
public void emptyQueue(java.lang.String queueManagerName, java.lang.String queueName) throws java.lang.Exception
emptyQueue
in interface MessageService
queueManagerName
- Queue manager the queue resides onqueueName
- Name of the queue
java.lang.Exception
public MQeMsgObject getMessage(java.lang.String queueManagerName, java.lang.String queueName, MQeFields filter) throws java.lang.Exception
getMessage
in interface MessageService
queueManagerName
- Which QMgr to get the message fromqueueName
- Which queue to get the message fromfilter
- Get a message that matches the filter
java.lang.Exception
public MessageConsumer getMessageConsumer()
public java.lang.String getQMname() throws java.lang.Exception
java.lang.Exception
public MQeMsgObject getSecureMessage(java.lang.String queueManagerName, java.lang.String queueName, MQeFields filter, MQeAttribute attribute) throws java.lang.Exception
getSecureMessage
in interface MessageService
queueManagerName
- Which QMgr to get the message fromqueueName
- Which queue to get the message fromfilter
- Get a message that matches the filterattribute
- The attribute used to decode the secure message
java.lang.Exception
public MQeMessageServiceParameters getStartupParameters() throws java.lang.Exception
java.lang.Exception
public void messageArrived(MQeMessageEvent e)
messageArrived
in interface MQeMessageListenerInterface
e
- The event that has occurred
public void monitorQueue(java.lang.String queueManagerName, java.lang.String queueName)
NOTE: monitoring of remote queues is not yet implemented!
monitorQueue
in interface MessageService
queueManagerName
- Queue manager the queue resides onqueueName
- Name of the queue
public void open() throws java.lang.Exception
open
in interface MessageService
java.lang.Exception
public MQeFields primeAdminMsg(java.lang.String onQMgr, MQeAdminMsg msg) throws java.lang.Exception
onQMgr
- The name of the queue manager where the message will be sent.msg
- The admin message to prime
java.lang.Exception
public MQeAdminMsg processAdminMsg(java.lang.String onQMgr, MQeAdminMsg msg) throws java.lang.Exception
onQMgr
- The name of the queue manager where the message will be sent.msg
- The admin message to send
java.lang.Exception
public void processAlias() throws java.lang.Exception
This maps one class name to another, or acts as an alias to a class name.
[Alias] (ascii)EventLog=..... class to use to write event logs (ascii)Network=..... Adapter class for network support (ascii)QueueManager=..... class to use for Queue manager (ascii)Registry=..... class to use for Registry functions (ascii)Trace=..... class to provide trace functions
java.lang.Exception
public void processMessages(java.lang.String queueManagerName, java.lang.String queueName, MQeFields match)
A very simplistic approach is taken to handling any messages found: If the message is a request then the processMessage() method is called on the GUI, if it is a reply or datagram or not specified then the displayMessage method is called on the GUI.
NOTE: The message is only browsed in this method so the message is left on the queue it is down to anyone processing the message to get/delete it on the queue!
processMessages
in interface MessageService
queueManagerName
- Which QMgr to browsequeueName
- Which queue to browsematch
- Only return fields matching
public void sendMessage(java.lang.String queueManagerName, java.lang.String queueName, MQeMsgObject message) throws java.lang.Exception
sendMessage
in interface MessageService
queueManagerName
- Which QMgr to send the messagequeueName
- Which queue to send the message tomessage
- The message to send
java.lang.Exception
public void sendSecureMessage(java.lang.String queueManagerName, java.lang.String queueName, MQeMsgObject message, MQeAttribute attribute) throws java.lang.Exception
sendSecureMessage
in interface MessageService
queueManagerName
- Which QMgr to send the messagequeueName
- Which queue to send the message tomessage
- The message to send
java.lang.Exception
public void setMessageConsumer(MessageConsumer GUI)
setMessageConsumer
in interface MessageService
GUI
- The message consumer to be set to
public void setStartupParameters(MQeMessageServiceParameters parms)
parms
- The name of the local queue managerpublic void updateQueueManager(java.lang.String onQMgr, MQeFields parms) throws java.lang.Exception
updateQueueManager
in interface MessageService
onQMgr
- The name of the queue manager where the admin message will be sent.parms
- The parameters that need updating
java.lang.Exception
public MQeMsgObject waitForReply(java.lang.String onQMgr, java.lang.String onQueue, MQeFields msgTest) throws java.lang.Exception
waitForReply
in interface MessageService
onQMgr
- Queue manager to wait ononQueue
- Queue to wait onmsgTest
- Filter for a specific message
java.lang.Exception
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |