1   /*
2    * Copyright 2000-2001,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.wsrp4j.consumer;
18  
19  import oasis.names.tc.wsrp.v1.types.ClientData;
20  
21  /**
22   * The <code>WSRPRequest</code> is the base interface for all
23   * requests to a consumer side invocation of a integrated remote portlet.
24   * Specialized interfaces exist for markup and action calls. 
25   * 
26   * @see MarkupRequest
27   * @see InteractionRequest
28   * 
29   **/
30  public interface WSRPBaseRequest {
31      /**
32       * Get the ID of the session context 
33       *  
34       * @return The session context
35       **/
36      public String getSessionID();
37  
38      /**
39       * Get an opaque string which corresponds to a unique reference to this use of the portlet.
40       * 
41       * @return The portlet instance key
42       **/
43      public String getPortletInstanceKey();
44  
45      /**
46       * Get the current navigational state of the portlet
47       * 
48       * @return The navigational state
49       **/
50      public String getNavigationalState();
51  
52      /**
53       * Get the current window state of the portlet
54       * 
55       * @return The window state
56       **/
57      public String getWindowState();
58  
59      /**
60       * Get the current mode of the portlet
61       * 
62       * @return The mode of the portlet
63       **/
64      public String getMode();
65  
66      /**
67       * Get the <code>ClientData</code> structure which carries
68       * information about the end user agent.
69       * 
70       * @return The <code>ClientData</code> specifying the user agent.
71       **/
72      public ClientData getClientData();
73  
74      /**
75       * Get the locales which are supported by the portlet according to the client connecting to it.
76       * The Locales returned are in the form of (ISO-639 + "-" + ISO-3166)
77       * 
78       * @return Array with string representations of the locales which are
79       * supported by the consumer
80       **/
81      public String[] getLocales();
82  
83      /**
84       * Get the list of wsrp modes which are supported by the portlet.
85       * This should returned the list of all actuall supported modes and
86       * not necessarily the modes returned in the portlet description of the producer. 
87       * 
88       * @return Array with string representations of the portlet modes
89       * supported by the portlet or null
90       **/
91      public String[] getModes();
92  
93      /**
94       * Get the list of wsrp window states which are supported by the portlet.
95       * This should returned the list of all actuall supported window states and
96       * not necessarily the window states returned in the portlet description of the producer. 
97       * 
98       * @return Array with string representations of the window states
99       * supported by the portlet or null
100      **/
101     public String[] getWindowStates();
102 
103     /**
104      * Get an array of mime types which are supported by the end user device.
105      * The order in the array defines the order of preference of the end user.    
106      * 
107      * @return An array of mimes types the consumer supports or null
108      **/
109     public String[] getMimeTypes();
110 
111     /**
112      * Get the character sets the consumer wants the remote portlet to use for encoding the markup.
113      * Valid character sets are defined <a href='http://www.iana.org/assignments/character-sets'>here</a>
114      * 
115      * @return Array of string representations of the character encoding.
116      **/
117     public String[] getCharacterEncodingSet();
118 
119     /**
120      * Checks wether a given wsrp mode is supported by the portlet.
121      * 
122      * @param wsrpMode The wsrp mode
123      * @return True if the mode is supported by the portlet, false otherwise
124      **/
125     public boolean isModeSupported(String wsrpMode);
126 
127     /**
128      * Checks wether a given wsrp window state is supported by the portlet.
129      * 
130      * @param wsrpWindowState The wsrp window state
131      * @return True if the window state is supported by the portlet, false otherwise
132      **/
133     public boolean isWindowStateSupported(String wsrpWindowState);
134 
135     /**
136      * Get the method which is used by the consumer to authenticate its users.
137      *      
138      * @return String indicating how end-users were authenticated by the consumer.
139      **/
140     public String getUserAuthentication();
141 }