Search in sources :

Example 1 with Listen

use of io.atomix.core.tree.impl.DocumentTreeOperations.Listen in project atomix by atomix.

the class DocumentTreeService method listen.

protected void listen(Commit<? extends Listen> commit) {
    Long sessionId = commit.session().sessionId().id();
    listeners.computeIfAbsent(sessionId, k -> new SessionListenCommits()).add(new Listener(commit.session(), commit.value().path()));
}
Also used : ServiceExecutor(io.atomix.primitive.service.ServiceExecutor) Arrays(java.util.Arrays) DocumentPath(io.atomix.core.tree.DocumentPath) CHANGE(io.atomix.core.tree.impl.DocumentTreeEvents.CHANGE) Kryo(com.esotericsoftware.kryo.Kryo) DocumentTree(io.atomix.core.tree.DocumentTree) Update(io.atomix.core.tree.impl.DocumentTreeOperations.Update) Type(io.atomix.core.tree.DocumentTreeEvent.Type) Status(io.atomix.core.tree.impl.DocumentTreeResult.Status) Map(java.util.Map) Get(io.atomix.core.tree.impl.DocumentTreeOperations.Get) GET(io.atomix.core.tree.impl.DocumentTreeOperations.GET) Session(io.atomix.primitive.session.Session) ADD_LISTENER(io.atomix.core.tree.impl.DocumentTreeOperations.ADD_LISTENER) Set(java.util.Set) Versioned(io.atomix.utils.time.Versioned) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) BufferOutput(io.atomix.storage.buffer.BufferOutput) Match(io.atomix.utils.Match) Queues(com.google.common.collect.Queues) List(java.util.List) Unlisten(io.atomix.core.tree.impl.DocumentTreeOperations.Unlisten) KryoNamespaces(io.atomix.utils.serializer.KryoNamespaces) Optional(java.util.Optional) Queue(java.util.Queue) Serializer(io.atomix.utils.serializer.Serializer) REMOVE_LISTENER(io.atomix.core.tree.impl.DocumentTreeOperations.REMOVE_LISTENER) Output(com.esotericsoftware.kryo.io.Output) BufferInput(io.atomix.storage.buffer.BufferInput) Listen(io.atomix.core.tree.impl.DocumentTreeOperations.Listen) HashMap(java.util.HashMap) EventType(io.atomix.primitive.event.EventType) GET_CHILDREN(io.atomix.core.tree.impl.DocumentTreeOperations.GET_CHILDREN) LinkedHashMap(java.util.LinkedHashMap) Lists(com.google.common.collect.Lists) Input(com.esotericsoftware.kryo.io.Input) UPDATE(io.atomix.core.tree.impl.DocumentTreeOperations.UPDATE) KryoNamespace(io.atomix.utils.serializer.KryoNamespace) Ordering(io.atomix.primitive.Ordering) Iterator(java.util.Iterator) Commit(io.atomix.primitive.service.Commit) Throwables(com.google.common.base.Throwables) GetChildren(io.atomix.core.tree.impl.DocumentTreeOperations.GetChildren) IllegalDocumentModificationException(io.atomix.core.tree.IllegalDocumentModificationException) AtomicLong(java.util.concurrent.atomic.AtomicLong) AbstractPrimitiveService(io.atomix.primitive.service.AbstractPrimitiveService) TreeMap(java.util.TreeMap) CLEAR(io.atomix.core.tree.impl.DocumentTreeOperations.CLEAR) DocumentTreeEvent(io.atomix.core.tree.DocumentTreeEvent) NoSuchDocumentPathException(io.atomix.core.tree.NoSuchDocumentPathException) AtomicLong(java.util.concurrent.atomic.AtomicLong)

Aggregations

Kryo (com.esotericsoftware.kryo.Kryo)1 Input (com.esotericsoftware.kryo.io.Input)1 Output (com.esotericsoftware.kryo.io.Output)1 Throwables (com.google.common.base.Throwables)1 Lists (com.google.common.collect.Lists)1 Queues (com.google.common.collect.Queues)1 Sets (com.google.common.collect.Sets)1 DocumentPath (io.atomix.core.tree.DocumentPath)1 DocumentTree (io.atomix.core.tree.DocumentTree)1 DocumentTreeEvent (io.atomix.core.tree.DocumentTreeEvent)1 Type (io.atomix.core.tree.DocumentTreeEvent.Type)1 IllegalDocumentModificationException (io.atomix.core.tree.IllegalDocumentModificationException)1 NoSuchDocumentPathException (io.atomix.core.tree.NoSuchDocumentPathException)1 CHANGE (io.atomix.core.tree.impl.DocumentTreeEvents.CHANGE)1 ADD_LISTENER (io.atomix.core.tree.impl.DocumentTreeOperations.ADD_LISTENER)1 CLEAR (io.atomix.core.tree.impl.DocumentTreeOperations.CLEAR)1 GET (io.atomix.core.tree.impl.DocumentTreeOperations.GET)1 GET_CHILDREN (io.atomix.core.tree.impl.DocumentTreeOperations.GET_CHILDREN)1 Get (io.atomix.core.tree.impl.DocumentTreeOperations.Get)1 GetChildren (io.atomix.core.tree.impl.DocumentTreeOperations.GetChildren)1