org.jlab.coda.cMsg
Interface cMsgSubdomainInterface

All Known Implementing Classes:
CA, cMsg, cMsgSubdomainAdapter, Database, Dummy, FileQueue, LogFile, Queue, SmartSockets, TcpServer

public interface cMsgSubdomainInterface

This interface is an API for an object that a domain server uses to respond to client demands. An implementation of this interface handles all communication with a particular subdomain (such as SmartSockets or JADE agents). Implementors of this interface must understand that each client using cMsg will have its own handler object from a class implementing this interface. Several clients may concurrently use objects of the same class. Thus implementations must be thread-safe. Furthermore, when the name server shuts dowm, the method handleServerShutdown may be executed more than once for the same reason.

Version:
1.0
Author:
Carl Timmer

Method Summary
 void handleClientShutdown()
          Method to handle a client or domain server (and therefore subdomain handler) shutdown.
 void handleKeepAlive()
          Method to handle a keepalive sent by a domain client checking to see if the domain server is still up.
 void handleSendAndGetRequest(cMsgMessageFull message)
          Method to synchronously get a single message by sending out a message which is responded to by its receiver(s).
 void handleSendRequest(cMsgMessageFull message)
          Method to handle a message sent by a domain client.
 void handleShutdownClientsRequest(java.lang.String client, boolean includeMe)
          Method to handle a request to shutdown clients sent by a domain client.
 void handleSubscribeAndGetRequest(java.lang.String subject, java.lang.String type, int id)
          Method to synchronously get a single message from the server for a one-time subscription of a subject and type.
 void handleSubscribeRequest(java.lang.String subject, java.lang.String type, int id)
          Method to handle a subscribe request sent by a domain client.
 int handleSyncSendRequest(cMsgMessageFull message)
          Method to handle a message sent by a domain client in synchronous mode.
 void handleUnSendAndGetRequest(int id)
          Method to remove a sendAndGet request previously sent by a domain client.
 void handleUnsubscribeAndGetRequest(java.lang.String subject, java.lang.String type, int id)
          Method to remove a subscribeAndGet request previously sent by a domain client.
 void handleUnsubscribeRequest(java.lang.String subject, java.lang.String type, int id)
          Method to handle an unsubscribe request sent by a domain client.
 boolean hasSend()
          Method to tell if the "send" cMsg API function is implemented by this interface implementation in the handleSendRequest(org.jlab.coda.cMsg.cMsgMessageFull) method.
 boolean hasSendAndGet()
          Method to tell if the "sendAndGet" cMsg API function is implemented by this interface implementation in the handleSendAndGetRequest(org.jlab.coda.cMsg.cMsgMessageFull) method.
 boolean hasShutdown()
          Method to tell if the "shutdown" cMsg API function is implemented by this interface implementation in the handleShutdownClientsRequest(java.lang.String, boolean) method.
 boolean hasSubscribe()
          Method to tell if the "subscribe" cMsg API function is implemented by this interface implementation in the handleSubscribeRequest(java.lang.String, java.lang.String, int) method.
 boolean hasSubscribeAndGet()
          Method to tell if the "subscribeAndGet" cMsg API function is implemented by this interface implementation in the handleSubscribeAndGetRequest(java.lang.String, java.lang.String, int) method.
 boolean hasSyncSend()
          Method to tell if the "syncSend" cMsg API function is implemented by this interface implementation in the handleSyncSendRequest(org.jlab.coda.cMsg.cMsgMessageFull) method.
 boolean hasUnsubscribe()
          Method to tell if the "unsubscribe" cMsg API function is implemented by this interface implementation in the handleUnsubscribeRequest(java.lang.String, java.lang.String, int) method.
 void registerClient(cMsgClientInfo info)
          Method to register a domain client.
 void setMessageDeliverer(cMsgDeliverMessageInterface deliverer)
          Method to give the subdomain handler on object able to deliver messages to the client.
 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.
 

Method Detail

setUDLRemainder

void setUDLRemainder(java.lang.String UDLRemainder)
                     throws cMsgException
Method to give the subdomain handler the appropriate part of the UDL the client used to talk to the domain server.

Parameters:
UDLRemainder - last part of the UDL appropriate to the subdomain handler
Throws:
cMsgException

setMessageDeliverer

void setMessageDeliverer(cMsgDeliverMessageInterface deliverer)
                         throws cMsgException
Method to give the subdomain handler on object able to deliver messages to the client.

Parameters:
deliverer - object able to deliver messages to the client
Throws:
cMsgException

registerClient

void registerClient(cMsgClientInfo info)
                    throws cMsgException
Method to register a domain client.

Parameters:
info - information about client
Throws:
cMsgException

handleSendRequest

void handleSendRequest(cMsgMessageFull message)
                       throws cMsgException
Method to handle a message sent by a domain client.

Parameters:
message - message from sender
Throws:
cMsgException

handleSyncSendRequest

int handleSyncSendRequest(cMsgMessageFull message)
                          throws cMsgException
