Class RLJsonSession<T extends RLJsonSession>

java.lang.Object
org.nustaq.kontraktor.Actors
org.nustaq.kontraktor.Actor<T>
org.nustaq.kontraktor.services.rlserver.RLJsonSession<T>
All Implemented Interfaces:
Serializable, Executor, org.nustaq.kontraktor.monitoring.Monitorable, org.nustaq.kontraktor.remoting.base.RemotedActor

public class RLJsonSession<T extends RLJsonSession> extends org.nustaq.kontraktor.Actor<T> implements org.nustaq.kontraktor.remoting.base.RemotedActor
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.nustaq.kontraktor.Actor

    org.nustaq.kontraktor.Actor.ActorReport
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected DataClient
     
    protected int
     
    protected static AtomicInteger
     
    static int
     
    static int
     
    protected RLJsonServer
     
     

    Fields inherited from class org.nustaq.kontraktor.Actor

    __cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallback

    Fields inherited from class org.nustaq.kontraktor.Actors

    CONT, DEFAULT_TIMOUT, defaultScheduler, delayedCalls, exec, instance, MAX_EXTERNAL_THREADS_POOL_SIZE, version
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    _internalUpdate(org.nustaq.reallive.api.RealLiveTable tbl, org.nustaq.reallive.api.Record newRecord)
    processes special ops like { "array+" : value } and _NULL_
    org.nustaq.kontraktor.IPromise<Long>
    bulkUpdate(String table, String json)
    process a series of add/update operations.
    org.nustaq.kontraktor.IPromise
    delete(String table, String key)
     
    void
    deleteAsync(String table, String key)
     
    org.nustaq.kontraktor.IPromise<Set<String>>
     
    protected com.eclipsesource.json.JsonObject
    fromChange(org.nustaq.reallive.api.ChangeMessage change)
     
    protected com.eclipsesource.json.JsonObject
    fromRecord(org.nustaq.reallive.api.Record r)
     
    org.nustaq.kontraktor.IPromise<String>
    get(String table, String key)
     
    org.nustaq.kontraktor.IPromise<Integer>
     
    void
    hasBeenPublished(String connectionIdentifier)
     
    void
    hasBeenUnpublished(String connectionIdentifier)
     
    void
    init(RLJsonServer server, DataClient dataClient, Object userdata)
     
    void
    select(String table, String query, org.nustaq.kontraktor.Callback<String> res)
     
    void
    selectHashed(String table, String indexPath2hashKeyJson, String query, org.nustaq.kontraktor.Callback<String> res)
     
    void
    subscribe(String uuid, String table, String query, org.nustaq.kontraktor.Callback<String> res)
     
    org.nustaq.kontraktor.IPromise<Long>
    subscribeSyncing(String uuid, String table, long timeStamp, String query, org.nustaq.kontraktor.Callback<String> res)
     
    protected org.nustaq.reallive.api.Record
    toRecord(com.eclipsesource.json.JsonObject members)
     
    void
     
    org.nustaq.kontraktor.IPromise
    update(String table, String json)
     
    void
    updateAsync(String table, String json)
     

    Methods inherited from class org.nustaq.kontraktor.Actor

    __addDeadLetter, __addRemoteConnection, __addStopHandler, __dispatchRemoteCall, __enqueueCall, __getCachedMethod, __removeRemoteConnection, __stop, __stopImpl, __submit, ask, askMsg, asyncstop, checkThread, close, closeCurrentClient, current, cyclic, debounce, delayed, execInThreadPool, execute, getActor, getActorRef, getCallbackSize, getConnections, getCurrentDispatcher, getFactory, getMailboxSize, getQSizes, getReport, getScheduler, getSubMonitorables, getUntypedRef, hasStopped, inside, inThread, isCallbackQPressured, isEmpty, isMailboxPressured, isProxy, isPublished, isRemote, isStopped, ping, router$clientPing, self, serialOn, setServerMsgCallback, stop, stopSafeClose, tell, tellMsg, unpublish, zzkrouterLostClient, zzRoutingRefGC

    Methods inherited from class org.nustaq.kontraktor.Actors

    AddDeadLetter, all, all, all, allMapped, AsActor, AsActor, AsActor, AsActor, AsUntypedActor, awaitAll, awaitAll, awaitAll, awaitAll, complete, complete, DeadLetters, flow, InThread, isComplete, isCont, isError, isErrorOrComplete, isResult, isTimeout, kYield, kYield, promise, race, race, reject, resolve, resolve, stream, SubmitDelayed, yieldCallbacks

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • senderIdRangeStart

      public static int senderIdRangeStart
    • senderIdRangeEnd

      public static int senderIdRangeEnd
    • senderIdCount

      protected static AtomicInteger senderIdCount
    • server

      protected RLJsonServer server
    • dClient

      protected DataClient dClient
    • senderId

      protected int senderId
    • subscriptions

      protected Map<String,JsonSubsEntry<String>> subscriptions
  • Constructor Details

    • RLJsonSession

      public RLJsonSession()
  • Method Details

    • init

      public void init(RLJsonServer server, DataClient dataClient, Object userdata)
    • getSenderId

      public org.nustaq.kontraktor.IPromise<Integer> getSenderId()
    • update

      public org.nustaq.kontraktor.IPromise update(String table, String json)
    • updateAsync

      public void updateAsync(String table, String json)
    • delete

      public org.nustaq.kontraktor.IPromise delete(String table, String key)
    • fieldsOf

      public org.nustaq.kontraktor.IPromise<Set<String>> fieldsOf(String table)
    • get

      public org.nustaq.kontraktor.IPromise<String> get(String table, String key)
    • selectHashed

      public void selectHashed(String table, String indexPath2hashKeyJson, String query, org.nustaq.kontraktor.Callback<String> res)
    • select

      public void select(String table, String query, org.nustaq.kontraktor.Callback<String> res)
    • unsubscribe

      public void unsubscribe(String uuid)
    • subscribe

      public void subscribe(String uuid, String table, String query, org.nustaq.kontraktor.Callback<String> res)
    • subscribeSyncing

      public org.nustaq.kontraktor.IPromise<Long> subscribeSyncing(String uuid, String table, long timeStamp, String query, org.nustaq.kontraktor.Callback<String> res)
    • fromChange

      protected com.eclipsesource.json.JsonObject fromChange(org.nustaq.reallive.api.ChangeMessage change)
    • deleteAsync

      public void deleteAsync(String table, String key)
    • bulkUpdate

      public org.nustaq.kontraktor.IPromise<Long> bulkUpdate(String table, String json)
      process a series of add/update operations. Input is a map<recordkey,list. Atomic Array Ops can be done like { "array+" : value } - add value to existing array { "array-" : value } - remove all equal values from existing array { "array?+" : value } - add only if value does not yet exist (set-like behaviour) _NULL_ - can be used to denote null values (real null will be evicted by json )
      Parameters:
      table -
      json - - [ addOrUpdate, .. ]
      Returns:
    • _internalUpdate

      protected void _internalUpdate(org.nustaq.reallive.api.RealLiveTable tbl, org.nustaq.reallive.api.Record newRecord)
      processes special ops like { "array+" : value } and _NULL_
      Parameters:
      tbl -
      newRecord -
    • fromRecord

      protected com.eclipsesource.json.JsonObject fromRecord(org.nustaq.reallive.api.Record r)
    • toRecord

      protected org.nustaq.reallive.api.Record toRecord(com.eclipsesource.json.JsonObject members)
    • hasBeenUnpublished

      public void hasBeenUnpublished(String connectionIdentifier)
      Specified by:
      hasBeenUnpublished in interface org.nustaq.kontraktor.remoting.base.RemotedActor
    • hasBeenPublished

      public void hasBeenPublished(String connectionIdentifier)
      Specified by:
      hasBeenPublished in interface org.nustaq.kontraktor.remoting.base.RemotedActor