Class Client

  • Direct Known Subclasses:
    RemoteServer, User

    @Node
    public class Client
    extends VRObject
    Basic client class, adds user-related properties and business logic to VRObject.
    Author:
    joe
    • Constructor Detail

      • Client

        public Client()
      • Client

        public Client​(Long id)
      • Client

        public Client​(String name)
      • Client

        public Client​(org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator session)
    • Method Detail

      • processEvent

        public void processEvent​(VREvent event)
        Process an event received from other active objects, typically other users. This implementation serializes the event and sends it over websocket.
        Overrides:
        processEvent in class VRObject
        Parameters:
        event - Whatever has changed
      • sendMessage

        public void sendMessage​(Object obj)
      • getToken

        public String getToken​(String serviceId)
        Returns token for a given service
      • setToken

        public void setToken​(String serviceId,
                             String value)
        Set token for a given service
      • clearToken

        public String clearToken​(String serviceId)
        Remove token for a given service
      • createScene

        public void createScene​(WorldManager wm)
        Create client's scene, called by WorldManager during login process. Default client doesn't have a scene.
      • getName

        public String getName()
        Client name - unique ID.
      • getUserHeight

        public Double getUserHeight()
        User's height in real life, used in VR. Transient biometric data.
      • getScene

        public Scene getScene()
        Scene contains all object that a client tracks, e.g. user sees.
      • getIdentity

        public String getIdentity()
        Identity is a big unknown yet, will likely get encapsulated in a class. For the time being, it's something like username@oauth2provider, e.g. joe@facebook
      • getTokens

        public Map<String,​String> getTokens()
        Tokens used to access video/audio streaming servers, identify conversations with chatbots etc.
      • getWriteBack

        public WriteBack getWriteBack()
        Write-back cache to persist changes to all properties.
      • getSession

        public org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator getSession()
        Web socket.
      • getMapper

        public com.fasterxml.jackson.databind.ObjectMapper getMapper()
        Mapper for publicly visible properties
      • getPrivateMapper

        public com.fasterxml.jackson.databind.ObjectMapper getPrivateMapper()
        Private mapper even serializes private fields (so that client can receive own secrets)
      • isGuest

        public boolean isGuest()
        guest flag hints SceneManager to remove all created/owned object when client disconnects
      • setName

        public void setName​(String name)
        Client name - unique ID.
      • setUserHeight

        public void setUserHeight​(Double userHeight)
        User's height in real life, used in VR. Transient biometric data.
      • setSceneProperties

        public void setSceneProperties​(SceneProperties sceneProperties)
      • setScene

        public void setScene​(Scene scene)
        Scene contains all object that a client tracks, e.g. user sees.
      • setIdentity

        public void setIdentity​(String identity)
        Identity is a big unknown yet, will likely get encapsulated in a class. For the time being, it's something like username@oauth2provider, e.g. joe@facebook
      • setTokens

        public void setTokens​(Map<String,​String> tokens)
        Tokens used to access video/audio streaming servers, identify conversations with chatbots etc.
      • setWriteBack

        public void setWriteBack​(WriteBack writeBack)
        Write-back cache to persist changes to all properties.
      • setSession

        public void setSession​(org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator session)
        Web socket.
      • setMapper

        public void setMapper​(com.fasterxml.jackson.databind.ObjectMapper mapper)
        Mapper for publicly visible properties
      • setPrivateMapper

        public void setPrivateMapper​(com.fasterxml.jackson.databind.ObjectMapper privateMapper)
        Private mapper even serializes private fields (so that client can receive own secrets)
      • setGuest

        public void setGuest​(boolean guest)
        guest flag hints SceneManager to remove all created/owned object when client disconnects