org.hyperledger.fabric.protos.common.MspPrincipal Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fabric-sdk-java Show documentation
Show all versions of fabric-sdk-java Show documentation
Java SDK for Hyperledger fabric project
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: msp/msp_principal.proto
package org.hyperledger.fabric.protos.common;
public final class MspPrincipal {
private MspPrincipal() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface MSPPrincipalOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.MSPPrincipal)
com.google.protobuf.MessageOrBuilder {
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
int getPrincipalClassificationValue();
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification getPrincipalClassification();
/**
*
* Principal completes the policy principal definition. For the default
* principal types, Principal can be either "Admin" or "Member".
* For the ByOrganizationUnit/ByIdentity values of Classification,
* PolicyPrincipal acquires its value from an organization unit or
* identity, respectively.
*
*
* optional bytes principal = 2;
*/
com.google.protobuf.ByteString getPrincipal();
}
/**
*
* MSPPrincipal aims to represent an MSP-centric set of identities.
* In particular, this structure allows for definition of
* - a group of identities that are member of the same MSP
* - a group of identities that are member of the same organization unit
* in the same MSP
* - a group of identities that are administering a specific MSP
* - a specific identity
* Expressing these groups is done given two fields of the fields below
* - Classification, that defines the type of classification of identities
* in an MSP this principal would be defined on; Classification can take
* three values:
* (i) ByMSPRole: that represents a classification of identities within
* MSP based on one of the two pre-defined MSP rules, "member" and "admin"
* (ii) ByOrganizationUnit: that represents a classification of identities
* within MSP based on the organization unit an identity belongs to
* (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single
* identity/certificate; this would mean that the Principal bytes
* message
*
*
* Protobuf type {@code common.MSPPrincipal}
*/
public static final class MSPPrincipal extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.MSPPrincipal)
MSPPrincipalOrBuilder {
// Use MSPPrincipal.newBuilder() to construct.
private MSPPrincipal(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private MSPPrincipal() {
principalClassification_ = 0;
principal_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private MSPPrincipal(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
int rawValue = input.readEnum();
principalClassification_ = rawValue;
break;
}
case 18: {
principal_ = input.readBytes();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPPrincipal_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPPrincipal_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.class, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder.class);
}
/**
* Protobuf enum {@code common.MSPPrincipal.Classification}
*/
public enum Classification
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Represents the one of the dedicated MSP roles, the
*
*
* ROLE = 0;
*/
ROLE(0),
/**
*
* one of a member of MSP network, and the one of an
* administrator of an MSP network
*
*
* ORGANIZATION_UNIT = 1;
*/
ORGANIZATION_UNIT(1),
/**
*
* groupping of entities, per MSP affiliation
* E.g., this can well be represented by an MSP's
* Organization unit
*
*
* IDENTITY = 2;
*/
IDENTITY(2),
UNRECOGNIZED(-1),
;
/**
*
* Represents the one of the dedicated MSP roles, the
*
*
* ROLE = 0;
*/
public static final int ROLE_VALUE = 0;
/**
*
* one of a member of MSP network, and the one of an
* administrator of an MSP network
*
*
* ORGANIZATION_UNIT = 1;
*/
public static final int ORGANIZATION_UNIT_VALUE = 1;
/**
*
* groupping of entities, per MSP affiliation
* E.g., this can well be represented by an MSP's
* Organization unit
*
*
* IDENTITY = 2;
*/
public static final int IDENTITY_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Classification valueOf(int value) {
return forNumber(value);
}
public static Classification forNumber(int value) {
switch (value) {
case 0: return ROLE;
case 1: return ORGANIZATION_UNIT;
case 2: return IDENTITY;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Classification> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Classification findValueByNumber(int number) {
return Classification.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.getDescriptor().getEnumTypes().get(0);
}
private static final Classification[] VALUES = values();
public static Classification valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Classification(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:common.MSPPrincipal.Classification)
}
public static final int PRINCIPAL_CLASSIFICATION_FIELD_NUMBER = 1;
private int principalClassification_;
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
public int getPrincipalClassificationValue() {
return principalClassification_;
}
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification getPrincipalClassification() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification result = org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification.valueOf(principalClassification_);
return result == null ? org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification.UNRECOGNIZED : result;
}
public static final int PRINCIPAL_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString principal_;
/**
*
* Principal completes the policy principal definition. For the default
* principal types, Principal can be either "Admin" or "Member".
* For the ByOrganizationUnit/ByIdentity values of Classification,
* PolicyPrincipal acquires its value from an organization unit or
* identity, respectively.
*
*
* optional bytes principal = 2;
*/
public com.google.protobuf.ByteString getPrincipal() {
return principal_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (principalClassification_ != org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification.ROLE.getNumber()) {
output.writeEnum(1, principalClassification_);
}
if (!principal_.isEmpty()) {
output.writeBytes(2, principal_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (principalClassification_ != org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification.ROLE.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, principalClassification_);
}
if (!principal_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, principal_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal other = (org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal) obj;
boolean result = true;
result = result && principalClassification_ == other.principalClassification_;
result = result && getPrincipal()
.equals(other.getPrincipal());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
hash = (37 * hash) + PRINCIPAL_CLASSIFICATION_FIELD_NUMBER;
hash = (53 * hash) + principalClassification_;
hash = (37 * hash) + PRINCIPAL_FIELD_NUMBER;
hash = (53 * hash) + getPrincipal().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* MSPPrincipal aims to represent an MSP-centric set of identities.
* In particular, this structure allows for definition of
* - a group of identities that are member of the same MSP
* - a group of identities that are member of the same organization unit
* in the same MSP
* - a group of identities that are administering a specific MSP
* - a specific identity
* Expressing these groups is done given two fields of the fields below
* - Classification, that defines the type of classification of identities
* in an MSP this principal would be defined on; Classification can take
* three values:
* (i) ByMSPRole: that represents a classification of identities within
* MSP based on one of the two pre-defined MSP rules, "member" and "admin"
* (ii) ByOrganizationUnit: that represents a classification of identities
* within MSP based on the organization unit an identity belongs to
* (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single
* identity/certificate; this would mean that the Principal bytes
* message
*
*
* Protobuf type {@code common.MSPPrincipal}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.MSPPrincipal)
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPPrincipal_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPPrincipal_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.class, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
principalClassification_ = 0;
principal_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPPrincipal_descriptor;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.getDefaultInstance();
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal build() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal buildPartial() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal result = new org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal(this);
result.principalClassification_ = principalClassification_;
result.principal_ = principal_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal) {
return mergeFrom((org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal other) {
if (other == org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.getDefaultInstance()) return this;
if (other.principalClassification_ != 0) {
setPrincipalClassificationValue(other.getPrincipalClassificationValue());
}
if (other.getPrincipal() != com.google.protobuf.ByteString.EMPTY) {
setPrincipal(other.getPrincipal());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int principalClassification_ = 0;
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
public int getPrincipalClassificationValue() {
return principalClassification_;
}
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
public Builder setPrincipalClassificationValue(int value) {
principalClassification_ = value;
onChanged();
return this;
}
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification getPrincipalClassification() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification result = org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification.valueOf(principalClassification_);
return result == null ? org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification.UNRECOGNIZED : result;
}
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
public Builder setPrincipalClassification(org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Classification value) {
if (value == null) {
throw new NullPointerException();
}
principalClassification_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Classification describes the way that one should process
* Principal. An Classification value of "ByOrganizationUnit" reflects
* that "Principal" contains the name of an organization this MSP
* handles. A Classification value "ByIdentity" means that
* "Principal" contains a specific identity. Default value
* denotes that Principal contains one of the groups by
* default supported by all MSPs ("admin" or "member").
*
*
* optional .common.MSPPrincipal.Classification principal_classification = 1;
*/
public Builder clearPrincipalClassification() {
principalClassification_ = 0;
onChanged();
return this;
}
private com.google.protobuf.ByteString principal_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* Principal completes the policy principal definition. For the default
* principal types, Principal can be either "Admin" or "Member".
* For the ByOrganizationUnit/ByIdentity values of Classification,
* PolicyPrincipal acquires its value from an organization unit or
* identity, respectively.
*
*
* optional bytes principal = 2;
*/
public com.google.protobuf.ByteString getPrincipal() {
return principal_;
}
/**
*
* Principal completes the policy principal definition. For the default
* principal types, Principal can be either "Admin" or "Member".
* For the ByOrganizationUnit/ByIdentity values of Classification,
* PolicyPrincipal acquires its value from an organization unit or
* identity, respectively.
*
*
* optional bytes principal = 2;
*/
public Builder setPrincipal(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
principal_ = value;
onChanged();
return this;
}
/**
*
* Principal completes the policy principal definition. For the default
* principal types, Principal can be either "Admin" or "Member".
* For the ByOrganizationUnit/ByIdentity values of Classification,
* PolicyPrincipal acquires its value from an organization unit or
* identity, respectively.
*
*
* optional bytes principal = 2;
*/
public Builder clearPrincipal() {
principal_ = getDefaultInstance().getPrincipal();
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:common.MSPPrincipal)
}
// @@protoc_insertion_point(class_scope:common.MSPPrincipal)
private static final org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal();
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public MSPPrincipal parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MSPPrincipal(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface OrganizationUnitOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.OrganizationUnit)
com.google.protobuf.MessageOrBuilder {
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
java.lang.String getMspIdentifier();
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
com.google.protobuf.ByteString
getMspIdentifierBytes();
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
java.lang.String getOrganizationalUnitIdentifier();
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
com.google.protobuf.ByteString
getOrganizationalUnitIdentifierBytes();
/**
*
* CertifiersIdentifier is the hash of certificates chain of trust
* related to this organizational unit
*
*
* optional bytes certifiers_identifier = 3;
*/
com.google.protobuf.ByteString getCertifiersIdentifier();
}
/**
*
* OrganizationUnit governs the organization of the Principal
* field of a policy principal when a specific organization unity members
* are to be defined within a policy principal.
*
*
* Protobuf type {@code common.OrganizationUnit}
*/
public static final class OrganizationUnit extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.OrganizationUnit)
OrganizationUnitOrBuilder {
// Use OrganizationUnit.newBuilder() to construct.
private OrganizationUnit(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private OrganizationUnit() {
mspIdentifier_ = "";
organizationalUnitIdentifier_ = "";
certifiersIdentifier_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private OrganizationUnit(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
mspIdentifier_ = s;
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
organizationalUnitIdentifier_ = s;
break;
}
case 26: {
certifiersIdentifier_ = input.readBytes();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_OrganizationUnit_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_OrganizationUnit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit.class, org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit.Builder.class);
}
public static final int MSP_IDENTIFIER_FIELD_NUMBER = 1;
private volatile java.lang.Object mspIdentifier_;
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
public java.lang.String getMspIdentifier() {
java.lang.Object ref = mspIdentifier_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
mspIdentifier_ = s;
return s;
}
}
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
public com.google.protobuf.ByteString
getMspIdentifierBytes() {
java.lang.Object ref = mspIdentifier_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
mspIdentifier_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ORGANIZATIONAL_UNIT_IDENTIFIER_FIELD_NUMBER = 2;
private volatile java.lang.Object organizationalUnitIdentifier_;
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
public java.lang.String getOrganizationalUnitIdentifier() {
java.lang.Object ref = organizationalUnitIdentifier_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
organizationalUnitIdentifier_ = s;
return s;
}
}
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
public com.google.protobuf.ByteString
getOrganizationalUnitIdentifierBytes() {
java.lang.Object ref = organizationalUnitIdentifier_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
organizationalUnitIdentifier_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CERTIFIERS_IDENTIFIER_FIELD_NUMBER = 3;
private com.google.protobuf.ByteString certifiersIdentifier_;
/**
*
* CertifiersIdentifier is the hash of certificates chain of trust
* related to this organizational unit
*
*
* optional bytes certifiers_identifier = 3;
*/
public com.google.protobuf.ByteString getCertifiersIdentifier() {
return certifiersIdentifier_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getMspIdentifierBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mspIdentifier_);
}
if (!getOrganizationalUnitIdentifierBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, organizationalUnitIdentifier_);
}
if (!certifiersIdentifier_.isEmpty()) {
output.writeBytes(3, certifiersIdentifier_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getMspIdentifierBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mspIdentifier_);
}
if (!getOrganizationalUnitIdentifierBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, organizationalUnitIdentifier_);
}
if (!certifiersIdentifier_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, certifiersIdentifier_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit other = (org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit) obj;
boolean result = true;
result = result && getMspIdentifier()
.equals(other.getMspIdentifier());
result = result && getOrganizationalUnitIdentifier()
.equals(other.getOrganizationalUnitIdentifier());
result = result && getCertifiersIdentifier()
.equals(other.getCertifiersIdentifier());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
hash = (37 * hash) + MSP_IDENTIFIER_FIELD_NUMBER;
hash = (53 * hash) + getMspIdentifier().hashCode();
hash = (37 * hash) + ORGANIZATIONAL_UNIT_IDENTIFIER_FIELD_NUMBER;
hash = (53 * hash) + getOrganizationalUnitIdentifier().hashCode();
hash = (37 * hash) + CERTIFIERS_IDENTIFIER_FIELD_NUMBER;
hash = (53 * hash) + getCertifiersIdentifier().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* OrganizationUnit governs the organization of the Principal
* field of a policy principal when a specific organization unity members
* are to be defined within a policy principal.
*
*
* Protobuf type {@code common.OrganizationUnit}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.OrganizationUnit)
org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnitOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_OrganizationUnit_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_OrganizationUnit_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit.class, org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
mspIdentifier_ = "";
organizationalUnitIdentifier_ = "";
certifiersIdentifier_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_OrganizationUnit_descriptor;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit.getDefaultInstance();
}
public org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit build() {
org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit buildPartial() {
org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit result = new org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit(this);
result.mspIdentifier_ = mspIdentifier_;
result.organizationalUnitIdentifier_ = organizationalUnitIdentifier_;
result.certifiersIdentifier_ = certifiersIdentifier_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit) {
return mergeFrom((org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit other) {
if (other == org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit.getDefaultInstance()) return this;
if (!other.getMspIdentifier().isEmpty()) {
mspIdentifier_ = other.mspIdentifier_;
onChanged();
}
if (!other.getOrganizationalUnitIdentifier().isEmpty()) {
organizationalUnitIdentifier_ = other.organizationalUnitIdentifier_;
onChanged();
}
if (other.getCertifiersIdentifier() != com.google.protobuf.ByteString.EMPTY) {
setCertifiersIdentifier(other.getCertifiersIdentifier());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object mspIdentifier_ = "";
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
public java.lang.String getMspIdentifier() {
java.lang.Object ref = mspIdentifier_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
mspIdentifier_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
public com.google.protobuf.ByteString
getMspIdentifierBytes() {
java.lang.Object ref = mspIdentifier_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
mspIdentifier_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
public Builder setMspIdentifier(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
mspIdentifier_ = value;
onChanged();
return this;
}
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
public Builder clearMspIdentifier() {
mspIdentifier_ = getDefaultInstance().getMspIdentifier();
onChanged();
return this;
}
/**
*
* MSPIdentifier represents the identifier of the MSP this organization unit
* refers to
*
*
* optional string msp_identifier = 1;
*/
public Builder setMspIdentifierBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
mspIdentifier_ = value;
onChanged();
return this;
}
private java.lang.Object organizationalUnitIdentifier_ = "";
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
public java.lang.String getOrganizationalUnitIdentifier() {
java.lang.Object ref = organizationalUnitIdentifier_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
organizationalUnitIdentifier_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
public com.google.protobuf.ByteString
getOrganizationalUnitIdentifierBytes() {
java.lang.Object ref = organizationalUnitIdentifier_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
organizationalUnitIdentifier_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
public Builder setOrganizationalUnitIdentifier(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
organizationalUnitIdentifier_ = value;
onChanged();
return this;
}
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
public Builder clearOrganizationalUnitIdentifier() {
organizationalUnitIdentifier_ = getDefaultInstance().getOrganizationalUnitIdentifier();
onChanged();
return this;
}
/**
*
* OrganizationUnitIdentifier defines the organizational unit under the
* MSP identified with MSPIdentifier
*
*
* optional string organizational_unit_identifier = 2;
*/
public Builder setOrganizationalUnitIdentifierBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
organizationalUnitIdentifier_ = value;
onChanged();
return this;
}
private com.google.protobuf.ByteString certifiersIdentifier_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* CertifiersIdentifier is the hash of certificates chain of trust
* related to this organizational unit
*
*
* optional bytes certifiers_identifier = 3;
*/
public com.google.protobuf.ByteString getCertifiersIdentifier() {
return certifiersIdentifier_;
}
/**
*
* CertifiersIdentifier is the hash of certificates chain of trust
* related to this organizational unit
*
*
* optional bytes certifiers_identifier = 3;
*/
public Builder setCertifiersIdentifier(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
certifiersIdentifier_ = value;
onChanged();
return this;
}
/**
*
* CertifiersIdentifier is the hash of certificates chain of trust
* related to this organizational unit
*
*
* optional bytes certifiers_identifier = 3;
*/
public Builder clearCertifiersIdentifier() {
certifiersIdentifier_ = getDefaultInstance().getCertifiersIdentifier();
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:common.OrganizationUnit)
}
// @@protoc_insertion_point(class_scope:common.OrganizationUnit)
private static final org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit();
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public OrganizationUnit parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new OrganizationUnit(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.OrganizationUnit getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface MSPRoleOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.MSPRole)
com.google.protobuf.MessageOrBuilder {
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
java.lang.String getMspIdentifier();
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
com.google.protobuf.ByteString
getMspIdentifierBytes();
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
int getRoleValue();
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType getRole();
}
/**
*
* MSPRole governs the organization of the Principal
* field of an MSPPrincipal when it aims to define one of the
* two dedicated roles within an MSP: Admin and Members.
*
*
* Protobuf type {@code common.MSPRole}
*/
public static final class MSPRole extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.MSPRole)
MSPRoleOrBuilder {
// Use MSPRole.newBuilder() to construct.
private MSPRole(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private MSPRole() {
mspIdentifier_ = "";
role_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private MSPRole(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
mspIdentifier_ = s;
break;
}
case 16: {
int rawValue = input.readEnum();
role_ = rawValue;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPRole_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPRole_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.class, org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.Builder.class);
}
/**
* Protobuf enum {@code common.MSPRole.MSPRoleType}
*/
public enum MSPRoleType
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Represents an MSP Member
*
*
* MEMBER = 0;
*/
MEMBER(0),
/**
*
* Represents an MSP Admin
*
*
* ADMIN = 1;
*/
ADMIN(1),
/**
*
* Represents an MSP Client
*
*
* CLIENT = 2;
*/
CLIENT(2),
/**
*
* Represents an MSP Peer
*
*
* PEER = 3;
*/
PEER(3),
UNRECOGNIZED(-1),
;
/**
*
* Represents an MSP Member
*
*
* MEMBER = 0;
*/
public static final int MEMBER_VALUE = 0;
/**
*
* Represents an MSP Admin
*
*
* ADMIN = 1;
*/
public static final int ADMIN_VALUE = 1;
/**
*
* Represents an MSP Client
*
*
* CLIENT = 2;
*/
public static final int CLIENT_VALUE = 2;
/**
*
* Represents an MSP Peer
*
*
* PEER = 3;
*/
public static final int PEER_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static MSPRoleType valueOf(int value) {
return forNumber(value);
}
public static MSPRoleType forNumber(int value) {
switch (value) {
case 0: return MEMBER;
case 1: return ADMIN;
case 2: return CLIENT;
case 3: return PEER;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
MSPRoleType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public MSPRoleType findValueByNumber(int number) {
return MSPRoleType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.getDescriptor().getEnumTypes().get(0);
}
private static final MSPRoleType[] VALUES = values();
public static MSPRoleType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private MSPRoleType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:common.MSPRole.MSPRoleType)
}
public static final int MSP_IDENTIFIER_FIELD_NUMBER = 1;
private volatile java.lang.Object mspIdentifier_;
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
public java.lang.String getMspIdentifier() {
java.lang.Object ref = mspIdentifier_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
mspIdentifier_ = s;
return s;
}
}
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
public com.google.protobuf.ByteString
getMspIdentifierBytes() {
java.lang.Object ref = mspIdentifier_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
mspIdentifier_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ROLE_FIELD_NUMBER = 2;
private int role_;
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
public int getRoleValue() {
return role_;
}
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType getRole() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType result = org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType.valueOf(role_);
return result == null ? org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getMspIdentifierBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mspIdentifier_);
}
if (role_ != org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType.MEMBER.getNumber()) {
output.writeEnum(2, role_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getMspIdentifierBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mspIdentifier_);
}
if (role_ != org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType.MEMBER.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, role_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole other = (org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole) obj;
boolean result = true;
result = result && getMspIdentifier()
.equals(other.getMspIdentifier());
result = result && role_ == other.role_;
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
hash = (37 * hash) + MSP_IDENTIFIER_FIELD_NUMBER;
hash = (53 * hash) + getMspIdentifier().hashCode();
hash = (37 * hash) + ROLE_FIELD_NUMBER;
hash = (53 * hash) + role_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* MSPRole governs the organization of the Principal
* field of an MSPPrincipal when it aims to define one of the
* two dedicated roles within an MSP: Admin and Members.
*
*
* Protobuf type {@code common.MSPRole}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.MSPRole)
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRoleOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPRole_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPRole_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.class, org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
mspIdentifier_ = "";
role_ = 0;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.MspPrincipal.internal_static_common_MSPRole_descriptor;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.getDefaultInstance();
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole build() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole buildPartial() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole result = new org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole(this);
result.mspIdentifier_ = mspIdentifier_;
result.role_ = role_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole) {
return mergeFrom((org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole other) {
if (other == org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.getDefaultInstance()) return this;
if (!other.getMspIdentifier().isEmpty()) {
mspIdentifier_ = other.mspIdentifier_;
onChanged();
}
if (other.role_ != 0) {
setRoleValue(other.getRoleValue());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object mspIdentifier_ = "";
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
public java.lang.String getMspIdentifier() {
java.lang.Object ref = mspIdentifier_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
mspIdentifier_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
public com.google.protobuf.ByteString
getMspIdentifierBytes() {
java.lang.Object ref = mspIdentifier_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
mspIdentifier_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
public Builder setMspIdentifier(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
mspIdentifier_ = value;
onChanged();
return this;
}
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
public Builder clearMspIdentifier() {
mspIdentifier_ = getDefaultInstance().getMspIdentifier();
onChanged();
return this;
}
/**
*
* MSPIdentifier represents the identifier of the MSP this principal
* refers to
*
*
* optional string msp_identifier = 1;
*/
public Builder setMspIdentifierBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
mspIdentifier_ = value;
onChanged();
return this;
}
private int role_ = 0;
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
public int getRoleValue() {
return role_;
}
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
public Builder setRoleValue(int value) {
role_ = value;
onChanged();
return this;
}
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType getRole() {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType result = org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType.valueOf(role_);
return result == null ? org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType.UNRECOGNIZED : result;
}
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
public Builder setRole(org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole.MSPRoleType value) {
if (value == null) {
throw new NullPointerException();
}
role_ = value.getNumber();
onChanged();
return this;
}
/**
*
* MSPRoleType defines which of the available, pre-defined MSP-roles
* an identiy should posess inside the MSP with identifier MSPidentifier
*
*
* optional .common.MSPRole.MSPRoleType role = 2;
*/
public Builder clearRole() {
role_ = 0;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:common.MSPRole)
}
// @@protoc_insertion_point(class_scope:common.MSPRole)
private static final org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole();
}
public static org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public MSPRole parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MSPRole(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPRole getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_MSPPrincipal_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_MSPPrincipal_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_OrganizationUnit_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_OrganizationUnit_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_MSPRole_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_MSPRole_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\027msp/msp_principal.proto\022\006common\"\251\001\n\014MS" +
"PPrincipal\022E\n\030principal_classification\030\001" +
" \001(\0162#.common.MSPPrincipal.Classificatio" +
"n\022\021\n\tprincipal\030\002 \001(\014\"?\n\016Classification\022\010" +
"\n\004ROLE\020\000\022\025\n\021ORGANIZATION_UNIT\020\001\022\014\n\010IDENT" +
"ITY\020\002\"q\n\020OrganizationUnit\022\026\n\016msp_identif" +
"ier\030\001 \001(\t\022&\n\036organizational_unit_identif" +
"ier\030\002 \001(\t\022\035\n\025certifiers_identifier\030\003 \001(\014" +
"\"\210\001\n\007MSPRole\022\026\n\016msp_identifier\030\001 \001(\t\022)\n\004" +
"role\030\002 \001(\0162\033.common.MSPRole.MSPRoleType\"",
":\n\013MSPRoleType\022\n\n\006MEMBER\020\000\022\t\n\005ADMIN\020\001\022\n\n" +
"\006CLIENT\020\002\022\010\n\004PEER\020\003BP\n$org.hyperledger.f" +
"abric.protos.commonZ(github.com/hyperled" +
"ger/fabric/protos/mspb\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
internal_static_common_MSPPrincipal_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_common_MSPPrincipal_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_MSPPrincipal_descriptor,
new java.lang.String[] { "PrincipalClassification", "Principal", });
internal_static_common_OrganizationUnit_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_common_OrganizationUnit_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_OrganizationUnit_descriptor,
new java.lang.String[] { "MspIdentifier", "OrganizationalUnitIdentifier", "CertifiersIdentifier", });
internal_static_common_MSPRole_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_common_MSPRole_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_MSPRole_descriptor,
new java.lang.String[] { "MspIdentifier", "Role", });
}
// @@protoc_insertion_point(outer_class_scope)
}