|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.cMsg.cMsgDomain.server.cMsgServerBridge
public class cMsgServerBridge
This class acts to bridge two cMsg domain servers by existing in one server and becoming a client of another cMsg domain server.
Constructor Summary | |
---|---|
cMsgServerBridge(cMsgNameServer nameServer,
java.lang.String serverName,
int thisNameServerPort)
Constructor. |
Method Summary | |
---|---|
java.util.Set<java.lang.String> |
connect(boolean isOriginator,
java.lang.String cloudPassword)
Method to connect to server. |
static cMsgCallbackAdapter |
getSendAndGetCallback(int id,
int sysMsgId)
Get a callback for a sendAndGet call. |
static cMsgCallbackAdapter |
getSubAndGetCallback()
This method returns a reference to the one callback needed for subscribes and subAndGets to propogate messages back to original client. |
void |
printSizes()
This method prints sizes of maps for debugging purposes. |
void |
sendAndGet(cMsgMessage msg,
java.lang.String namespace,
cMsgCallbackInterface cb)
Method to do a sendAndGet of a message of subject and type to another cMsg server. |
void |
shutdownClients(java.lang.String clientName,
boolean includeMe)
Method to shutdown the given clients. |
void |
shutdownServer()
Method to shutdown the given server this client is connected to. |
void |
subscribe(java.lang.String subject,
java.lang.String type,
java.lang.String namespace)
Method for a server to subscribe to receive messages of a subject and type from another cMsg server. |
void |
subscribeAndGet(java.lang.String subject,
java.lang.String type,
java.lang.String namespace,
cMsgCallbackInterface cb)
Method for a subscribeAndGet (a one-time subscribe) on another cMsg server. |
void |
unSendAndGet(int id)
Method to remove a previous sendAndGet to receive a message of a subject and type from the domain server. |
void |
unsubscribe(java.lang.String subject,
java.lang.String type,
java.lang.String namespace)
Method for a server to unsubscribe for messages of a subject and type from another cMsg server. |
void |
unsubscribeAndGet(java.lang.String subject,
java.lang.String type,
java.lang.String namespace,
cMsgCallbackInterface cb)
Method to remove a previous subscribeAndGet ton another cMsg server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public cMsgServerBridge(cMsgNameServer nameServer, java.lang.String serverName, int thisNameServerPort) throws cMsgException
nameServer
- THIS name server (the one using this object)serverName
- name of server to connect to in the form "host:port"thisNameServerPort
- the port THIS name server is listening on
cMsgException
Method Detail |
---|
public void printSizes()
public static cMsgCallbackAdapter getSubAndGetCallback()
public static cMsgCallbackAdapter getSendAndGetCallback(int id, int sysMsgId)
public java.util.Set<java.lang.String> connect(boolean isOriginator, java.lang.String cloudPassword) throws cMsgException
isOriginator
- true if originating the connection between the 2 servers and
false if this is the response or reciprocal connectioncloudPassword
- password for connecting to a server in a particular cloud
cMsgException
- if there are problems parsing the UDL or
communication problems with the serverpublic void subscribe(java.lang.String subject, java.lang.String type, java.lang.String namespace) throws java.io.IOException
subject
- message subjecttype
- message typenamespace
- message namespace
java.io.IOException
- there are communication problems with the serverpublic void unsubscribe(java.lang.String subject, java.lang.String type, java.lang.String namespace) throws java.io.IOException
subject
- message subjecttype
- message typenamespace
- message namespace
java.io.IOException
- there are communication problems with the serverpublic void sendAndGet(cMsgMessage msg, java.lang.String namespace, cMsgCallbackInterface cb) throws java.io.IOException
msg
- message sent to servernamespace
- message namespacecb
- callback for response to sendAndGet request
java.io.IOException
- if there are communication problems with the serverpublic void unSendAndGet(int id) throws java.io.IOException
id
- receiverSubscribeId of original message sent in sendAndGet
java.io.IOException
- if there are communication problems with the serverpublic void subscribeAndGet(java.lang.String subject, java.lang.String type, java.lang.String namespace, cMsgCallbackInterface cb) throws java.io.IOException
subject
- subject of message desired from servertype
- type of message desired from servernamespace
- message namespace
java.io.IOException
- there are communication problems with the serverpublic void unsubscribeAndGet(java.lang.String subject, java.lang.String type, java.lang.String namespace, cMsgCallbackInterface cb) throws java.io.IOException
subject
- subject of message desired from servertype
- type of message desired from servernamespace
- message namespace
java.io.IOException
- there are communication problems with the serverpublic void shutdownClients(java.lang.String clientName, boolean includeMe) throws java.io.IOException
clientName
- client(s) to be shutdownincludeMe
- if true, it is permissible to shutdown calling client
java.io.IOException
- if there are communication problems with the serverpublic void shutdownServer() throws java.io.IOException
java.io.IOException
- if there are communication problems with the server
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |