001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /*
018: * Created on Jan 11, 2005
019: *
020: * TODO To change the template for this generated file go to
021: * Window - Preferences - Java - Code Generation - Code and Comments
022: */
023: package org.apache.jetspeed.aggregator;
024:
025: import java.io.PrintWriter;
026:
027: import org.apache.jetspeed.cache.ContentCacheKey;
028:
029: /**
030: * <p>
031: * PortletContent
032: * </p>
033: * <p>
034: *
035: * </p>
036: * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
037: * @author <a href="mailto:taylor@apache.org">David S. Taylor</a>
038: * @version $Id: PortletContent.java 554756 2007-07-09 20:33:26Z ate $
039: *
040: */
041: public interface PortletContent {
042: /**
043: * Retrieve the actual content of a portlet as a string
044: *
045: * @return
046: */
047: String getContent();
048:
049: /**
050: * Has the renderer completed rendering the content?
051: *
052: * @return
053: */
054: boolean isComplete();
055:
056: /**
057: * Notify that this content is completed.
058: *
059: */
060: void complete();
061:
062: /**
063: * Notify that this content is complete with error
064: *
065: */
066: void completeWithError();
067:
068: /**
069: * Get a writer to the content to stream content into this object
070: * @return
071: */
072: PrintWriter getWriter();
073:
074: /**
075: * Get the expiration setting for this content if it is cached.
076: * @return
077: */
078: int getExpiration();
079:
080: void setExpiration(int expiration);
081:
082: /**
083: * Get the cache key used to cache this content
084: * @since 2.1.2
085: * @return
086: */
087: ContentCacheKey getCacheKey();
088:
089: /**
090: * Get the title of the portlet, used during caching
091: *
092: * @return
093: */
094: String getTitle();
095:
096: /**
097: * Set the title of this portlet, used during caching
098: * @param title
099: */
100: void setTitle(String title);
101:
102: }
|