Package com.orchestranetworks.d3
Interface D3Broadcast
public interface D3Broadcast
The broadcast handler contains the information used in the broadcast distributed transaction.
This object is created using one the following methods:
D3NodeAsMaster.getHandlerForAsynchronousBroadcast(VersionKey)
D3NodeAsMaster.getHandlerForSynchronousBroadcast(VersionKey)
D3NodeAsMaster.getHandlerForSynchronousBroadcast(VersionKey, long)
.
When created, the broadcast handler can be used in the method broadcast()
.
This object contains information about the broadcast operation, such as:
- Synchronization mode:
- if synchronous: after launching the broadcast operation, the method waits for the end of broadcast notification
- if asynchronous: the method only queues the broadcast operation without waiting for the end of the operation
- Operation time out: if in synchronized mode, this corresponds to the time out of the operation (no effect on the
broadcast).
If this object is not notified when the time out is reached, the broadcast method throws an
OperationException
. VersionKey
of the delivery dataspace to broadcast.- Delivery status of the broadcast operation.
- Message of the broadcast operation.
- Stack trace on operation failure.
See Broadcast for more information.
- Since:
- 5.2.7
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Global status of the snapshot broadcast operation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Broadcasts a snapshot in synchronous or asynchronous mode depending on the way this object has been obtained.Returns a list of delivery modes used in this broadcast handler.Deprecated.Since 5.4.0getDeliveryStatus
(DeliveryMode aDeliveryMode) Global delivery status depending on the delivery mode ('Cluster' or 'Federation').
If the broadcast operation is waiting for its turn:
returns'Not initialized'
status regardless of the delivery mode If the delivery mode in the parameter is not relevant:
throws anIllegalArgumentException
Returns the message of the broadcast operation.long
Returns the operation time-out in milliseconds.Returns the stack trace of the broadcast operation if it failed.Returns theVersionKey
of the snapshot to broadcast.boolean
Returnstrue
if the operation is full resynchronization concerned.void
setOperationTimeOut
(long aOperationTimeOut) Sets the operation time out.
-
Method Details
-
broadcast
Broadcasts a snapshot in synchronous or asynchronous mode depending on the way this object has been obtained.It can be created using one of these three methods in the API:
D3NodeAsMaster.getHandlerForAsynchronousBroadcast(VersionKey)
D3NodeAsMaster.getHandlerForSynchronousBroadcast(VersionKey, long)
D3NodeAsMaster.getHandlerForSynchronousBroadcast(VersionKey)
This object is notified upon broadcast termination (after a commit or rollback transaction). It then provides:
- Status of the transaction
- Reason for failure if rollback occurs
- Map of the replica nodes and their statuses
- Throws:
OperationException
-- if the owner of the current session is not allowed to broadcast
- if snapshot validation report has its severity higher than the threshold
- if 'D3 Master configuration' technical dataspace has validation errors
- if the broadcast process exceeds the operation timeout (for synchronous mode only)
-
setOperationTimeOut
void setOperationTimeOut(long aOperationTimeOut) Sets the operation time out. Ignored if the synchronization mode isasynchronous
.- Parameters:
aOperationTimeOut
- in milliseconds.- Throws:
IllegalArgumentException
- ifaOperationTimeOut
is negative.
-
getOperationTimeOut
long getOperationTimeOut()Returns the operation time-out in milliseconds. If the synchronization mode isasynchronous
, returns-1
. -
getVersionKey
VersionKey getVersionKey()Returns theVersionKey
of the snapshot to broadcast. -
getDeliveryModes
List<DeliveryMode> getDeliveryModes()Returns a list of delivery modes used in this broadcast handler.- Since:
- 5.4.0
-
getDeliveryStatus
Global delivery status depending on the delivery mode ('Cluster' or 'Federation').
If the broadcast operation is waiting for its turn:
- returns
'Not initialized'
status regardless of the delivery mode
- throws an
IllegalArgumentException
- Since:
- 5.4.0
- returns
-
getDeliveryStatus
Deprecated.Since 5.4.0Returns the global delivery status of the broadcast handler for the default delivery mode (clustered).- See Also:
-
isFullResync
boolean isFullResync()Returnstrue
if the operation is full resynchronization concerned. Otherwise, returnsfalse
.- Since:
- 5.5.1
-
getMessage
String getMessage()Returns the message of the broadcast operation. -
getStackTrace
String getStackTrace()Returns the stack trace of the broadcast operation if it failed. Otherwise, returnsnull
.
-