Events and skeleton of hashing service
This commit is contained in:
15
core/src/main/groovy/com/muwire/core/Event.groovy
Normal file
15
core/src/main/groovy/com/muwire/core/Event.groovy
Normal 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()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.muwire.core.files
|
||||||
|
|
||||||
|
import com.muwire.core.Event
|
||||||
|
|
||||||
|
class FileHashedEvent extends Event {
|
||||||
|
|
||||||
|
def sharedFile
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.muwire.core.files
|
||||||
|
|
||||||
|
import com.muwire.core.Event
|
||||||
|
|
||||||
|
class FileSharedEvent extends Event {
|
||||||
|
|
||||||
|
File file
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.muwire.core.files
|
||||||
|
|
||||||
|
class HasherService {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user