org.elkoserver.server.context.users
Class DeviceEphemeralUserFactory

java.lang.Object
  extended by org.elkoserver.server.context.users.DevicePersistentUserFactory
      extended by org.elkoserver.server.context.users.DeviceEphemeralUserFactory
All Implemented Interfaces:
UserFactory

public class DeviceEphemeralUserFactory
extends DevicePersistentUserFactory

Factory that generates a non-persistent user object from connected mobile device information.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.elkoserver.server.context.users.DevicePersistentUserFactory
DevicePersistentUserFactory.DeviceCredentials
 
Constructor Summary
DeviceEphemeralUserFactory(String device)
          JSON-driven constructor.
 
Method Summary
 void provideUser(Contextor contextor, Connection connnection, JSONObject param, ArgRunnable handler)
          Synthesize an ephemeral user object based on user description info fetched from the Device.
 
Methods inherited from class org.elkoserver.server.context.users.DevicePersistentUserFactory
extractCredentials, getDevice
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceEphemeralUserFactory

@JSONMethod(value="device")
public DeviceEphemeralUserFactory(String device)
JSON-driven constructor.

Parameters:
device - The name of the device (IOS, etc).
Method Detail

provideUser

public void provideUser(Contextor contextor,
                        Connection connnection,
                        JSONObject param,
                        ArgRunnable handler)
Synthesize an ephemeral user object based on user description info fetched from the Device.

Specified by:
provideUser in interface UserFactory
Overrides:
provideUser in class DevicePersistentUserFactory
Parameters:
contextor - The contextor of the server in which the synthetic user will be present
connection - The connection over which the new user presented themself.
param - Arbitary JSON object parameterizing the construction.
handler - Handler to invoke with the resulting user object, or with null if the user object could not be produced.