org.elkoserver.server.context
Interface EphemeralUserFactory
public interface EphemeralUserFactory
Interface implemented by objects that can synthesize ephemeral User objects
on demand. Such factory objects are typically singletons stored in the
contextor's static object table. These factories are used in conjuction
with the user synthesis entry pattern provided by the Session object's
extercontext() method. This interface is synchronous, and so is intended to
be used when the user can be fabricated entirely from parameter informatio
in a non-blocking fashion.
- See Also:
UserFactory
provideUser
User provideUser(Contextor contextor,
Connection connection,
JSONObject param,
String contextRef,
String contextTemplate)
- Synthesize a user object.
- Parameters:
contextor - The contextor of the server in which the synthetic
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.contextRef - Ref of context the new synthesized user will be
placed intocontextTemplate - Ref of the context template for the context
- Returns:
- a synthesized User object constructed according the the logic of
the factory and the contents of the param parameter, or null if no
such User object could be produced.