001 package org.springframework.richclient.application.session;
002
003 import java.util.Map;
004 import java.util.List;
005
006
007 public class ApplicationSessionInitializer
008 {
009
010 /**
011 * Extra user attributes to be added to the ApplicationSession after login
012 */
013 private Map<String, Object> userAttributes;
014
015 /**
016 * Extra session attributes to be added to the ApplicationSession after login
017 */
018 private Map<String, Object> sessionAttributes;
019
020 /**
021 * List of command ids to be executed before startup of the application window
022 */
023 private List<String> preStartupCommandIds;
024
025 /**
026 * List of command ids to be executed after startup of the application window
027 */
028 private List<String> postStartupCommandIds;
029
030 /**
031 * Sets extra user attributes to be added to the ApplicationSession after login
032 */
033 public void setUserAttributes(Map<String, Object> attributes)
034 {
035 this.userAttributes = attributes;
036 }
037
038 /**
039 * @return extra user attributes to be added to the ApplicationSession after login
040 */
041 public Map<String, Object> getUserAttributes()
042 {
043 return userAttributes;
044 }
045
046 /**
047 * Sets extra session attributes to be added to the ApplicationSession after login
048 */
049 public void setSessionAttributes(Map<String, Object> attributes)
050 {
051 this.sessionAttributes = attributes;
052 }
053
054 /**
055 * @return extra session attributes to be added to the ApplicationSession after login
056 */
057 public Map<String, Object> getSessionAttributes()
058 {
059 return sessionAttributes;
060 }
061
062 /**
063 * Sets the list of command ids to be executed before startup of the application window
064 */
065 public void setPreStartupCommandIds(List<String> commandIds)
066 {
067 this.preStartupCommandIds = commandIds;
068 }
069
070 /**
071 * @return the list of command ids to be executed before startup of the application window
072 */
073 public List<String> getPreStartupCommandIds()
074 {
075 return preStartupCommandIds;
076 }
077
078 /**
079 * Sets the list of command ids to be executed after startup of the application window
080 */
081 public void setPostStartupCommandIds(List<String> commandIds)
082 {
083 this.postStartupCommandIds = commandIds;
084 }
085
086 /**
087 * @return the list of command ids to be executed after startup of the application window
088 */
089 public List<String> getPostStartupCommandIds()
090 {
091 return postStartupCommandIds;
092 }
093
094 /**
095 * Hook that is called before the session attributes are retrieved. Here you can
096 * set session attributes in code.
097 */
098 public void initializeSession()
099 {
100 }
101
102 /**
103 * Hook that is called before the user attributes are retrieved. Here you can
104 * set user attributes in code.
105 */
106 public void initializeUser()
107 {
108 }
109 }