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.profiler;
18  
19  import org.apache.jetspeed.om.profile.*;
20  import org.apache.jetspeed.capability.CapabilityMap;
21  import org.apache.turbine.services.Service;
22  import org.apache.turbine.util.RunData;
23  import org.apache.turbine.util.DynamicURI;
24  import org.apache.jetspeed.util.MimeType;
25  import java.util.Iterator;
26  
27  /***
28   * <P>This interface is a facade for all profile related operations</P>
29   *
30   * @see org.apache.jetspeed.om.profile.Profile
31   * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
32   * @author <a href="mailto:morciuch@apache.org">Mark Orciuch</a>
33   * @version $Id: ProfilerService.java,v 1.18 2004/02/23 03:35:24 jford Exp $
34   */
35  
36  public interface ProfilerService extends Service
37  {
38  
39      /*** The name of this service */
40      public String SERVICE_NAME = "Profiler";
41  
42      /***
43       *  get the Profile object using the Rundata state and capability map
44       * this is the mapping functionality of the profiler
45       *
46       * @param rundata The rundata object for the current request.
47       * @param cm  The device capability map.
48       * @return A Profile object if found by the manager or null.
49       */
50      public Profile getProfile(RunData rundata, CapabilityMap cm)
51          throws ProfileException;
52  
53      /***
54       * get the Profile object using the Rundata state and capability map
55       * this is the mapping functionality of the profiler
56       *
57       * @param rundata The rundata object for the current request.
58       * @return A new Profile object.
59       */
60      public Profile getProfile(RunData rundata)
61                  throws ProfileException;
62  
63      /***
64       * get the Profile object using the Rundata state and capability map
65       * this is the mapping functionality of the profiler
66       *
67       * @deprecated Do not use a profiler method based on MimeType
68       * @param rundata the rundata object for the current request
69       * @return a new Profile object
70       */
71      public Profile getProfile(RunData data, MimeType mt)
72          throws ProfileException;
73  
74      /***
75       *  get the Profile object using a profile locator
76       *
77       * @param locator The locator containing criteria describing the profile.
78       * @return a new Profile object
79       */
80      public Profile getProfile(ProfileLocator locator)
81          throws ProfileException;
82  
83      /***
84       * Creates a dynamic URI
85       *
86       * @param rundata the rundata object for the current request
87       * @param locator The description of the profile.
88       * @return A new dynamic URI representing all profile parameters from the locator.
89       */
90      public DynamicURI makeDynamicURI( RunData data, ProfileLocator locator )
91          throws ProfileException;
92  
93      /***
94       * Creates a new Profile object that can be successfully managed by
95       * the current Profiler implementation
96       *
97       * @return A new Profile object
98       */
99      public Profile createProfile();
100 
101     /***
102      * Creates a new Profile object for a specific locator.
103      *
104      * @param locator The description of the profile.
105      * @return A new Profile object
106      */
107     public Profile createProfile(ProfileLocator locator);
108 
109     /***
110      * Creates a new ProfileLocator object that can be successfully managed by
111      * the current Profiler implementation
112      *
113      * @return A new ProfileLocator object
114      */
115     public ProfileLocator createLocator();
116 
117     /***
118      * Create a new profile. The profile parameter's document will be cloned.
119      *
120      * @param rundata The rundata object for the current request.
121      * @param profile The description of the new profile to be created.
122      * @return The newly created profile.
123      */
124     public Profile createProfile( RunData data, Profile profile )
125         throws ProfileException;
126 
127     /*** Create a new profile.
128      *
129      * @param rundata The rundata object for the current request.
130      * @param profile The description of the new profile to be created.
131      * @param mt The specific mime type, which is converted to a mediatype.
132      * @return The newly created profile.
133      */
134     public Profile createProfile( RunData data, Profile profile, MimeType mt )
135         throws ProfileException;
136 
137     /*** Create a new profile.
138      *
139      * @param locator The description of the new profile to be created.
140      * @param portlets The PSML tree
141      */
142     public Profile createProfile(ProfileLocator locator, Portlets portlets)
143         throws ProfileException;
144 
145    /***
146      *  Removes a profile.
147      *
148      * @param locator The profile locator criteria.
149      */
150     public void removeProfile( ProfileLocator locator )
151         throws ProfileException;
152 
153     /*** Query for a collection of profiles given a profile locator criteria.
154      *
155      * @param locator The profile locator criteria.
156      * @return The list of profiles matching the locator criteria.
157      */
158     public Iterator query( QueryLocator locator );
159 
160     /***
161      * Returns status of role profile merging feature
162      *
163      * @return True if role profile merging is active
164      */
165     public boolean useRoleProfileMerging();
166 
167 }