Package org.vrspace.server.core
Class DefaultClientFactory
java.lang.Object
org.vrspace.server.core.DefaultClientFactory
- All Implemented Interfaces:
ClientFactory
-
Field Summary
Fields inherited from interface org.vrspace.server.core.ClientFactory
CLIENT_ID_ATTRIBUTE, CLIENT_NAME_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Client>
TcreateGuestClient
(Class<T> clientClass, org.springframework.http.HttpHeaders headers, Map<String, Object> attributes) Returns new client.<T extends Client>
TfindClient
(Class<T> clientClass, Principal principal, VRObjectRepository db, org.springframework.http.HttpHeaders headers, Map<String, Object> attributes) Returns client existing in the database, identified by "local-user-name" attribute value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.vrspace.server.core.ClientFactory
clientNameAttribute, handleUnknownClient
-
Constructor Details
-
DefaultClientFactory
public DefaultClientFactory()
-
-
Method Details
-
createGuestClient
public <T extends Client> T createGuestClient(Class<T> clientClass, org.springframework.http.HttpHeaders headers, Map<String, Object> attributes) Returns new client.- Specified by:
createGuestClient
in interfaceClientFactory
- Parameters:
clientClass
- class implementing the client, typically Userheaders
- all HTTP headersattributes
- session attributes copied from HttpSession- Returns:
- new Client instance, null by default
-
findClient
public <T extends Client> T findClient(Class<T> clientClass, Principal principal, VRObjectRepository db, org.springframework.http.HttpHeaders headers, Map<String, Object> attributes) Returns client existing in the database, identified by "local-user-name" attribute value.- Specified by:
findClient
in interfaceClientFactory
- Parameters:
clientClass
- class implementing the client, typically Userprincipal
- security principal of the clientdb
- database repositoryheaders
- all HTTP headersattributes
- session attributes copied from HttpSession- Returns:
- a client found in the database or elsewhere
-