Events and skeleton of hashing service

This commit is contained in:
Zlatin Balevsky
2018-07-19 17:38:48 +01:00
parent 8ab9e50628
commit 410b5ffc9b
4 changed files with 36 additions and 0 deletions

View File

@@ -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()
}
}

View File

@@ -0,0 +1,8 @@
package com.muwire.core.files
import com.muwire.core.Event
class FileHashedEvent extends Event {
def sharedFile
}

View File

@@ -0,0 +1,8 @@
package com.muwire.core.files
import com.muwire.core.Event
class FileSharedEvent extends Event {
File file
}

View File

@@ -0,0 +1,5 @@
package com.muwire.core.files
class HasherService {
}