public class Queue extends cMsgSubdomainAdapter
UDL: cMsg://host:port/Queue/myQueueName?driver=myDriver&url=myURL&account=myAccount&password=myPassword
e.g. cMsg://localhost/Queue/ejw?driver=com.mysql.jdbc.Driver&url=jdbc:mysql://halldweb1/test&account=wolin
Stores/retrieves cMsgMessageFull messages from SQL database. Gets database parameters from UDL. Supported databases so far: mySQL, PostgreSQL (not tested yet...).
Constructor and Description |
---|
Queue() |
Modifier and Type | Method and Description |
---|---|
void |
handleClientShutdown()
Close connection to database.
|
void |
handleSendAndGetRequest(cMsgMessageFull msg)
Returns message at head of queue.
|
void |
handleSendRequest(cMsgMessageFull msg)
Inserts message into SQL database table via JDBC.
|
int |
handleSyncSendRequest(cMsgMessageFull msg)
Inserts message into SQL database table via JDBC.
|
boolean |
hasSend()
Method to tell if the "send" cMsg API function is implemented
by this interface implementation in the "handleSendRequest"
method.
|
boolean |
hasSendAndGet()
Method to tell if the "sendAndGet" cMsg API function is implemented
by this interface implementation in the "handleSendAndGetRequest"
method.
|
boolean |
hasSyncSend()
Method to tell if the "syncSend" cMsg API function is implemented
by this interface implementation in the "handleSyncSendRequest"
method.
|
void |
registerClient(cMsgClientInfo info)
Creates separate database connection for each client connection.
|
void |
setUDLRemainder(java.lang.String UDLRemainder)
Method to give the subdomain handler the appropriate part
of the UDL the client used to talk to the domain server.
|
handleShutdownClientsRequest, handleSubscribeAndGetRequest, handleSubscribeRequest, handleUnSendAndGetRequest, handleUnsubscribeAndGetRequest, handleUnsubscribeRequest, hasShutdown, hasSubscribe, hasSubscribeAndGet, hasUnsubscribe
public boolean hasSend()
hasSend
in interface cMsgSubdomainInterface
hasSend
in class cMsgSubdomainAdapter
public boolean hasSendAndGet()
hasSendAndGet
in interface cMsgSubdomainInterface
hasSendAndGet
in class cMsgSubdomainAdapter
public boolean hasSyncSend()
hasSyncSend
in interface cMsgSubdomainInterface
hasSyncSend
in class cMsgSubdomainAdapter
public void setUDLRemainder(java.lang.String UDLRemainder) throws cMsgException
setUDLRemainder
in interface cMsgSubdomainInterface
setUDLRemainder
in class cMsgSubdomainAdapter
UDLRemainder
- last part of the UDL appropriate to the subdomain handlercMsgException
- neverpublic void registerClient(cMsgClientInfo info) throws cMsgException
registerClient
in interface cMsgSubdomainInterface
registerClient
in class cMsgSubdomainAdapter
info
- information about clientcMsgException
- if improper UDL, cannot connect to database,
cannot get database metadatapublic void handleSendRequest(cMsgMessageFull msg) throws cMsgException
handleSendRequest
in interface cMsgSubdomainInterface
handleSendRequest
in class cMsgSubdomainAdapter
msg
- message from sendercMsgException
- if sql errorpublic int handleSyncSendRequest(cMsgMessageFull msg) throws cMsgException
handleSyncSendRequest
in interface cMsgSubdomainInterface
handleSyncSendRequest
in class cMsgSubdomainAdapter
msg
- message from sendercMsgException
- neverpublic void handleSendAndGetRequest(cMsgMessageFull msg) throws cMsgException
handleSendAndGetRequest
in interface cMsgSubdomainInterface
handleSendAndGetRequest
in class cMsgSubdomainAdapter
msg
- message to generate sendAndGet response to (contents ignored)cMsgException
- if error reading database or delivering message to clientpublic void handleClientShutdown() throws cMsgException
handleClientShutdown
in interface cMsgSubdomainInterface
handleClientShutdown
in class cMsgSubdomainAdapter
cMsgException
- if close fails.