KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > wsrp > consumer > adapters > WSRPBaseRequestAdapter


1 /*
2 * Copyright 2001-2004 The eXo platform SARL All rights reserved.
3 * Please look at license.txt in info directory for more license detail.
4 */

5
6 package org.exoplatform.services.wsrp.consumer.adapters;
7
8 import org.exoplatform.services.wsrp.consumer.WSRPBaseRequest;
9 import org.exoplatform.services.wsrp.type.ClientData;
10
11 /*
12  * @author Mestrallet Benjamin
13  * benjmestrallet@users.sourceforge.net
14  * Date: 7 févr. 2004
15  * Time: 16:25:12
16  */

17
18 public class WSRPBaseRequestAdapter implements WSRPBaseRequest{
19
20   private String JavaDoc sessionID;
21   private String JavaDoc portletInstanceKey;
22   private String JavaDoc navigationalState;
23   private String JavaDoc windowState;
24   private String JavaDoc mode;
25   private ClientData clientData;
26   private String JavaDoc[] locales;
27   private String JavaDoc[] modes;
28   private String JavaDoc[] windowStates;
29   private String JavaDoc[] mimeTypes;
30   private String JavaDoc[] characterEncodingSet;
31   private String JavaDoc userAuthentication;
32
33   public String JavaDoc getSessionID() {
34     return sessionID;
35   }
36
37   public void setSessionID(String JavaDoc sessionID) {
38     this.sessionID = sessionID;
39   }
40
41   public String JavaDoc getPortletInstanceKey() {
42     return portletInstanceKey;
43   }
44
45   public void setPortletInstanceKey(String JavaDoc portletInstanceKey) {
46     this.portletInstanceKey = portletInstanceKey;
47   }
48
49   public String JavaDoc getNavigationalState() {
50     return navigationalState;
51   }
52
53   public void setNavigationalState(String JavaDoc navigationalState) {
54     this.navigationalState = navigationalState;
55   }
56
57   public String JavaDoc getWindowState() {
58     return windowState;
59   }
60
61   public void setWindowState(String JavaDoc windowState) {
62     this.windowState = windowState;
63   }
64
65   public String JavaDoc getMode() {
66     return mode;
67   }
68
69   public void setMode(String JavaDoc mode) {
70     this.mode = mode;
71   }
72
73   public ClientData getClientData() {
74     return clientData;
75   }
76
77   public void setClientData(ClientData clientData) {
78     this.clientData = clientData;
79   }
80
81   public String JavaDoc[] getLocales() {
82     return locales;
83   }
84
85   public void setLocales(String JavaDoc[] locales) {
86     this.locales = locales;
87   }
88
89   public String JavaDoc[] getModes() {
90     return modes;
91   }
92
93   public void setModes(String JavaDoc[] modes) {
94     this.modes = modes;
95   }
96
97   public String JavaDoc[] getWindowStates() {
98     return windowStates;
99   }
100
101   public void setWindowStates(String JavaDoc[] windowStates) {
102     this.windowStates = windowStates;
103   }
104
105   public String JavaDoc[] getMimeTypes() {
106     return mimeTypes;
107   }
108
109   public void setMimeTypes(String JavaDoc[] mimeTypes) {
110     this.mimeTypes = mimeTypes;
111   }
112
113   public String JavaDoc[] getCharacterEncodingSet() {
114     return characterEncodingSet;
115   }
116
117   public void setCharacterEncodingSet(String JavaDoc[] characterEncodingSet) {
118     this.characterEncodingSet = characterEncodingSet;
119   }
120
121   public String JavaDoc getUserAuthentication() {
122     return userAuthentication;
123   }
124
125   public void setUserAuthentication(String JavaDoc userAuthentication) {
126     this.userAuthentication = userAuthentication;
127   }
128
129   public boolean isModeSupported(String JavaDoc wsrpMode) {
130     if (wsrpMode == null) {
131       throw new IllegalArgumentException JavaDoc("mode must not be null");
132     }
133     String JavaDoc[] mods = getModes();
134     for (int i = 0; i < mods.length; i++) {
135       if (wsrpMode.equalsIgnoreCase(mods[i])) {
136         return true;
137       }
138     }
139     return false;
140   }
141
142   public boolean isWindowStateSupported(String JavaDoc wsrpWindowState) {
143     if (wsrpWindowState == null) {
144       throw new IllegalArgumentException JavaDoc("window state must not be null");
145     }
146     String JavaDoc[] stats = getWindowStates();
147     for (int i = 0; i < stats.length; i++) {
148       if (wsrpWindowState.equalsIgnoreCase(stats[i])) {
149         return true;
150       }
151     }
152     return false;
153   }
154   
155
156
157 }
Popular Tags