Class MCRAbstractEndpoint

java.lang.Object
org.mycore.frontend.ws.endoint.MCRAbstractEndpoint
Direct Known Subclasses:
MCRProcessingEndpoint, MCRWebCLIResourceSockets

public abstract class MCRAbstractEndpoint extends Object
Starting class for all mycore websocket endpoints.
Author:
Michel Buechner (mcrmibue), Matthias Eichner
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    activate(jakarta.websocket.Session session)
    Retrieves the mycore session id from the websocket session and binds the current thread with this mycore session.
    protected void
    passivate(jakarta.websocket.Session session)
    Releases the mycore session from this thread.
    protected void
    sessionized(jakarta.websocket.Session session, Runnable runnable)
    Encapsulates a function with a mycore session.
    protected <T> T
    sessionized(jakarta.websocket.Session session, Supplier<T> supplier)
    Encapsulates a supplier with a mycore session.

    Methods inherited from class java.lang.Object

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

    • MCRAbstractEndpoint

      public MCRAbstractEndpoint()
  • Method Details

    • sessionized

      protected <T> T sessionized(jakarta.websocket.Session session, Supplier<T> supplier)
      Encapsulates a supplier with a mycore session.
      Parameters:
      session - the websocket session
      supplier - the supplier
      Returns:
      the result of the supplier
    • sessionized

      protected void sessionized(jakarta.websocket.Session session, Runnable runnable)
      Encapsulates a function with a mycore session.
      Parameters:
      session - the websocket session
      runnable - the runnable
    • activate

      protected void activate(jakarta.websocket.Session session)
      Retrieves the mycore session id from the websocket session and binds the current thread with this mycore session.
      Parameters:
      session - the websocket session
    • passivate

      protected void passivate(jakarta.websocket.Session session)
      Releases the mycore session from this thread.
      Parameters:
      session - the websocket session