Package org.hyperledger.fabric.sdk
Class ChaincodeEndorsementPolicy
- java.lang.Object
-
- org.hyperledger.fabric.sdk.ChaincodeEndorsementPolicy
-
public class ChaincodeEndorsementPolicy extends java.lang.ObjectA 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 voidfromBytes(byte[] policyAsBytes)sets the ChaincodeEndorsementPolicy from a byte arrayvoidfromFile(java.io.File policyFile)constructs a ChaincodeEndorsementPolicy object with the actual policy gotten from the file systemvoidfromStream(java.io.InputStream inputStream)Construct a chaincode endorsement policy from a stream.voidfromYamlFile(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.IOExceptionconstructs 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, ChaincodeEndorsementPolicyParseExceptionFrom a yaml file- Parameters:
yamlPolicyFile- File location for the chaincode endorsement policy specification.- Throws:
java.io.IOExceptionChaincodeEndorsementPolicyParseException
-
fromStream
public void fromStream(java.io.InputStream inputStream) throws java.io.IOExceptionConstruct 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
-
-