01: package org.vraptor;
02:
03: import javax.servlet.ServletContext;
04: import javax.servlet.http.HttpServletRequest;
05: import javax.servlet.http.HttpServletResponse;
06:
07: import org.vraptor.scope.Context;
08: import org.vraptor.scope.FlashContext;
09: import org.vraptor.scope.RequestContext;
10: import org.vraptor.scope.SessionContext;
11: import org.vraptor.url.RequestInfo;
12:
13: /**
14: * An interface to extract from the url which action and component should be
15: * called and contains a logic request information.
16: *
17: * @author Guilherme Silveira
18: */
19: public interface LogicRequest {
20:
21: HttpServletRequest getRequest();
22:
23: HttpServletResponse getResponse();
24:
25: ServletContext getServletContext();
26:
27: RequestInfo getRequestInfo();
28:
29: /**
30: * Returns a wrapper for the application context
31: *
32: * @return the context
33: */
34: Context getApplicationContext();
35:
36: /**
37: * Returns a wrapper for the user session
38: *
39: * @return the context
40: */
41: SessionContext getSessionContext();
42:
43: /**
44: * Returns a wrapper for the request session
45: *
46: * @return the context
47: */
48: RequestContext getRequestContext();
49:
50: /**
51: * Looks for an attribute in any scope.
52: *
53: * @param key
54: * the key to look for
55: * @return the object or null if not found
56: */
57: Object findAttribute(String key);
58:
59: /**
60: * Sets the String that will represent the logic result, like success,
61: * invalid, error and so on
62: *
63: * @param string
64: * @throws IllegalStateException
65: * if this value was already set
66: *
67: */
68: void confirmResult(String string);
69:
70: /**
71: * Returns the current value set as the logic result
72: *
73: * @return the result for now, null if it was not set yet
74: */
75: String getResult();
76:
77: LogicDefinition getLogicDefinition();
78:
79: void setLogicDefinition(LogicDefinition definition);
80:
81: FlashContext getFlashContext();
82:
83: }
|