From 76b190b742de76cbc149f02d009f20bdf4b8c4d3 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Fri, 3 Aug 2018 22:47:15 +0100 Subject: [PATCH] upsert and delete events --- .../com/muwire/core/search/DeleteEvent.groovy | 16 ++++++++++++++++ .../com/muwire/core/search/UpsertEvent.groovy | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 core/src/main/groovy/com/muwire/core/search/DeleteEvent.groovy create mode 100644 core/src/main/groovy/com/muwire/core/search/UpsertEvent.groovy diff --git a/core/src/main/groovy/com/muwire/core/search/DeleteEvent.groovy b/core/src/main/groovy/com/muwire/core/search/DeleteEvent.groovy new file mode 100644 index 00000000..34edc59e --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/search/DeleteEvent.groovy @@ -0,0 +1,16 @@ +package com.muwire.core.search + +import com.muwire.core.Event + +import net.i2p.data.Base32 +import net.i2p.data.Destination + +class DeleteEvent extends Event { + byte [] infoHash + Destination leaf + + @Override + public String toString() { + "DeleteEvent ${super.toString()} infoHash:${Base32.encode(infoHash)} leaf:${leaf.toBase32()}" + } +} diff --git a/core/src/main/groovy/com/muwire/core/search/UpsertEvent.groovy b/core/src/main/groovy/com/muwire/core/search/UpsertEvent.groovy new file mode 100644 index 00000000..3594ce2e --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/search/UpsertEvent.groovy @@ -0,0 +1,18 @@ +package com.muwire.core.search + +import com.muwire.core.Event + +import net.i2p.data.Base32 +import net.i2p.data.Destination + +class UpsertEvent extends Event { + + List names + byte [] infoHash + Destination leaf + + @Override + public String toString() { + "UpsertEvent ${super.toString()} names:$names infoHash:${Base32.encode(infoHash)} leaf:${leaf.toBase32()}" + } +}