From 23e45a2843225640616da160d53e6cf0cbe69ca3 Mon Sep 17 00:00:00 2001 From: HenrikJannsen Date: Wed, 4 Jan 2023 18:23:26 -0500 Subject: [PATCH] Add GetDataResponsePriority enum Add default getGetDataResponsePriority impl. to NetworkPayload Signed-off-by: HenrikJannsen --- .../network/GetDataResponsePriority.java | 27 +++++++++++++++++++ .../common/proto/network/NetworkPayload.java | 3 +++ 2 files changed, 30 insertions(+) create mode 100644 common/src/main/java/bisq/common/proto/network/GetDataResponsePriority.java diff --git a/common/src/main/java/bisq/common/proto/network/GetDataResponsePriority.java b/common/src/main/java/bisq/common/proto/network/GetDataResponsePriority.java new file mode 100644 index 0000000000..13e9548f83 --- /dev/null +++ b/common/src/main/java/bisq/common/proto/network/GetDataResponsePriority.java @@ -0,0 +1,27 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.common.proto.network; + +/** + * Represents priority used at truncating data set at getDataResponse if total data exceeds limits. + */ +public enum GetDataResponsePriority { + LOW, + MID, + HIGH +} diff --git a/common/src/main/java/bisq/common/proto/network/NetworkPayload.java b/common/src/main/java/bisq/common/proto/network/NetworkPayload.java index 65169c40d4..7aa0eff43b 100644 --- a/common/src/main/java/bisq/common/proto/network/NetworkPayload.java +++ b/common/src/main/java/bisq/common/proto/network/NetworkPayload.java @@ -23,4 +23,7 @@ import bisq.common.Payload; * Interface for objects used inside WireEnvelope or other WirePayloads. */ public interface NetworkPayload extends Payload { + default GetDataResponsePriority getGetDataResponsePriority() { + return GetDataResponsePriority.LOW; + } }