public interface Transport extends Lifecycle
Modifier and Type | Method and Description |
---|---|
BackupResponse |
backupRemotely(Collection<XSiteBackup> backups,
XSiteReplicateCommand rpcCommand)
Deprecated.
since 10.0. Use
backupRemotely(XSiteBackup, XSiteReplicateCommand) instead. |
XSiteResponse |
backupRemotely(XSiteBackup backup,
XSiteReplicateCommand rpcCommand)
Sends a cross-site request to a remote site.
|
void |
checkCrossSiteAvailable()
Checks if this
Transport is able to perform cross-site requests. |
default void |
checkTotalOrderSupported()
Deprecated.
Total order support dropped
|
Address |
getAddress()
Retrieves the current cache instance's network address
|
Address |
getCoordinator() |
Log |
getLog() |
List<Address> |
getMembers()
Returns a list of members in the current cluster view.
|
List<Address> |
getMembersPhysicalAddresses()
Returns physical addresses of members in the current cluster view.
|
List<Address> |
getPhysicalAddresses()
Retrieves the current cache instance's physical network addresses.
|
Set<String> |
getSitesView()
Get the view of interconnected sites.
|
int |
getViewId() |
default <T> CompletionStage<T> |
invokeCommand(Address target,
ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on a single node and pass the response to a
ResponseCollector . |
default <T> CompletionStage<T> |
invokeCommand(Collection<Address> targets,
ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on a collection of node and pass the responses to a
ResponseCollector . |
default <T> CompletionStage<T> |
invokeCommandOnAll(Collection<Address> requiredTargets,
ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on all the nodes in the cluster and pass the responses to a
ResponseCollector . |
default <T> CompletionStage<T> |
invokeCommandOnAll(ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on all the nodes in the cluster and pass the responses to a
ResponseCollector . |
default <T> CompletionStage<T> |
invokeCommands(Collection<Address> targets,
Function<Address,ReplicableCommand> commandGenerator,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit timeUnit)
Invoke different commands on a collection of nodes and pass the responses to a
ResponseCollector . |
default <T> CompletionStage<T> |
invokeCommands(Collection<Address> targets,
Function<Address,ReplicableCommand> commandGenerator,
ResponseCollector<T> responseCollector,
long timeout,
DeliverOrder deliverOrder)
Deprecated.
Introduced in 9.1, but replaced in 9.2 with
invokeCommands(Collection, Function, ResponseCollector, DeliverOrder, long, TimeUnit) . |
default <T> CompletionStage<T> |
invokeCommandStaggered(Collection<Address> targets,
ReplicableCommand command,
ResponseCollector<T> collector,
DeliverOrder deliverOrder,
long timeout,
TimeUnit unit)
Invoke a command on a collection of nodes and pass the responses to a
ResponseCollector . |
default Map<Address,Response> |
invokeRemotely(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast)
Deprecated.
Since 9.2, please use
invokeCommand(Collection, ReplicableCommand, ResponseCollector, DeliverOrder, long, TimeUnit) instead. |
default Map<Address,Response> |
invokeRemotely(Map<Address,ReplicableCommand> rpcCommands,
ResponseMode mode,
long timeout,
boolean usePriorityQueue,
ResponseFilter responseFilter,
boolean totalOrder,
boolean anycast)
Deprecated.
|
default Map<Address,Response> |
invokeRemotely(Map<Address,ReplicableCommand> rpcCommands,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast)
Deprecated.
Since 9.2, please use
invokeRemotelyAsync(Collection, ReplicableCommand, ResponseMode, long, ResponseFilter, DeliverOrder, boolean) instead. |
CompletableFuture<Map<Address,Response>> |
invokeRemotelyAsync(Collection<Address> recipients,
ReplicableCommand rpcCommand,
ResponseMode mode,
long timeout,
ResponseFilter responseFilter,
DeliverOrder deliverOrder,
boolean anycast) |
boolean |
isCoordinator() |
boolean |
isMulticastCapable()
Tests whether the transport supports true multicast
|
String |
localSiteName() |
void |
sendTo(Address destination,
ReplicableCommand rpcCommand,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the destination using the specified DeliverOrder . |
default void |
sendToAll(ReplicableCommand rpcCommand,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the entire cluster. |
void |
sendToMany(Collection<Address> destinations,
ReplicableCommand rpcCommand,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the set of destination using the specified DeliverOrder . |
void |
start()
Invoked on component start
|
void |
stop()
Invoked on component stop
|
void |
waitForView(int viewId)
Deprecated.
Since 9.0, please use
withView(int) instead. |
CompletableFuture<Void> |
withView(int expectedViewId) |
@Deprecated default Map<Address,Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
invokeCommand(Collection, ReplicableCommand, ResponseCollector, DeliverOrder, long, TimeUnit)
instead.recipients
- a list of Addresses to invoke the call on. If this is null, the call is broadcast to the
entire cluster.rpcCommand
- the cache command to invokemode
- the response mode to usetimeout
- a timeout after which to throw a replication exception. implementations.responseFilter
- a response filter with which to filter out failed/unwanted/invalid responses.deliverOrder
- the DeliverOrder
.anycast
- used when is true
, it means that it must use TOA instead of
TOB.Exception
- in the event of problems.CompletableFuture<Map<Address,Response>> invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
Exception
void sendTo(Address destination, ReplicableCommand rpcCommand, DeliverOrder deliverOrder) throws Exception
ReplicableCommand
to the destination using the specified DeliverOrder
.destination
- the destination's Address
.rpcCommand
- the ReplicableCommand
to send.deliverOrder
- the DeliverOrder
to use.Exception
- if there was problem sending the request.void sendToMany(Collection<Address> destinations, ReplicableCommand rpcCommand, DeliverOrder deliverOrder) throws Exception
ReplicableCommand
to the set of destination using the specified DeliverOrder
.destinations
- the collection of destination's Address
. If null
, it sends to all the members
in the cluster.rpcCommand
- the ReplicableCommand
to send.deliverOrder
- the DeliverOrder
to use.Exception
- if there was problem sending the request.@Experimental default void sendToAll(ReplicableCommand rpcCommand, DeliverOrder deliverOrder) throws Exception
ReplicableCommand
to the entire cluster.Exception
@Deprecated default Map<Address,Response> invokeRemotely(Map<Address,ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, boolean usePriorityQueue, ResponseFilter responseFilter, boolean totalOrder, boolean anycast) throws Exception
invokeRemotely(Map, ResponseMode, long, ResponseFilter, DeliverOrder, boolean)
insteadException
@Deprecated default Map<Address,Response> invokeRemotely(Map<Address,ReplicableCommand> rpcCommands, ResponseMode mode, long timeout, ResponseFilter responseFilter, DeliverOrder deliverOrder, boolean anycast) throws Exception
invokeRemotelyAsync(Collection, ReplicableCommand, ResponseMode, long, ResponseFilter, DeliverOrder, boolean)
instead.Exception
@Deprecated BackupResponse backupRemotely(Collection<XSiteBackup> backups, XSiteReplicateCommand rpcCommand) throws Exception
backupRemotely(XSiteBackup, XSiteReplicateCommand)
instead.Exception
XSiteResponse backupRemotely(XSiteBackup backup, XSiteReplicateCommand rpcCommand)
Currently, no reply values are supported. Or the request completes successfully or it throws an Exception
.
If XSiteBackup.isSync()
returns false
, the XSiteResponse
is only completed when the an
ACK from the remote site is received. The invoker needs to make sure not to wait for the XSiteResponse
.
backup
- The remote site.rpcCommand
- The command to send.XSiteResponse
that is completed when the request is completed.boolean isCoordinator()
Address getCoordinator()
Address getAddress()
List<Address> getPhysicalAddresses()
getAddress()
.List<Address> getMembers()
List<Address> getMembersPhysicalAddresses()
boolean isMulticastCapable()
void checkCrossSiteAvailable() throws CacheConfigurationException
Transport
is able to perform cross-site requests.CacheConfigurationException
- if cross-site isn't available.String localSiteName()
null
if this Transport
cannot make cross-site requests.void start()
Lifecycle
void stop()
Lifecycle
int getViewId()
CacheException
- if the transport has been stopped.CompletableFuture<Void> withView(int expectedViewId)
CompletableFuture
that completes when the transport has installed the expected view.@Deprecated void waitForView(int viewId) throws InterruptedException
withView(int)
instead.InterruptedException
Log getLog()
@Deprecated default void checkTotalOrderSupported()
Set<String> getSitesView()
@Experimental default <T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
ResponseCollector
.
If the target is the local node, the command is never executed and ResponseCollector.finish()
is called directly.
@Experimental default <T> CompletionStage<T> invokeCommand(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
ResponseCollector
.
If one of the targets is the local node, it is ignored. The command is only executed on the remote nodes.
@Experimental default <T> CompletionStage<T> invokeCommandOnAll(ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
ResponseCollector
.
The command is not executed locally and it is not sent across RELAY2 bridges to remote sites.
@Experimental default <T> CompletionStage<T> invokeCommandOnAll(Collection<Address> requiredTargets, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
ResponseCollector
.
he command is not executed locally and it is not sent across RELAY2 bridges to remote sites.
@Experimental default <T> CompletionStage<T> invokeCommandStaggered(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit unit)
ResponseCollector
.
The command is only sent immediately to the first target, and there is an implementation-dependent
delay before sending the command to each target. There is no delay if the target responds or leaves
the cluster. The remaining targets are skipped if ResponseCollector.addResponse(Address, Response)
returns a non-null
value.
The command is only executed on the remote nodes.
@Deprecated default <T> CompletionStage<T> invokeCommands(Collection<Address> targets, Function<Address,ReplicableCommand> commandGenerator, ResponseCollector<T> responseCollector, long timeout, DeliverOrder deliverOrder)
invokeCommands(Collection, Function, ResponseCollector, DeliverOrder, long, TimeUnit)
.ResponseCollector
.
The command is only executed on the remote nodes.
@Experimental default <T> CompletionStage<T> invokeCommands(Collection<Address> targets, Function<Address,ReplicableCommand> commandGenerator, ResponseCollector<T> collector, DeliverOrder deliverOrder, long timeout, TimeUnit timeUnit)
ResponseCollector
.
The command is only executed on the remote nodes.
Copyright © 2021 JBoss by Red Hat. All rights reserved.