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  /* 
18  
19   */
20  
21  package org.apache.wsrp4j.consumer;
22  
23  import oasis.names.tc.wsrp.v1.types.PortletContext;
24  
25  /**
26   * Defines a consumer-side representation of a remote portlet.
27   * A portlet is uniquely identified by its portlet key.
28   * Consumer configured portlets are the result of clone operations on
29   * existing portlets (parents).
30   * 
31   * @author Stephan Laertz 
32   **/
33  public interface WSRPPortlet {
34  
35      /**
36       * Get the portlet key of the portlet. The key can be used to reference
37       * to the portlet.
38       * 
39       * @return a portlet key object
40       **/
41      public PortletKey getPortletKey();
42  
43      /**
44       * Set the portlet key of the portlet.
45       * 
46       * @param portletKey The portlet key of the portlet
47       **/
48      public void setPortletKey(PortletKey portletKey);
49  
50      /**
51       * Get the portlet context object which contains information about
52       * the portlet state.
53       * 
54       * @return the portlet context object of the portlet.
55       **/
56      public PortletContext getPortletContext();
57  
58      /**
59       * Set the portlet context of the portlet.
60       * 
61       * @param portletContext The portlet context of the portlet
62       **/
63      public void setPortletContext(PortletContext portletContext);
64  
65      /**
66       * Checks if a portlet is consumer configured portlet.
67       * 
68       * @return True if the result <code>getParent()</code> is not equal 
69       *         to the portlet handle of the portlet key.
70       **/
71      public boolean isConsumerConfigured();
72  
73      /**
74       * Get the portlet handle of the parent portlet. If the portlet
75       * is not a consumer configured portlet the handle returned by this method
76       * should be the same as the handle in the portlet key returned 
77       * by <code>getPortletKey</code>.
78       * 
79       * @return the portlet handle of the parent portlet.
80       **/
81      public String getParent();
82  
83      /**
84       * Set the portlet handle of the parent portlet. If the supplied 
85       * handle is not equal to the handle in the portlet key returned by 
86       * <code>getPortletKey</code> this method makes the portlet a 
87       * consumer configured portlet.
88       * 
89       * @param portletHandle the portlet handle of the parent portlet
90       **/
91      public void setParent(String portletHandle);
92  }