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.registry;
1819import java.io.Reader;
20import java.util.Map;
2122/***23 * Interface for manipulating RegistryFragments in a fragment based24 * 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 */29publicinterfaceFileRegistry {
3031publicstaticfinalint DEFAULT_REFRESH = 300;
3233/*** Refresh the state of the registry implementation. Should be called34 * whenever the underlying fragments are modified35 */36publicvoid refresh();
3738/***39 * @return a Map of all fragments keyed by file names40 */41public Map getFragmentMap();
4243/***44 * Read and unmarshal a fragment in memory45 * @param name the name of this fragment46 * @param reader the reader to use for creating this fragment47 * @param persistent whether this fragment should be persisted on disk in48 * the registry49 */50publicvoid createFragment(String name, Reader reader, boolean persistent);
5152/***53 * Load and unmarshal a RegistryFragment from the file54 * @param file the absolute file path storing this fragment55 */56publicvoid loadFragment(String file);
5758/***59 * Marshal and save a RegistryFragment to disk60 * @param file the absolute file path storing this fragment61 */62publicvoid saveFragment(String file);
6364/***65 * Remove a fragment from storage66 * @param file the absolute file path storing this fragment67 */68publicvoid removeFragment(String file);
69 }