All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.core.websocket.WebsocketContext.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






WebsocketContext (org.spincast:spincast-framework 1.0.0 API)












org.spincast.core.websocket

Interface WebsocketContext<W extends WebsocketContext<?>>

  • All Known Subinterfaces:
    DefaultWebsocketContext
    All Known Implementing Classes:
    DefaultWebsocketContextDefault


    public interface WebsocketContext<W extends WebsocketContext<?>>
    The base interface for a WebSocket context. A WebSocket context is the object passed to a WebSocket controller when an event for a particular peer occured. For example when a message is sent from a peer, or if the peer closed the WebSocket connection.
    • Method Detail

      • getEndpointId

        String getEndpointId()
        The id of the endpoint
      • getPeerId

        String getPeerId()
        The id of the peer.
      • sendMessageToCurrentPeer

        void sendMessageToCurrentPeer(String message)
        Sends a String message to the current peer. Same as WebsocketEndpointManager#sendMessage(getPeerId(), message)
      • sendMessageToCurrentPeer

        void sendMessageToCurrentPeer(byte[] message)
        Sends a byte array message to the current peer. Same as WebsocketEndpointManager#sendMessage(getPeerId(), message)
      • closeConnectionWithCurrentPeer

        void closeConnectionWithCurrentPeer()
        Closes the connection with the current peer. Same as WebsocketEndpointManager#closePeer(getPeerId())
      • json

        JsonManager json()
        Easy access to the JsonManager, Json related methods.
      • xml

        XmlManager xml()
        Easy access to the XmlManager, XML related methods.
      • templating

        TemplatingEngine templating()
        Easy access to the TemplatingEngine, templating related methods.
      • guice

        com.google.inject.Injector guice()
        Easy access to the Guice context.
      • get

        <T> T get(Class<T> clazz)
        Shortcut to get an instance from Guice. Will also cache the instance (as long as it is request scoped or a singleton).
      • get

        <T> T get(com.google.inject.Key<T> key)
        Shortcut to get an instance from Guice. Will also cache the instance (as long as it is request scoped or a singleton)
      • getLocaleToUse

        Locale getLocaleToUse()
        The best Locale to use, as resolved by the LocaleResolver during the initial HTTP request.
      • getTimeZoneToUse

        TimeZone getTimeZoneToUse()
        The best TimeZone to use, as resolved by the TimeZoneResolver.

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy