View Javadoc

1   /*
2   * Licensed to the Apache Software Foundation (ASF) under one or more
3   * contributor license agreements.  See the NOTICE file distributed with
4   * this work for additional information regarding copyright ownership.
5   * The ASF licenses this file to You under the Apache License, Version 2.0
6   * (the "License"); you may not use this file except in compliance with
7   * the License.  You may obtain a copy of the License at
8   *
9   *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17  /*
18   * Created on Jan 11, 2005
19   *
20   * TODO To change the template for this generated file go to
21   * Window - Preferences - Java - Code Generation - Code and Comments
22   */
23  package org.apache.jetspeed.aggregator;
24  
25  import java.io.PrintWriter;
26  
27  import org.apache.jetspeed.cache.ContentCacheKey;
28  
29  /***
30   * <p>
31   * PortletContent
32   * </p>
33   * <p>
34   *
35   * </p>
36   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
37   * @author <a href="mailto:taylor@apache.org">David S. Taylor</a>  
38   * @version $Id: PortletContent.java 554756 2007-07-09 20:33:26Z ate $
39   *
40   */
41  public interface PortletContent
42  {
43      /***
44       * Retrieve the actual content of a portlet as a string
45       * 
46       * @return
47       */
48      String getContent();
49      
50      /*** 
51       * Has the renderer completed rendering the content?
52       * 
53       * @return
54       */
55      boolean isComplete();
56      
57      /***
58       * Notify that this content is completed.
59       *
60       */
61      void complete();
62      
63      /***
64       * Notify that this content is complete with error
65       *
66       */
67      void completeWithError();
68      
69      /***
70       * Get a writer to the content to stream content into this object
71       * @return
72       */
73      PrintWriter getWriter();
74      
75      /***
76       * Get the expiration setting for this content if it is cached.
77       * @return
78       */
79      int getExpiration();
80      void setExpiration(int expiration);
81      
82      /***
83       * Get the cache key used to cache this content
84       * @since 2.1.2 
85       * @return
86       */
87      ContentCacheKey getCacheKey();
88      
89      /***
90       * Get the title of the portlet, used during caching
91       * 
92       * @return
93       */
94      String getTitle();
95      
96      /***
97       * Set the title of this portlet, used during caching
98       * @param title
99       */
100     void setTitle(String title);
101         
102 }