public static ManageStatus getNewStatus(ManageStatus oldStatus,
            Boolean acceptPublish,
            Boolean acceptSubscribe) {
        if (acceptPublish == null && acceptSubscribe == null) {
            return oldStatus;
        }
        boolean newPublish = oldStatus.isAcceptPublish;
        boolean newSubscribe = oldStatus.isAcceptSubscribe;
        if (acceptPublish != null) {
            newPublish = acceptPublish;
        }
        if (acceptSubscribe != null) {
            newSubscribe = acceptSubscribe;
        }
        if (newPublish) {
            if (newSubscribe) {
                return ManageStatus.STATUS_MANAGE_ONLINE;
            } else {
                return ManageStatus.STATUS_MANAGE_ONLINE_NOT_READ;
            }
        } else {
            if (newSubscribe) {
                return ManageStatus.STATUS_MANAGE_ONLINE_NOT_WRITE;
            } else {
                return ManageStatus.STATUS_MANAGE_OFFLINE;
            }
        }
    }
Change broker read write status

@param oldStatus        current broker manage status
@param acceptPublish    current broker reported publish status
@param acceptSubscribe  current broker reported subscribe status
@return   current broker's new manage status
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/statusdef/ManageStatus.java