View Javadoc

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.jetspeed.services.persistence;
18  
19  import java.util.List;
20  
21  import org.apache.jetspeed.om.profile.Profile;
22  import org.apache.jetspeed.portal.*;
23  import org.apache.jetspeed.portal.Portlet;
24  import org.apache.jetspeed.portal.PortletException;
25  import org.apache.turbine.services.Service;
26  import org.apache.turbine.util.RunData;
27  
28  /***
29   * Defines the interface to the Portal Persistence Service for storing and
30   * retrieving portlet instances.
31   *
32   * @author <a href="mailto:sweaver@rippe.com">Scott Weaver</a>
33   * @version $Id: PortalPersistenceService.java,v 1.3 2004/02/23 03:33:52 jford Exp $
34   */
35  public interface PortalPersistenceService extends Service
36  {
37      String SERVICE_NAME = "PortalPersistenceService";
38  
39      /***
40       * Store a portlet instance to permenant storage.
41       *
42       * @param instance The portlet instance to be stored.
43       * @exception PortalPersistenceException if there were problems
44       * storing the PSMLDocument to persistent storage.
45       * 
46       */
47      void store(PortletInstance instance) throws PortalPersistenceException;
48  
49      /***
50       * Retrieves a portlet instance from persistent storage for the given portlet.
51       *
52       * @param portlet The portlet to retrieve an instance for
53       * @param data Request rundata.
54       * @return PortletInstance The instance for the given portlet.
55       */
56      PortletInstance getInstance(Portlet portlet, RunData data);
57  
58      /***
59       * Retrieves a PersistentPortlet instance for this portlet.
60       *
61       * @param portlet The portlet to retrieve an instance for
62       * @param profile Retrieve instance from this profile.
63       * @return PortletInstance The instance for the given portlet.     
64       */
65      PortletInstance getInstance(Portlet portlet, Profile profile);
66  
67      /***
68       * Retrieves a List of portlet instances for the current profile.
69       *
70       * @param data Request rundata.
71       * @return List The list of all instances in current profile.
72       */
73      List getInstances(RunData data) throws PortletException;
74  
75      /***
76       * Retrieves a List of portlet instances for the given profile.
77       *
78       * @param profile Retrieve instances from this profile.
79       * @return List The list of all instances in current profile.
80       */
81      List getInstances(Profile profile) throws PortletException;
82  
83  }