use of io.seata.core.protocol.transaction.GlobalReportRequest in project seata by seata.
the class GlobalReportRequestCodec method encode.
@Override
public <T> void encode(T t, ByteBuf out) {
super.encode(t, out);
GlobalReportRequest reportRequest = (GlobalReportRequest) t;
GlobalStatus globalStatus = reportRequest.getGlobalStatus();
if (globalStatus != null) {
out.writeByte((byte) globalStatus.getCode());
} else {
out.writeByte((byte) -1);
}
}
use of io.seata.core.protocol.transaction.GlobalReportRequest in project seata by seata.
the class DefaultTransactionManager method globalReport.
@Override
public GlobalStatus globalReport(String xid, GlobalStatus globalStatus) throws TransactionException {
GlobalReportRequest globalReport = new GlobalReportRequest();
globalReport.setXid(xid);
globalReport.setGlobalStatus(globalStatus);
GlobalReportResponse response = (GlobalReportResponse) syncCall(globalReport);
return response.getGlobalStatus();
}
use of io.seata.core.protocol.transaction.GlobalReportRequest in project seata by seata.
the class AbstractTCInboundHandler method handle.
@Override
public GlobalReportResponse handle(GlobalReportRequest request, final RpcContext rpcContext) {
GlobalReportResponse response = new GlobalReportResponse();
response.setGlobalStatus(request.getGlobalStatus());
exceptionHandleTemplate(new AbstractCallback<GlobalReportRequest, GlobalReportResponse>() {
@Override
public void execute(GlobalReportRequest request, GlobalReportResponse response) throws TransactionException {
doGlobalReport(request, response, rpcContext);
}
}, request, response);
return response;
}
use of io.seata.core.protocol.transaction.GlobalReportRequest in project seata by seata.
the class GlobalReportRequestCodec method decode.
@Override
public <T> void decode(T t, ByteBuffer in) {
super.decode(t, in);
GlobalReportRequest reportRequest = (GlobalReportRequest) t;
byte b = in.get();
if (b > -1) {
reportRequest.setGlobalStatus(GlobalStatus.get(b));
}
}
use of io.seata.core.protocol.transaction.GlobalReportRequest in project seata by seata.
the class GlobalReportRequestConvertor method convert2Model.
@Override
public GlobalReportRequest convert2Model(GlobalReportRequestProto globalReportRequestProto) {
GlobalReportRequest globalReportRequest = new GlobalReportRequest();
globalReportRequest.setExtraData(globalReportRequestProto.getAbstractGlobalEndRequest().getExtraData());
globalReportRequest.setXid(globalReportRequestProto.getAbstractGlobalEndRequest().getXid());
globalReportRequest.setGlobalStatus(GlobalStatus.valueOf(globalReportRequestProto.getGlobalStatus().name()));
return globalReportRequest;
}
Aggregations