public class ClusterRouteManager extends AbstractCloudServerListener
Constructor and Description |
---|
ClusterRouteManager(ActorSender sender,
CloudPod pod) |
Modifier and Type | Method and Description |
---|---|
static ClusterRouteManager |
create(CloudPod pod) |
java.lang.String |
getAddress() |
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.lang.String uid,
java.io.Serializable msg,
TriadOwner owner)
Sends a message to one of the triad members, including the server itself.
|
void |
messageAll(java.lang.String uid,
java.io.Serializable msg)
Send a message to all servers in the pod.
|
void |
messageAllTriadRemote(java.lang.String uid,
java.io.Serializable msg)
Send a message to active remove triad servers.
|
void |
messageBackup(java.lang.String uid,
java.io.Serializable msg,
TriadOwner owner) |
java.lang.String |
messageFirstTriad(java.lang.String uid,
java.io.Serializable msg,
TriadOwner owner,
BamTriadDispatcher.RemoteEnum remote)
Sends a message to the first active remote triad server.
|
java.lang.String |
messageFirstTriadActive(java.lang.String uid,
java.io.Serializable msg,
TriadOwner owner)
Sends a message to the first active remote triad server.
|
java.lang.String |
messageFirstTriadRemote(java.lang.String uid,
java.io.Serializable msg,
TriadOwner owner)
Sends a message to the first active remote triad server.
|
void |
messageTriadRemote(java.lang.String uid,
java.io.Serializable msg,
TriadOwner owner) |
void |
queryAll(java.lang.String uid,
java.io.Serializable payload,
QueryCallback cb)
Load a file from the remote servers.
|
void |
queryAllTriadRemote(java.lang.String uid,
java.io.Serializable msg,
QueryCallback cb)
Send a message to active remove triad servers.
|
void |
queryGlobalTriadFirstRemote(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload,
QueryCallback cb)
Sends a query to each server.
|
boolean |
queryPrimary(java.lang.String uid,
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 |
querySecondary(java.lang.String uid,
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(java.lang.String uid,
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(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload,
QueryCallback callback)
Sends a query to the first active server in the triad.
|
java.lang.Object |
queryTriadActiveOrSelf(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload)
Load a file from the remote servers.
|
void |
queryTriadActiveOrSelf(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload,
QueryCallback cb)
Load a file from the remote servers.
|
void |
queryTriadAll(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload,
QueryCallback cb,
BamTriadDispatcher.RemoteEnum remote,
BamTriadDispatcher.ActiveEnum active)
Load a file from the remote servers.
|
void |
queryTriadFirst(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload,
QueryCallback cb,
BamTriadDispatcher.RemoteEnum isRemote)
Load a file from the remote servers.
|
void |
queryTriadFirstActive(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload,
QueryCallback cb)
Load a file from the remote servers.
|
java.lang.Object |
queryTriadFirstRemote(java.lang.String uid,
TriadOwner owner,
java.io.Serializable payload)
Load a file from the remote servers.
|
java.lang.String |
toString() |
onServerAdd, onServerRemove, onServerStateChange, onTriadAdd, onTriadRemove
public ClusterRouteManager(ActorSender sender, CloudPod pod)
sender
- the outgoing query sender for the routerpod
- the owning podpublic static ClusterRouteManager create(CloudPod pod)
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.lang.String uid, java.io.Serializable msg, TriadOwner owner)
public void messageBackup(java.lang.String uid, java.io.Serializable msg, TriadOwner owner)
public void messageTriadRemote(java.lang.String uid, java.io.Serializable msg, TriadOwner owner)
public java.lang.String messageFirstTriadRemote(java.lang.String uid, java.io.Serializable msg, TriadOwner owner)
public java.lang.String messageFirstTriadActive(java.lang.String uid, java.io.Serializable msg, TriadOwner owner)
public java.lang.String messageFirstTriad(java.lang.String uid, java.io.Serializable msg, TriadOwner owner, BamTriadDispatcher.RemoteEnum remote)
public void messageAllTriadRemote(java.lang.String uid, java.io.Serializable msg)
public void queryAllTriadRemote(java.lang.String uid, java.io.Serializable msg, QueryCallback cb)
public void messageAll(java.lang.String uid, java.io.Serializable msg)
public boolean queryTriad(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback callback)
public java.lang.Object queryTriadFirstRemote(java.lang.String uid, TriadOwner owner, java.io.Serializable payload)
public void queryGlobalTriadFirstRemote(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback cb)
public void queryTriadFirst(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback cb, BamTriadDispatcher.RemoteEnum isRemote)
public void queryTriadFirstActive(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback cb)
public void queryAll(java.lang.String uid, java.io.Serializable payload, QueryCallback cb)
public void queryTriadAll(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback cb, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public boolean queryPrimary(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public boolean querySecondary(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public boolean queryTertiary(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback callback, BamTriadDispatcher.RemoteEnum remote, BamTriadDispatcher.ActiveEnum active)
public java.lang.Object queryTriadActiveOrSelf(java.lang.String uid, TriadOwner owner, java.io.Serializable payload)
public void queryTriadActiveOrSelf(java.lang.String uid, TriadOwner owner, java.io.Serializable payload, QueryCallback cb)
public java.lang.String toString()
toString
in class java.lang.Object