Method to handle a message sent by a domain client in synchronous mode. It requries an integer response from the subdomain handler.

Parameters:
message - message from sender
Returns:
response from subdomain handler
Throws:
cMsgException

handleSubscribeAndGetRequest

void handleSubscribeAndGetRequest(java.lang.String subject,
                                  java.lang.String type,
                                  int id)
                                  throws cMsgException
Method to synchronously get a single message from the server for a one-time subscription of a subject and type.

Parameters:
subject - message subject subscribed to
type - message type subscribed to
id - message id
Throws:
cMsgException

handleUnsubscribeAndGetRequest

void handleUnsubscribeAndGetRequest(java.lang.String subject,
                                    java.lang.String type,
                                    int id)
                                    throws cMsgException
Method to remove a subscribeAndGet request previously sent by a domain client.

Parameters:
subject - message subject subscribed to
type - message type subscribed to
id - message id
Throws:
cMsgException

handleSendAndGetRequest

void handleSendAndGetRequest(cMsgMessageFull message)
                             throws cMsgException
Method to synchronously get a single message by sending out a message which is responded to by its receiver(s).

Parameters:
message - message requesting what sort of response message to get
Throws:
cMsgException

handleUnSendAndGetRequest

void handleUnSendAndGetRequest(int id)
                               throws cMsgException
Method to remove a sendAndGet request previously sent by a domain client.

Parameters:
id - message id refering to these specific subject and type values
Throws:
cMsgException

handleSubscribeRequest

void handleSubscribeRequest(java.lang.String subject,
                            java.lang.String type,
                            int id)
                            throws cMsgException
Method to handle a subscribe request sent by a domain client.

Parameters:
subject - message subject subscribed to
type - message type subscribed to
id - message id
Throws:
cMsgException

handleUnsubscribeRequest

void handleUnsubscribeRequest(java.lang.String subject,
                              java.lang.String type,
                              int id)
                              throws cMsgException
Method to handle an unsubscribe request sent by a domain client.

Parameters:
subject - message subject subscribed to
type - message type subscribed to
id - message id
Throws:
cMsgException

handleShutdownClientsRequest

void handleShutdownClientsRequest(java.lang.String client,
                                  boolean includeMe)
                                  throws cMsgException
Method to handle a request to shutdown clients sent by a domain client.

Parameters:
client - client(s) to be shutdown
includeMe - if true, this client may be shutdown too
Throws:
cMsgException

handleKeepAlive

void handleKeepAlive()
                     throws cMsgException
Method to handle a keepalive sent by a domain client checking to see if the domain server is still up.

Throws:
cMsgException

handleClientShutdown

void handleClientShutdown()
                          throws cMsgException
Method to handle a client or domain server (and therefore subdomain handler) shutdown.

Throws:
cMsgException

hasSend

boolean hasSend()
Method to tell if the "send" cMsg API function is implemented by this interface implementation in the handleSendRequest(org.jlab.coda.cMsg.cMsgMessageFull) method.

Returns:
true if send implemented in handleSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)

hasSyncSend

boolean hasSyncSend()
Method to tell if the "syncSend" cMsg API function is implemented by this interface implementation in the handleSyncSendRequest(org.jlab.coda.cMsg.cMsgMessageFull) method.

Returns:
true if send implemented in handleSyncSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)

hasSubscribeAndGet

boolean hasSubscribeAndGet()
Method to tell if the "subscribeAndGet" cMsg API function is implemented by this interface implementation in the handleSubscribeAndGetRequest(java.lang.String, java.lang.String, int) method.

Returns:
true if subscribeAndGet implemented in handleSubscribeAndGetRequest(java.lang.String, java.lang.String, int)

hasSendAndGet

boolean hasSendAndGet()
Method to tell if the "sendAndGet" cMsg API function is implemented by this interface implementation in the handleSendAndGetRequest(org.jlab.coda.cMsg.cMsgMessageFull) method.

Returns:
true if sendAndGet implemented in handleSendAndGetRequest(org.jlab.coda.cMsg.cMsgMessageFull)

hasSubscribe

boolean hasSubscribe()
Method to tell if the "subscribe" cMsg API function is implemented by this interface implementation in the handleSubscribeRequest(java.lang.String, java.lang.String, int) method.

Returns:
true if subscribe implemented in handleSubscribeRequest(java.lang.String, java.lang.String, int)

hasUnsubscribe

boolean hasUnsubscribe()
Method to tell if the "unsubscribe" cMsg API function is implemented by this interface implementation in the handleUnsubscribeRequest(java.lang.String, java.lang.String, int) method.

Returns:
true if unsubscribe implemented in handleUnsubscribeRequest(java.lang.String, java.lang.String, int)

hasShutdown

boolean hasShutdown()
Method to tell if the "shutdown" cMsg API function is implemented by this interface implementation in the handleShutdownClientsRequest(java.lang.String, boolean) method.

Returns:
true if shutdown implemented in handleShutdownClientsRequest(java.lang.String, boolean)