Class TransactionContext
- java.lang.Object
-
- org.hyperledger.fabric.sdk.transaction.TransactionContext
-
public class TransactionContext extends java.lang.Object
Internal 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 Channel
getChannel()
Get the channel with which this transaction context is associated.java.lang.String
getChannelID()
CryptoSuite
getCryptoPrimitives()
long
getEpoch()
com.google.protobuf.Timestamp
getFabricTimestamp()
org.hyperledger.fabric.protos.msp.Identities.SerializedIdentity
getIdentity()
com.google.protobuf.ByteString
getNonce()
long
getProposalWaitTime()
Gets the timeout for a single proposal request to endorser in milliseconds.org.hyperledger.fabric.protos.msp.Identities.SerializedIdentity
getSerializedIdentity()
java.lang.String
getTxID()
User
getUser()
Get the user with which this transaction context is associated.boolean
getVerify()
TransactionContext
retryTransactionSameContext()
void
setProposalWaitTime(long proposalWaitTime)
Sets the timeout for a single proposal request to endorser in milliseconds.byte[]
sign(byte[] b)
com.google.protobuf.ByteString
signByteString(byte[] b)
com.google.protobuf.ByteString
signByteStrings(com.google.protobuf.ByteString... bs)
com.google.protobuf.ByteString[]
signByteStrings(User[] users, com.google.protobuf.ByteString... bs)
java.lang.String
toString()
void
verify(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:
toString
in classjava.lang.Object
-
retryTransactionSameContext
public TransactionContext retryTransactionSameContext()
-
getSerializedIdentity
public org.hyperledger.fabric.protos.msp.Identities.SerializedIdentity getSerializedIdentity()
-
-