public class BamTriadSender
extends java.lang.Object
Constructor and Description |
---|
BamTriadSender(QuerySender sender,
CloudPod pod,
java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddress() |
CloudPod |
getPod()
Returns the pod for the sender.
|
java.lang.String |
getPrimaryAddress(TriadOwner owner) |
java.lang.String |
getSecondaryAddress(TriadOwner owner) |
java.lang.String |
getTertiaryAddress(TriadOwner owner) |
boolean |
isPrimarySelf(TriadOwner owner) |
java.lang.String |
messageActiveOrSelf(java.io.Serializable msg,
TriadOwner owner)
Sends a message to one of the triad members, including the server itself.
|
void |
messageAll(java.io.Serializable msg)
Send a message to all servers in the pod.
|
void |
messageAllTriadRemote(java.io.Serializable msg)
Send a message to active remove triad servers.
|
void |
messageBackup(java.io.Serializable msg,
TriadOwner owner) |
java.lang.String |
messageFirstTriad(java.io.Serializable msg,
TriadOwner owner,
BamTriadDispatcher.RemoteEnum remote)
Sends a message to the first active remote triad server.
|
java.lang.String |
messageFirstTriadActive(java.io.Serializable msg,
TriadOwner owner)
Sends a message to the first active remote triad server.
|
java.lang.String |
messageFirstTriadRemote(java.io.Serializable msg,
TriadOwner owner)
Sends a message to the first active remote triad server.
|
void |
messageTriadRemote(java.io.Serializable msg,
TriadOwner owner) |
void |
queryAllTriadRemote(java.io.Serializable msg,
QueryCallback cb)
Send a message to active remove triad servers.
|
boolean |
querySecondary(TriadOwner owner,
java.io.Serializable payload,
QueryCallback callback,
BamTriadDispatcher.RemoteEnum remote,
BamTriadDispatcher.ActiveEnum active)
Query the primary server, returning true if the query was sent or false
if the server doesn't exist or doesn't match the predicates.
|
boolean |
queryTertiary(TriadOwner owner,
java.io.Serializable payload,
QueryCallback callback,
BamTriadDispatcher.RemoteEnum remote,
BamTriadDispatcher.ActiveEnum active)
Query the primary server, returning true if the query was sent or false
if the server doesn't exist or doesn't match the predicates.
|
boolean |
queryTriad(TriadOwner owner,
java.io.Serializable payload,
QueryCallback callback)
Sends a query to the first active server in the triad.
|
void |
queryTriadAll(TriadOwner owner,
java.io.Serializable payload,
QueryCallback cb,
BamTriadDispatcher.RemoteEnum remote,
BamTriadDispatcher.ActiveEnum active)
Load a file from the remote servers.
|
void |
queryTriadFirstActive(TriadOwner owner,
java.io.Serializable payload,
QueryCallback cb)
Load a file from the remote servers.
|
java.lang.Object |
queryTriadFirstRemote(TriadOwner owner,
java.io.Serializable payload)
Load a file from the remote servers.
|
java.lang.String |
toString()
Load a file from the remote servers.
|
public BamTriadSender(QuerySender sender, CloudPod pod, java.lang.String uid)
linkStream
- stream to the broker for sending messagespod
- the owning poduid
- the uid prefix for the generated messagepublic CloudPod getPod()
public java.lang.String getAddress()
public boolean isPrimarySelf(TriadOwner owner)
public java.lang.String getPrimaryAddress(TriadOwner owner)
public java.lang.String getSecondaryAddress(TriadOwner owner)
public java.lang.String getTertiaryAddress(TriadOwner owner)
public java.lang.String messageActiveOrSelf(java.io.Serializable msg, TriadOwner owner)
public void messageBackup(java.io.Serializable msg, TriadOwner owner)
public void messageTriadRemote(java.io.Serializable msg, TriadOwner owner)
public java.lang.String messageFirstTriadRemote(java.io.Serializable msg, TriadOwner owner)
public java.lang.String messageFirstTriadActive(java.io.Serializable msg, TriadOwner owner)
public java.lang.String messageFirstTriad(java.io.Serializable msg, TriadOwner owner, BamTriadDispatcher.RemoteEnum remote)
public void messageAllTriadRemote(java.io.Serializable msg)
public void queryAllTriadRemote(java.io.Serializable msg, QueryCallback cb)
public void messageAll(java.io.Serializable msg)
public boolean queryTriad(TriadOwner owner, java.io.Serializable payload, QueryCallback callback)
public java.lang.Object queryTriadFirstRemote(TriadOwner owner, java.io.Serializable payload)
public void queryTriadFirstActive(TriadOwner owner, java.io.Serializable payload, QueryCallback cb)
public void queryTriadAll(TriadOwner owner, java.io.Serializable payload, QueryCallback cb, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public boolean querySecondary(TriadOwner owner, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public boolean queryTertiary(TriadOwner owner, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public java.lang.String toString()
toString
in class java.lang.Object