01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ElementResultStateSession.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine;
09:
10: import java.io.Serializable;
11: import java.util.Map;
12:
13: class ElementResultStateSession implements ElementResultState,
14: Serializable {
15: private static final long serialVersionUID = 8239885817838567612L;
16:
17: private String mContextId;
18: private String mContinuationId;
19: private Map<String, String[]> mPreservedInputs;
20:
21: public ElementResultStateSession(String contextId) {
22: mContextId = contextId;
23: }
24:
25: public void populate(ElementResultState other) {
26: this .mContextId = other.getContextId();
27: this .mContinuationId = other.getContinuationId();
28: this .mPreservedInputs = other.getPreservedInputs();
29: }
30:
31: public String getContextId() {
32: return mContextId;
33: }
34:
35: public void setContinuationId(String continuationId) {
36: mContinuationId = continuationId;
37: }
38:
39: public String getContinuationId() {
40: return mContinuationId;
41: }
42:
43: public void setPreservedInputs(Map<String, String[]> inputs) {
44: if (inputs != null) {
45: if (inputs.containsKey(ReservedParameters.CONTID)) {
46: String[] contid = inputs
47: .remove(ReservedParameters.CONTID);
48: if (contid.length > 0) {
49: setContinuationId(contid[0]);
50: }
51: }
52: }
53:
54: mPreservedInputs = inputs;
55: }
56:
57: public Map<String, String[]> getPreservedInputs() {
58: return mPreservedInputs;
59: }
60: }
|