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.om.registry;
1819import java.util.Enumeration;
20import java.util.Iterator;
2122/***23 * Represents all items within Jetspeed that hold configuration information.24 *25 * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>26 * @author <a href="raphael@apache.org">Raphaël Luta</a>27 * @version $Id: Registry.java,v 1.7 2004/02/23 03:11:39 jford Exp $28 */29publicinterfaceRegistry30 {
3132/***33 * Get the number of entries within the Registry.34 *35 * @return the number of elements in this Registry instance36 */37publicint getEntryCount();
3839/***40 * Creates a new RegistryEntry instance compatible with the current41 * Registry instance implementation42 *43 * @return the newly created RegistryEntry44 */45publicRegistryEntry createEntry();
4647/***48 * Get the entry in the registry with the specified name49 *50 * @throws RegistryException if the given 'name' does not exist within the51 * Registry52 */53publicRegistryEntry getEntry( String name ) throws RegistryException;
5455/***56 * Set the entry in the registry with the specified name and Entry57 *58 * @throws RegistryException if the given 'name' does not exist within the59 * Registry60 */61publicvoid setEntry( RegistryEntry entry ) throws RegistryException;
6263/***64 * Add the given entry to the registry with the given name.65 *66 * @throws RegistryException if the given 'name' already exists within the67 * Registry68 */69publicvoid addEntry( RegistryEntry entry ) throws RegistryException;
7071/***72 * Tests if an entry with the specified name exists within the Registry73 *74 * @param name the name of the entry that we are looking for75 * @return true if an entry with this name exists in the Registry76 */77publicboolean hasEntry( String name );
7879/***80 * Removes the given entry from the Registry81 *82 * @param entry the RegistryEntry to remove83 */84publicvoid removeEntry( RegistryEntry entry );
8586/***87 * Removes the given entry from the Registry88 *89 * @param name the name of the entry to remove from the Registry90 */91publicvoid removeEntry( String name );
9293/***94 * Get all entries within this Registry95 *96 * @return an Enumeration of all unordered current entries97 */98public Enumeration getEntries();
99100/***101 * List all the entry names within this Registry102 *103 * @return an Iterator over an unordered list of current entry names104 */105public Iterator listEntryNames();
106107/***108 * Get all entries within this Registry as an array109 *110 * @return an unordered array of current registry entries111 */112publicRegistryEntry[] toArray();
113114 }
115116