diff --git a/core/src/main/groovy/com/muwire/core/Event.groovy b/core/src/main/groovy/com/muwire/core/Event.groovy new file mode 100644 index 00000000..4a9c0e94 --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/Event.groovy @@ -0,0 +1,15 @@ +package com.muwire.core + +import java.util.concurrent.atomic.AtomicLong + +class Event { + + private static final AtomicLong SEQ_NO = new AtomicLong(); + final long seqNo + final long timestamp + + Event() { + seqNo = SEQ_NO.getAndIncrement() + timestamp = System.currentTimeMillis() + } +} diff --git a/core/src/main/groovy/com/muwire/core/files/FileHashedEvent.groovy b/core/src/main/groovy/com/muwire/core/files/FileHashedEvent.groovy new file mode 100644 index 00000000..57d46237 --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/files/FileHashedEvent.groovy @@ -0,0 +1,8 @@ +package com.muwire.core.files + +import com.muwire.core.Event + +class FileHashedEvent extends Event { + + def sharedFile +} diff --git a/core/src/main/groovy/com/muwire/core/files/FileSharedEvent.groovy b/core/src/main/groovy/com/muwire/core/files/FileSharedEvent.groovy new file mode 100644 index 00000000..e26e81bc --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/files/FileSharedEvent.groovy @@ -0,0 +1,8 @@ +package com.muwire.core.files + +import com.muwire.core.Event + +class FileSharedEvent extends Event { + + File file +} diff --git a/core/src/main/groovy/com/muwire/core/files/HasherService.groovy b/core/src/main/groovy/com/muwire/core/files/HasherService.groovy new file mode 100644 index 00000000..04fc9910 --- /dev/null +++ b/core/src/main/groovy/com/muwire/core/files/HasherService.groovy @@ -0,0 +1,5 @@ +package com.muwire.core.files + +class HasherService { + +}