public class DevicePersistentUserFactory extends Object implements UserFactory
Modifier and Type | Class and Description |
---|---|
protected static class |
DevicePersistentUserFactory.DeviceCredentials
Struct object holding login info for a device user.
|
Constructor and Description |
---|
DevicePersistentUserFactory(String device)
JSON-driven constructor.
|
Modifier and Type | Method and Description |
---|---|
protected DevicePersistentUserFactory.DeviceCredentials |
extractCredentials(Trace appTrace,
JSONObject param)
Extract the user login credentials from a user factory parameter object.
|
String |
getDevice()
Obtain the name of the device this factory works with.
|
void |
provideUser(Contextor contextor,
Connection connection,
JSONObject param,
ArgRunnable handler)
Produce a user object.
|
@JSONMethod(value="device") public DevicePersistentUserFactory(String device)
device
- The name of the device (IOS, etc).public String getDevice()
public void provideUser(Contextor contextor, Connection connection, JSONObject param, ArgRunnable handler)
provideUser
in interface UserFactory
contextor
- The contextor of the server in which the requested
user will be presentconnection
- The connection over which the new user presented
themself.param
- Arbitary JSON object parameterizing the construction.
this is analogous to the user record read from the ODB, but may be
anything that makes sense for the particular factory implementation.
Of course, the sender of this parameter must be coordinated with the
factory implementation.handler
- Handler to be called with the result. The result will
be the user object that was produced, or null if none could be.protected DevicePersistentUserFactory.DeviceCredentials extractCredentials(Trace appTrace, JSONObject param)
appTrace
- Trace object for error loggingparam
- User factory parametersCopyright © 2017. All rights reserved.