Class TransactionContext
- java.lang.Object
 - 
- org.hyperledger.fabric.sdk.transaction.TransactionContext
 
 
- 
public class TransactionContext extends java.lang.ObjectInternal class, not an public API. A transaction context emits events 'submitted', 'complete', and 'error'. Each transaction context uses exactly one tcert. 
- 
- 
Constructor Summary
Constructors Constructor Description TransactionContext(Channel channel, User user, CryptoSuite cryptoPrimitives) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChannelgetChannel()Get the channel with which this transaction context is associated.java.lang.StringgetChannelID()CryptoSuitegetCryptoPrimitives()longgetEpoch()com.google.protobuf.TimestampgetFabricTimestamp()org.hyperledger.fabric.protos.msp.Identities.SerializedIdentitygetIdentity()com.google.protobuf.ByteStringgetNonce()longgetProposalWaitTime()Gets the timeout for a single proposal request to endorser in milliseconds.org.hyperledger.fabric.protos.msp.Identities.SerializedIdentitygetSerializedIdentity()java.lang.StringgetTxID()UsergetUser()Get the user with which this transaction context is associated.booleangetVerify()TransactionContextretryTransactionSameContext()voidsetProposalWaitTime(long proposalWaitTime)Sets the timeout for a single proposal request to endorser in milliseconds.byte[]sign(byte[] b)com.google.protobuf.ByteStringsignByteString(byte[] b)com.google.protobuf.ByteStringsignByteStrings(com.google.protobuf.ByteString... bs)com.google.protobuf.ByteString[]signByteStrings(User[] users, com.google.protobuf.ByteString... bs)java.lang.StringtoString()voidverify(boolean verify) 
 - 
 
- 
- 
Constructor Detail
- 
TransactionContext
public TransactionContext(Channel channel, User user, CryptoSuite cryptoPrimitives)
 
 - 
 
- 
Method Detail
- 
getCryptoPrimitives
public CryptoSuite getCryptoPrimitives()
 
- 
getIdentity
public org.hyperledger.fabric.protos.msp.Identities.SerializedIdentity getIdentity()
 
- 
getEpoch
public long getEpoch()
 
- 
getUser
public User getUser()
Get the user with which this transaction context is associated.- Returns:
 - The user
 
 
- 
getChannel
public Channel getChannel()
Get the channel with which this transaction context is associated.- Returns:
 - The channel
 
 
- 
getProposalWaitTime
public long getProposalWaitTime()
Gets the timeout for a single proposal request to endorser in milliseconds.- Returns:
 - the timeout for a single proposal request to endorser in milliseconds
 
 
- 
setProposalWaitTime
public void setProposalWaitTime(long proposalWaitTime)
Sets the timeout for a single proposal request to endorser in milliseconds.- Parameters:
 proposalWaitTime- the timeout for a single proposal request to endorser in milliseconds
 
- 
getFabricTimestamp
public com.google.protobuf.Timestamp getFabricTimestamp()
 
- 
getNonce
public com.google.protobuf.ByteString getNonce()
 
- 
verify
public void verify(boolean verify)
 
- 
getVerify
public boolean getVerify()
 
- 
getChannelID
public java.lang.String getChannelID()
 
- 
getTxID
public java.lang.String getTxID()
 
- 
sign
public byte[] sign(byte[] b) throws CryptoException, InvalidArgumentException 
- 
signByteString
public com.google.protobuf.ByteString signByteString(byte[] b) throws CryptoException, InvalidArgumentException 
- 
signByteStrings
public com.google.protobuf.ByteString signByteStrings(com.google.protobuf.ByteString... bs) throws CryptoException, InvalidArgumentException 
- 
signByteStrings
public com.google.protobuf.ByteString[] signByteStrings(User[] users, com.google.protobuf.ByteString... bs) throws CryptoException, InvalidArgumentException
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
retryTransactionSameContext
public TransactionContext retryTransactionSameContext()
 
- 
getSerializedIdentity
public org.hyperledger.fabric.protos.msp.Identities.SerializedIdentity getSerializedIdentity()
 
 - 
 
 -