/tags/release/7010/aipo/jetspeed/src/main/java/org/apache/jetspeed/services/psmlmanager/PsmlManagerService.java

http://aipo.googlecode.com/ · Java · 148 lines · 29 code · 20 blank · 99 comment · 0 complexity · 6ef1f9f3b318e8728cc476619f256b78 MD5 · raw file

  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. package org.apache.jetspeed.services.psmlmanager;
  17. import java.util.Iterator;
  18. import java.util.List;
  19. import org.apache.turbine.services.Service;
  20. import org.apache.jetspeed.om.profile.PSMLDocument;
  21. import org.apache.jetspeed.om.profile.ProfileLocator;
  22. import org.apache.jetspeed.om.profile.QueryLocator;
  23. import org.apache.jetspeed.om.profile.Profile;
  24. import org.apache.jetspeed.om.security.JetspeedUser;
  25. import org.apache.jetspeed.om.security.Role;
  26. import org.apache.jetspeed.om.security.Group;
  27. /**
  28. * This service is responsible for loading and saving PSML documents.
  29. *
  30. * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>
  31. * @version $Id: PsmlManagerService.java,v 1.12 2004/02/23 03:32:51 jford Exp $
  32. */
  33. public interface PsmlManagerService extends Service
  34. {
  35. /** The name of the service */
  36. public String SERVICE_NAME = "PsmlManager";
  37. /**
  38. * Returns a PSML document of the given name.
  39. * For this implementation, the name must be the document
  40. * URL or absolute filepath
  41. *
  42. * @deprecated
  43. * @param name the name of the document to retrieve
  44. */
  45. public PSMLDocument getDocument( String name );
  46. /**
  47. * Returns a PSML document for the given locator
  48. *
  49. * @param locator The locator descriptor of the document to be retrieved.
  50. */
  51. public PSMLDocument getDocument( ProfileLocator locator );
  52. /** Given a ordered list of locators, find the first document matching
  53. * a profile locator, starting from the beginning of the list and working
  54. * to the end.
  55. *
  56. * @param locator The ordered list of profile locators.
  57. */
  58. public PSMLDocument getDocument( List locators );
  59. /** Store the PSML document on disk, using its locator
  60. *
  61. * @param profile the profile locator description.
  62. * @return true if the operation succeeded
  63. */
  64. public boolean store(Profile profile);
  65. /** Save the PSML document on disk, using its name as filepath
  66. *
  67. * @deprecated
  68. * @param doc the document to save
  69. * @return true if the operation succeeded
  70. */
  71. public boolean saveDocument(PSMLDocument doc);
  72. /** Save the PSML document on disk to the specififed fileOrUrl
  73. *
  74. * @deprecated
  75. * @param fileOrUrl a String representing either an absolute URL
  76. * or an absolute filepath
  77. * @param doc the document to save
  78. * @return true if the operation succeeded
  79. */
  80. public boolean saveDocument(String fileOrUrl, PSMLDocument doc);
  81. /** Create a new document.
  82. *
  83. * @param profile the profile to use
  84. * @return The newly created document.
  85. */
  86. public PSMLDocument createDocument( Profile profile );
  87. /** Remove a document.
  88. *
  89. * @param locator The description of the profile to be removed.
  90. */
  91. public void removeDocument( ProfileLocator locator );
  92. /** Removes all documents for a given user.
  93. *
  94. * @param user The user object.
  95. */
  96. public void removeUserDocuments( JetspeedUser user );
  97. /** Removes all documents for a given group.
  98. *
  99. * @param group The group object.
  100. */
  101. public void removeGroupDocuments( Group group );
  102. /** Removes all documents for a given role.
  103. *
  104. * @param role The role object.
  105. */
  106. public void removeRoleDocuments( Role role );
  107. /** Query for a collection of profiles given a profile locator criteria.
  108. *
  109. * @param locator The profile locator criteria.
  110. *
  111. * @return A collection of profiles that match the criteria specified in the locator.
  112. */
  113. public Iterator query( QueryLocator locator );
  114. /** Export profiles from this service into another service
  115. *
  116. * @param consumer The PSML consumer service, receives PSML from this service.
  117. * @param locator The profile locator criteria.
  118. *
  119. * @return The count of profiles exported.
  120. */
  121. public int export(PsmlManagerService consumer, QueryLocator locator);
  122. /**
  123. * Returns a PSML document for the given locator bypassing the cache (if applicable)
  124. *
  125. * @param locator The locator descriptor of the document to be retrieved.
  126. */
  127. public PSMLDocument refresh( ProfileLocator locator );
  128. }