com.hedera.hapi.block.protoc.PublishStreamEndCode Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: block_service.proto
package com.hedera.hapi.block.protoc;
/**
*
**
* An enumeration indicating why a publisher ended a stream.
* This enumeration describes the reason a block stream
* (sent via `publishBlockStream`) was ended by the publisher.
*
*
* Protobuf enum {@code com.hedera.hapi.block.PublishStreamEndCode}
*/
public enum PublishStreamEndCode
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
**
* An "unset value" flag, this value SHALL NOT be used.<br/>
* This status indicates the server software failed to set a
* status, and SHALL be considered a software defect.
*
*
* STREAM_END_UNKNOWN = 0;
*/
STREAM_END_UNKNOWN(0),
/**
*
**
* The Publisher reached a reset point.<br/>
* No errors occurred and the source node orderly ended the stream.
* Publishers SHOULD use this code to end a stream and restart
* occasionally. Occasionally resetting the stream increases stability and
* allows for routine network configuration changes.
*
*
* STREAM_END_RESET = 1;
*/
STREAM_END_RESET(1),
/**
*
**
* The delay between items was too long.<br/>
* The destination system did not timely acknowledge a block.
* <p>
* The source SHALL start a new stream before the failed block.
*
*
* STREAM_END_TIMEOUT = 2;
*/
STREAM_END_TIMEOUT(2),
/**
*
**
* The publisher encountered an error.<br/>
* The publisher encountered an internal error and must try again later.
* <p>
* Publishers that encounter internal logic errors, find themselves
* "behind" the network, or otherwise detect an unexpected situation MUST
* send this code and restart the stream before the failed block.
*
*
* STREAM_END_ERROR = 3;
*/
STREAM_END_ERROR(3),
/**
*
**
* The block node is too far behind to catch up directly.<br/>
* The block node responded to a block header with "BEHIND" and is
* too far behind the publisher.
* <p>
* The block node MUST recover and "catch up" from another trustworthy
* block node.<br/>
* The publisher MAY stream items to a different block node.<br/>
* The publisher MAY resume streaming to this block node later.<br/>
* The `EndOfStream` message MUST include the earliest and latest blocks
* currently available from the publisher.<br/>
* The block node SHOULD attempt to "catch up" to the _latest_ block
* available from the publisher.
*
*
* STREAM_END_TOO_FAR_BEHIND = 4;
*/
STREAM_END_TOO_FAR_BEHIND(4),
UNRECOGNIZED(-1),
;
/**
*
**
* An "unset value" flag, this value SHALL NOT be used.<br/>
* This status indicates the server software failed to set a
* status, and SHALL be considered a software defect.
*
*
* STREAM_END_UNKNOWN = 0;
*/
public static final int STREAM_END_UNKNOWN_VALUE = 0;
/**
*
**
* The Publisher reached a reset point.<br/>
* No errors occurred and the source node orderly ended the stream.
* Publishers SHOULD use this code to end a stream and restart
* occasionally. Occasionally resetting the stream increases stability and
* allows for routine network configuration changes.
*
*
* STREAM_END_RESET = 1;
*/
public static final int STREAM_END_RESET_VALUE = 1;
/**
*
**
* The delay between items was too long.<br/>
* The destination system did not timely acknowledge a block.
* <p>
* The source SHALL start a new stream before the failed block.
*
*
* STREAM_END_TIMEOUT = 2;
*/
public static final int STREAM_END_TIMEOUT_VALUE = 2;
/**
*
**
* The publisher encountered an error.<br/>
* The publisher encountered an internal error and must try again later.
* <p>
* Publishers that encounter internal logic errors, find themselves
* "behind" the network, or otherwise detect an unexpected situation MUST
* send this code and restart the stream before the failed block.
*
*
* STREAM_END_ERROR = 3;
*/
public static final int STREAM_END_ERROR_VALUE = 3;
/**
*
**
* The block node is too far behind to catch up directly.<br/>
* The block node responded to a block header with "BEHIND" and is
* too far behind the publisher.
* <p>
* The block node MUST recover and "catch up" from another trustworthy
* block node.<br/>
* The publisher MAY stream items to a different block node.<br/>
* The publisher MAY resume streaming to this block node later.<br/>
* The `EndOfStream` message MUST include the earliest and latest blocks
* currently available from the publisher.<br/>
* The block node SHOULD attempt to "catch up" to the _latest_ block
* available from the publisher.
*
*
* STREAM_END_TOO_FAR_BEHIND = 4;
*/
public static final int STREAM_END_TOO_FAR_BEHIND_VALUE = 4;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static PublishStreamEndCode valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static PublishStreamEndCode forNumber(int value) {
switch (value) {
case 0: return STREAM_END_UNKNOWN;
case 1: return STREAM_END_RESET;
case 2: return STREAM_END_TIMEOUT;
case 3: return STREAM_END_ERROR;
case 4: return STREAM_END_TOO_FAR_BEHIND;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
PublishStreamEndCode> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public PublishStreamEndCode findValueByNumber(int number) {
return PublishStreamEndCode.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
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 com.hedera.hapi.block.protoc.BlockService.getDescriptor().getEnumTypes().get(0);
}
private static final PublishStreamEndCode[] VALUES = values();
public static PublishStreamEndCode 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 PublishStreamEndCode(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:com.hedera.hapi.block.PublishStreamEndCode)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy