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 org.apache.jetspeed.om.registry.Registry;
20  import org.apache.jetspeed.om.registry.RegistryEntry;
21  import org.apache.jetspeed.om.registry.RegistryException;
22  import org.apache.turbine.services.Service;
23  import java.util.Enumeration;
24  
25  /***
26   * <P>This service is a facade for all registry related operations</P>
27   *
28   * @see org.apache.jetspeed.om.registry.Registry
29   * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
30   * @version $Id: RegistryService.java,v 1.4 2004/02/23 03:31:50 jford Exp $
31   */
32  public interface RegistryService extends Service
33  {
34  
35      /*** The name of this service */
36      public String SERVICE_NAME = "Registry";
37  
38      /***
39       * Returns a Registry object for further manipulation
40       *
41       * @param regName the name of the registry to fetch
42       * @return a Registry object if found by the manager or null
43       */
44      public Registry get( String regName );
45  
46      /***
47       * Creates a new RegistryEntry instance compatible with the current
48       * Registry instance implementation
49       *
50       * @param regName the name of the registry to use
51       * @return the newly created RegistryEntry
52       */
53      public RegistryEntry createEntry( String regName );
54  
55      /***
56       * Returns a RegistryEntry from the named Registry.
57       * This is a convenience wrapper around {@link
58       * org.apache.jetspeed.om.registry.Registry#getEntry }
59       *
60       * @param regName the name of the registry
61       * @param entryName the name of the entry to retrieve from the
62       *                  registry
63       * @return a RegistryEntry object if the key is found or null
64       */
65      public RegistryEntry getEntry( String regName, String entryName );
66  
67      /***
68       * Add a new RegistryEntry in the named Registry.
69       * This is a convenience wrapper around {@link
70       * org.apache.jetspeed.om.registry.Registry#addEntry }
71       *
72       * @param regName the name of the registry
73       * @param entry the Registry entry to add
74       * @exception Sends a RegistryException if the manager can't add
75       *            the provided entry
76       */
77      public void addEntry( String regName, RegistryEntry entry )
78          throws RegistryException;
79  
80      /***
81       * Deletes a RegistryEntry from the named Registry
82       * This is a convenience wrapper around {@link
83       * org.apache.jetspeed.om.registry.Registry#removeEntry }
84       *
85       * @param regName the name of the registry
86       * @param entryName the name of the entry to remove
87       */
88      public void removeEntry( String regName, String entryName );
89  
90      /***
91       *  List all the registry currently available to this service
92       *
93       * @return an Enumeration of registry names.
94       */
95      public Enumeration getNames();
96  
97  }