public final class BamTriadDispatcher extends AbstractCloudServerListener
Modifier and Type | Class and Description |
---|---|
static class |
BamTriadDispatcher.ActiveEnum |
static class |
BamTriadDispatcher.RemoteEnum |
Constructor and Description |
---|
BamTriadDispatcher(CloudPod pod) |
Modifier and Type | Method and Description |
---|---|
static BamTriadDispatcher |
create(CloudPod pod) |
com.caucho.cloud.bam.BamTriadDispatcher.BamServer |
getA() |
java.lang.String |
getActiveAddress(TriadOwner owner)
Returns the address of the first active server.
|
java.lang.String |
getActiveAddress(TriadOwner owner,
java.lang.String oldAddress)
Returns the address of the first active backup server.
|
java.lang.String |
getActiveOrSelfAddress(TriadOwner owner)
Returns the address of the first active server.
|
ClusterServer |
getActiveOrSelfServer(TriadOwner owner)
Returns the address of the first active server.
|
com.caucho.cloud.bam.BamTriadDispatcher.BamServer |
getB() |
com.caucho.cloud.bam.BamTriadDispatcher.BamServer |
getC() |
CloudPod |
getPod()
Returns the pod for the sender.
|
java.lang.String |
getPrimaryActiveAddress(TriadOwner owner)
Returns the address of the primary, or null if the server doesn't exist.
|
java.lang.String |
getPrimaryAddress(TriadOwner owner)
Returns the address of the primary, or null if the server doesn't exist.
|
java.lang.String |
getSecondaryActiveAddress(TriadOwner owner)
Returns the address of the secondary, or null if the server doesn't exist.
|
java.lang.String |
getSecondaryAddress(TriadOwner owner)
Returns the address of the secondary, or null if the server doesn't exist.
|
java.lang.String |
getTertiaryActiveAddress(TriadOwner owner)
Returns the address of the tertiary, or null if the server doesn't exist.
|
java.lang.String |
getTertiaryAddress(TriadOwner owner)
Returns the address of the tertiary, or null if the server doesn't exist.
|
boolean |
isPrimarySelf(TriadOwner owner)
Returns the address of the primary, or null if the server doesn't exist.
|
void |
onTriadAdd(TriadServer server) |
void |
onTriadRemove(TriadServer server) |
com.caucho.cloud.bam.BamTriadDispatcher.BamServer |
primary(TriadOwner owner) |
boolean |
queryPrimary(java.lang.String uid,
TriadOwner owner,
QuerySender sender,
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 |
querySecondary(java.lang.String uid,
TriadOwner owner,
QuerySender sender,
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(java.lang.String uid,
TriadOwner owner,
QuerySender sender,
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.
|
com.caucho.cloud.bam.BamTriadDispatcher.BamServer |
secondary(TriadOwner owner) |
com.caucho.cloud.bam.BamTriadDispatcher.BamServer |
tertiary(TriadOwner owner) |
java.lang.String |
toString() |
onServerAdd, onServerRemove, onServerStateChange
public BamTriadDispatcher(CloudPod pod)
linkStream
- stream to the broker for sending messagespod
- the owning poduid
- the uid prefix for the generated messagepublic static BamTriadDispatcher create(CloudPod pod)
public CloudPod getPod()
public com.caucho.cloud.bam.BamTriadDispatcher.BamServer getA()
public com.caucho.cloud.bam.BamTriadDispatcher.BamServer getB()
public com.caucho.cloud.bam.BamTriadDispatcher.BamServer getC()
public com.caucho.cloud.bam.BamTriadDispatcher.BamServer primary(TriadOwner owner)
public com.caucho.cloud.bam.BamTriadDispatcher.BamServer secondary(TriadOwner owner)
public com.caucho.cloud.bam.BamTriadDispatcher.BamServer tertiary(TriadOwner owner)
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 getPrimaryActiveAddress(TriadOwner owner)
public java.lang.String getSecondaryActiveAddress(TriadOwner owner)
public java.lang.String getTertiaryActiveAddress(TriadOwner owner)
public java.lang.String getActiveAddress(TriadOwner owner)
public java.lang.String getActiveOrSelfAddress(TriadOwner owner)
public java.lang.String getActiveAddress(TriadOwner owner, java.lang.String oldAddress)
public ClusterServer getActiveOrSelfServer(TriadOwner owner)
public boolean queryPrimary(java.lang.String uid, TriadOwner owner, QuerySender sender, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public boolean querySecondary(java.lang.String uid, TriadOwner owner, QuerySender sender, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public boolean queryTertiary(java.lang.String uid, TriadOwner owner, QuerySender sender, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public void onTriadAdd(TriadServer server)
onTriadAdd
in interface CloudServerListener
onTriadAdd
in class AbstractCloudServerListener
public void onTriadRemove(TriadServer server)
onTriadRemove
in interface CloudServerListener
onTriadRemove
in class AbstractCloudServerListener
public java.lang.String toString()
toString
in class java.lang.Object