Interface StateBasedEndorsement


  • public interface StateBasedEndorsement
    StateBasedEndorsement provides a set of convenience methods to create and modify a state-based endorsement policy. Endorsement policies created by this convenience layer will always be a logical AND of "ORG.peer" principals for one or more ORGs specified by the caller.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  StateBasedEndorsement.RoleType
      RoleType of an endorsement policy's identity
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addOrgs​(StateBasedEndorsement.RoleType roleType, java.lang.String... organizations)
      Adds the specified orgs to the list of orgs that are required to endorse.
      void delOrgs​(java.lang.String... organizations)
      deletes the specified channel orgs from the existing key-level endorsement policy for this KVS key.
      java.util.List<java.lang.String> listOrgs()
      Returns an array of channel orgs that are required to endorse changes
      byte[] policy()
      Returns the endorsement policy as bytes
    • Method Detail

      • policy

        byte[] policy()
        Returns the endorsement policy as bytes
        Returns:
        byte[]
      • addOrgs

        void addOrgs​(StateBasedEndorsement.RoleType roleType,
                     java.lang.String... organizations)
        Adds the specified orgs to the list of orgs that are required to endorse. All orgs MSP role types will be set to the role that is specified in the first parameter. Among other aspects the desired role depends on the channel's configuration: if it supports node OUs, it is likely going to be the PEER role, while the MEMBER role is the suited one if it does not.
        Parameters:
        roleType -
        organizations -
      • delOrgs

        void delOrgs​(java.lang.String... organizations)
        deletes the specified channel orgs from the existing key-level endorsement policy for this KVS key.
        Parameters:
        organizations -
      • listOrgs

        java.util.List<java.lang.String> listOrgs()
        Returns an array of channel orgs that are required to endorse changes
        Returns:
        List of organizations