Package org.vrspace.server.core
Class DefaultClientFactory
- java.lang.Object
-
- org.vrspace.server.core.DefaultClientFactory
-
- All Implemented Interfaces:
ClientFactory
@Component public class DefaultClientFactory extends Object implements ClientFactory
-
-
Field Summary
-
Fields inherited from interface org.vrspace.server.core.ClientFactory
CLIENT_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description DefaultClientFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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
clientAttribute, handleUnknownClient
-
-
-
-
Method Detail
-
createGuestClient
public <T extends Client> T createGuestClient(Class<T> clientClass, org.springframework.http.HttpHeaders headers, Map<String,Object> attributes)
Returns new client.- Specified by:
createGuestClientin 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:
findClientin 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
-
-