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.registry;
18  
19  import java.io.Reader;
20  import java.util.Map;
21  
22  /***
23   * Interface for manipulating RegistryFragments in a fragment based
24   * registry implementation.
25   *
26   * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
27   * @version $Id: FileRegistry.java,v 1.4 2004/02/23 03:31:50 jford Exp $
28   */
29  public interface FileRegistry {
30  
31      public static final int DEFAULT_REFRESH = 300;
32  
33      /*** Refresh the state of the registry implementation. Should be called
34       *   whenever the underlying fragments are modified
35       */
36      public void refresh();
37  
38      /***
39       * @return a Map of all fragments keyed by file names
40       */
41      public Map getFragmentMap();
42  
43      /***
44       * Read and unmarshal a fragment in memory
45       * @param name the name of this fragment
46       * @param reader the reader to use for creating this fragment
47       * @param persistent whether this fragment should be persisted on disk in
48       * the registry
49       */
50      public void createFragment(String name, Reader reader, boolean persistent);
51  
52      /***
53       * Load and unmarshal a RegistryFragment from the file
54       * @param file the absolute file path storing this fragment
55       */
56      public void loadFragment(String file);
57  
58      /***
59       * Marshal and save a RegistryFragment to disk
60       * @param file the absolute file path storing this fragment
61       */
62      public void saveFragment(String file);
63  
64      /***
65       * Remove a fragment from storage
66       * @param file the absolute file path storing this fragment
67       */
68      public void removeFragment(String file);
69  }