Class/Object

org.sackfix.session

SfSessionImpl

Related Docs: object SfSessionImpl | package session

Permalink

class SfSessionImpl extends SfSession

Created by Jonathan in 2016.

If you want an easy life, just use the companion object and create the session and a file based message store for the sequence numbers, with a simple session Id. If you want a more complicated life then copy the apply function to your own code and set it up yourself.

You should set the PersistentStore asap, and, from your implementation, as you read initial values call back into the session to set the values.

Linear Supertypes
SfSession, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SfSessionImpl
  2. SfSession
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SfSessionImpl(sessionType: SfSessionType, messageStoreDetails: Option[SfMessageStore], sessionActor: SfSessionActorOutActions, sessionId: SfSessionId, heartbeatIntervalSecs: Int, latencyRecorder: Option[ActorRef] = None, sessionMessageTypes: HashSet[String] = SfSession.SessionMessageTypes)

    Permalink

    sessionMessageTypes

    A set of the types which are considered to be admin session level messages and so do not need to be persisted and stored for replay.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def close: Unit

    Permalink

    Close the persistent store and record the time the session closed.

    Close the persistent store and record the time the session closed. If it is opened tomorrow then sequence numbers reset down to 1

    Definition Classes
    SfSessionImplSfSession
  7. def compIdsCorrect(header: SfMessageHeader): Boolean

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def fireEventToStateMachine(ev: SfSessionEvent): Unit

    Permalink
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def getExpectedTheirSeqNum: Int

    Permalink

    Deals with close from the previous day and the fact this process was not restarted ie will reset the sequence numbers back to 1

    Deals with close from the previous day and the fact this process was not restarted ie will reset the sequence numbers back to 1

    Definition Classes
    SfSessionImplSfSession
  14. def getMessageFixStrFromStore(seqNo: Int): Option[String]

    Permalink
  15. def handleAction(action: SfAction): Unit

    Permalink

    Called back from the state machine when an action should be taken - either a reply message or close the socket etc.

    Called back from the state machine when an action should be taken - either a reply message or close the socket etc.

    action

    The action

    Definition Classes
    SfSessionImplSfSession
  16. def handleMessage(incomingMessage: SfMessage): Unit

    Permalink

    A fix message has arrived.

    A fix message has arrived. Yippee (I guess)

    incomingMessage

    The incoming message

    Definition Classes
    SfSessionImplSfSession
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. val heartbeatIntervalSecs: Int

    Permalink
    Definition Classes
    SfSession
  19. val idStr: String

    Permalink
    Definition Classes
    SfSession
  20. def incrementMySeq: Int

    Permalink

    returns

    Returns the last sequence number, but internally does a +1.

    Definition Classes
    SfSessionImplSfSession
  21. def incrementTheirSeq: Int

    Permalink

    returns

    Returns the last sequence number, but internally does a +1.

    Definition Classes
    SfSessionImplSfSession
  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. def isMessageFixSessionMessage(msgType: String): Boolean

    Permalink
    Definition Classes
    SfSession
  24. def isSessionOpen: Boolean

    Permalink
  25. val latencyRecorder: Option[ActorRef]

    Permalink
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def openStore(readInitialSequenceNumbers: Boolean): Unit

    Permalink

    When a client connects, and established the socket then we should read in the details from file.

    When a client connects, and established the socket then we should read in the details from file. Note that now we have index files as well this could be quite slow - implementation dependency within your store

  30. var persistentStore: Option[SfMessageStore]

    Permalink
  31. def replaceHeaderOnResend(fixStr: String): Option[SfMessage]

    Permalink
  32. def replayMessages(beginSeqNum: Int, endSeqNum: Int): Unit

    Permalink

    Try to retrieve all the fix messages from the store, or if there are gaps then send a gap fill instead.

    Try to retrieve all the fix messages from the store, or if there are gaps then send a gap fill instead. Note that its generally stupid to resent admin messages....up to you if you stick them in your message store or not.

    beginSeqNum

    The first one to send back

    endSeqNum

    The last one to send back

    Definition Classes
    SfSessionImplSfSession
  33. def resetSeqNums: Unit

    Permalink

    If the first session of the day then reset to 1.

    If the first session of the day then reset to 1.

    Definition Classes
    SfSessionImplSfSession
  34. def sendAMessage(msgBody: SfFixMessageBody, correlationId: String = ""): Unit

    Permalink

    Generates the full SfMessage which can then be sent over the wire Also store the message in the message store - but NOT admin messages.

    Generates the full SfMessage which can then be sent over the wire Also store the message in the message store - but NOT admin messages.

    returns

    The generate SfMessage containing the correct sequence numbers and comp id, and also the fixString which represents the fix message

    Definition Classes
    SfSessionImplSfSession
  35. def sendRejectMessage(refSeqNum: Int, incSeqNum: Boolean, reason: SessionRejectReasonField, explanation: TextField): Unit

    Permalink
    Definition Classes
    SfSessionImplSfSession
  36. val sessionId: SfSessionId

    Permalink
    Definition Classes
    SfSession
  37. val sessionMessageTypes: HashSet[String]

    Permalink

    A set of the types which are considered to be admin session level messages and so do not need to be persisted and stored for replay.

    A set of the types which are considered to be admin session level messages and so do not need to be persisted and stored for replay.

    Definition Classes
    SfSessionImplSfSession
  38. val sessionType: SfSessionType

    Permalink
    Definition Classes
    SfSession
  39. def setMySeq(resetTo: Int): Int

    Permalink
    Definition Classes
    SfSessionImplSfSession
  40. def setTheirSeq(resetTo: Int): Int

    Permalink
    Definition Classes
    SfSessionImplSfSession
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from SfSession

Inherited from AnyRef

Inherited from Any

Ungrouped