Package org.hyperledger.fabric.sdk
Class ChaincodeEndorsementPolicy
- java.lang.Object
-
- org.hyperledger.fabric.sdk.ChaincodeEndorsementPolicy
-
public class ChaincodeEndorsementPolicy extends java.lang.Object
A wrapper for the Hyperledger Fabric Policy object
-
-
Constructor Summary
Constructors Constructor Description ChaincodeEndorsementPolicy()
The null constructor for the ChaincodeEndorsementPolicy wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fromBytes(byte[] policyAsBytes)
sets the ChaincodeEndorsementPolicy from a byte arrayvoid
fromFile(java.io.File policyFile)
constructs a ChaincodeEndorsementPolicy object with the actual policy gotten from the file systemvoid
fromStream(java.io.InputStream inputStream)
Construct a chaincode endorsement policy from a stream.void
fromYamlFile(java.io.File yamlPolicyFile)
From a yaml filebyte[]
getChaincodeEndorsementPolicyAsBytes()
-
-
-
Constructor Detail
-
ChaincodeEndorsementPolicy
public ChaincodeEndorsementPolicy()
The null constructor for the ChaincodeEndorsementPolicy wrapper. You will need to use thefromBytes(byte[])
method to populate the policy
-
-
Method Detail
-
fromFile
public void fromFile(java.io.File policyFile) throws java.io.IOException
constructs a ChaincodeEndorsementPolicy object with the actual policy gotten from the file system- Parameters:
policyFile
- The file containing the policy- Throws:
java.io.IOException
-
fromYamlFile
public void fromYamlFile(java.io.File yamlPolicyFile) throws java.io.IOException, ChaincodeEndorsementPolicyParseException
From a yaml file- Parameters:
yamlPolicyFile
- File location for the chaincode endorsement policy specification.- Throws:
java.io.IOException
ChaincodeEndorsementPolicyParseException
-
fromStream
public void fromStream(java.io.InputStream inputStream) throws java.io.IOException
Construct a chaincode endorsement policy from a stream.- Parameters:
inputStream
-- Throws:
java.io.IOException
-
fromBytes
public void fromBytes(byte[] policyAsBytes)
sets the ChaincodeEndorsementPolicy from a byte array- Parameters:
policyAsBytes
- the byte array containing the serialized policy
-
getChaincodeEndorsementPolicyAsBytes
public byte[] getChaincodeEndorsementPolicyAsBytes()
- Returns:
- the policy serialized per protobuf and ready for inclusion into the various Block/Envelope/ChaincodeInputSpec structures
-
-