Class 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 array
      void fromFile​(java.io.File policyFile)
      constructs a ChaincodeEndorsementPolicy object with the actual policy gotten from the file system
      void fromStream​(java.io.InputStream inputStream)
      Construct a chaincode endorsement policy from a stream.
      void fromYamlFile​(java.io.File yamlPolicyFile)
      From a yaml file
      byte[] getChaincodeEndorsementPolicyAsBytes​()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChaincodeEndorsementPolicy

        public ChaincodeEndorsementPolicy​()
        The null constructor for the ChaincodeEndorsementPolicy wrapper. You will need to use the fromBytes(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
      • 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