/** * Creates a new HTTP context. * * @param request the HTTP request * @param sessionData the session data extracted from the session cookie * @param flashData the flash data extracted from the flash cookie */ public Context(Long id, play.api.mvc.RequestHeader header, Request request, Map<String,String> sessionData, Map<String,String> flashData, Map<String,Object> args) { this.id = id; this.header = header; this.request = request; this.response = new Response(); this.session = new Session(sessionData); this.flash = new Flash(flashData); this.args = new HashMap<String,Object>(args); }
/** * Creates a new HTTP context. * * @param id the unique context ID * @param header the request header * @param request the request with body * @param sessionData the session data extracted from the session cookie * @param flashData the flash data extracted from the flash cookie * @param args any arbitrary data to associate with this request context. * @param lang the transient lang to use. * @param components the context components. */ public Context(Long id, play.api.mvc.RequestHeader header, Request request, Map<String,String> sessionData, Map<String,String> flashData, Map<String,Object> args, Lang lang, JavaContextComponents components) { this(id, header, request, new Response(), new Session(sessionData), new Flash(flashData), new HashMap<>(args), lang, components); }
/** * Creates a new HTTP context. * * @param id the unique context ID * @param header the request header * @param request the request with body * @param sessionData the session data extracted from the session cookie * @param flashData the flash data extracted from the flash cookie * @param args any arbitrary data to associate with this request context. * @param lang the transient lang to use. * @param components the context components. */ public Context(Long id, play.api.mvc.RequestHeader header, Request request, Map<String,String> sessionData, Map<String,String> flashData, Map<String,Object> args, Lang lang, JavaContextComponents components) { this(id, header, request, new Response(), new Session(sessionData), new Flash(flashData), new HashMap<>(args), lang, components); }
/** * Creates a new HTTP context. * * @param id the unique context ID * @param header the request header * @param request the request with body * @param sessionData the session data extracted from the session cookie * @param flashData the flash data extracted from the flash cookie * @param args any arbitrary data to associate with this request context. * @param lang the transient lang to use. * @param components the context components. */ public Context(Long id, play.api.mvc.RequestHeader header, Request request, Map<String,String> sessionData, Map<String,String> flashData, Map<String,Object> args, Lang lang, JavaContextComponents components) { this(id, header, request, new Response(), new Session(sessionData), new Flash(flashData), new HashMap<>(args), lang, components); }
/** * Creates a new HTTP context. * * @param request the HTTP request * @param components the context components. */ public Context(Request request, JavaContextComponents components) { this.request = request; this.id = this.request.asScala().id(); this.response = new Response(); this.session = new Session(this.request.session()); this.flash = new Flash(this.request.flash()); this.args = new HashMap<>(); this.components = components; }
/** * Creates a new HTTP context. * * @param request the HTTP request */ public Context(Request request) { this.request = request; this.header = request._underlyingHeader(); this.id = header.id(); this.response = new Response(); this.session = new Session(JavaConversions.mapAsJavaMap(header.session().data())); this.flash = new Flash(JavaConversions.mapAsJavaMap(header.flash().data())); this.args = new HashMap<String,Object>(); this.args.putAll(JavaConversions.mapAsJavaMap(header.tags())); }
/** * Creates a new HTTP context. * * @param request the HTTP request * @param components the context components. */ public Context(Request request, JavaContextComponents components) { this.request = request; this.id = this.request.asScala().id(); this.response = new Response(); this.session = new Session(this.request.session()); this.flash = new Flash(this.request.flash()); this.args = new HashMap<>(); this.components = components; }
/** * Creates a new HTTP context. * * @param request the HTTP request * @param components the context components. */ public Context(Request request, JavaContextComponents components) { this.request = request; this.id = this.request.asScala().id(); this.response = new Response(); this.session = new Session(this.request.session()); this.flash = new Flash(this.request.flash()); this.args = new HashMap<>(); this.components = components; }
/** * Sets a new session for this result, discarding the existing session. * * @param session the session to set with this result * @return the new result */ public Result withSession(Map<String, String> session) { return withSession(new Session(session)); }
/** * Sets a new session for this result, discarding the existing session. * * @param session the session to set with this result * @return the new result */ public Result withSession(Map<String, String> session) { return withSession(new Session(session)); }
/** * Sets a new session for this result, discarding the existing session. * * @param session the session to set with this result * @return the new result */ public Result withSession(Map<String, String> session) { return withSession(new Session(session)); }