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 at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.psmlmanager;
1819import java.util.Iterator;
20import java.util.List;
21import org.apache.turbine.services.Service;
22import org.apache.jetspeed.om.profile.PSMLDocument;
23import org.apache.jetspeed.om.profile.ProfileLocator;
24import org.apache.jetspeed.om.profile.QueryLocator;
25import org.apache.jetspeed.om.profile.Profile;
26import org.apache.jetspeed.om.security.JetspeedUser;
27import org.apache.jetspeed.om.security.Role;
28import org.apache.jetspeed.om.security.Group;
2930/***31 * This service is responsible for loading and saving PSML documents.32 *33 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>34 * @version $Id: PsmlManagerService.java,v 1.12 2004/02/23 03:32:51 jford Exp $35 */36publicinterfacePsmlManagerServiceextends Service
37 {
3839/*** The name of the service */40public String SERVICE_NAME = "PsmlManager";
4142/***43 * Returns a PSML document of the given name.44 * For this implementation, the name must be the document45 * URL or absolute filepath46 *47 * @deprecated48 * @param name the name of the document to retrieve49 */50publicPSMLDocument getDocument( String name );
5152/***53 * Returns a PSML document for the given locator54 *55 * @param locator The locator descriptor of the document to be retrieved.56 */57publicPSMLDocument getDocument( ProfileLocator locator );
5859/*** Given a ordered list of locators, find the first document matching60 * a profile locator, starting from the beginning of the list and working61 * to the end.62 *63 * @param locator The ordered list of profile locators.64 */65publicPSMLDocument getDocument( List locators );
6667/*** Store the PSML document on disk, using its locator68 * 69 * @param profile the profile locator description.70 * @return true if the operation succeeded71 */72publicboolean store(Profile profile);
7374/*** Save the PSML document on disk, using its name as filepath75 * 76 * @deprecated77 * @param doc the document to save78 * @return true if the operation succeeded79 */80publicboolean saveDocument(PSMLDocument doc);
8182/*** Save the PSML document on disk to the specififed fileOrUrl83 *84 * @deprecated85 * @param fileOrUrl a String representing either an absolute URL86 * or an absolute filepath87 * @param doc the document to save88 * @return true if the operation succeeded89 */90publicboolean saveDocument(String fileOrUrl, PSMLDocument doc);
9192/*** Create a new document.93 *94 * @param profile the profile to use95 * @return The newly created document.96 */97publicPSMLDocument createDocument( Profile profile );
9899/*** Remove a document.100 *101 * @param locator The description of the profile to be removed.102 */103publicvoid removeDocument( ProfileLocator locator );
104105/*** Removes all documents for a given user.106 *107 * @param user The user object.108 */109publicvoid removeUserDocuments( JetspeedUser user );
110111/*** Removes all documents for a given group.112 *113 * @param group The group object.114 */115publicvoid removeGroupDocuments( Group group );
116117/*** Removes all documents for a given role.118 *119 * @param role The role object.120 */121publicvoid removeRoleDocuments( Role role );
122123/*** Query for a collection of profiles given a profile locator criteria.124 *125 * @param locator The profile locator criteria.126 *127 * @return A collection of profiles that match the criteria specified in the locator.128 */129public Iterator query( QueryLocator locator );
130131/*** Export profiles from this service into another service132 *133 * @param consumer The PSML consumer service, receives PSML from this service.134 * @param locator The profile locator criteria.135 *136 * @return The count of profiles exported.137 */138publicint export(PsmlManagerService consumer, QueryLocator locator);
139140/***141 * Returns a PSML document for the given locator bypassing the cache (if applicable)142 *143 * @param locator The locator descriptor of the document to be retrieved.144 */145publicPSMLDocument refresh( ProfileLocator locator );
146147 }
148