Interface ClientFactory

    • Method Detail

      • findClient

        <T extends Client> T findClient​(Class<T> clientClass,
                                        Principal principal,
                                        VRObjectRepository db,
                                        org.springframework.http.HttpHeaders headers,
                                        Map<String,​Object> attributes)
        Find an authorised known client, called only if security principal is known.
        Parameters:
        clientClass - class implementing the client, typically User
        principal - security principal of the client
        db - database repository
        headers - all HTTP headers
        attributes - session attributes copied from HttpSession
        Returns:
        a client found in the database or elsewhere
      • createGuestClient

        default <T extends Client> T createGuestClient​(Class<T> clientClass,
                                                       org.springframework.http.HttpHeaders headers,
                                                       Map<String,​Object> attributes)
        Create a new guest client, called only if server configuration allows for anonymous guest clients, and client name (security principal) is unknown. Default implementation does not create a client.
        Parameters:
        clientClass - class implementing the client, typically User
        headers - all HTTP headers
        attributes - session attributes copied from HttpSession
        Returns:
        new Client instance, null by default
      • handleUnknownClient

        default <T extends Client> T handleUnknownClient​(Class<T> clientClass,
                                                         org.springframework.http.HttpHeaders headers,
                                                         Map<String,​Object> attributes)
        Called if guest clients are not allowed, and user name (security principal) is unknown. Implementation may yet return a client based on headers available. Default implementation returns null.
        Parameters:
        clientClass - class implementing the client, typically User
        headers - all HTTP headers
        attributes - session attributes copied from HttpSession
        Returns:
        a Client determined by headers, null by default
      • clientAttribute

        default String clientAttribute()
        Identifies client attribute name, used as key to store client name in session attributes. Default is "local-user-name".
        Returns: