KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > om > registry > CapabilityMap


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.om.registry;
18
19 import java.util.Iterator JavaDoc;
20
21 /**
22  * <P>
23  * The <CODE>CapabilityMap</CODE> interface represents a list that
24  * stores capabilities a client is capable of. It is accessed
25  * by the portlet container to get information about the client's
26  * capabilities.
27  * </P>
28  * <P>
29  * The names of the capabilities are matched by the class variable names
30  * of the class <CODE>Capability</CODE>. To add a capability use the
31  * class variable name and <B>not</B> the internally used string value.
32  * </P>
33  *
34  * @author <a HREF="shesmer@raleigh.ibm.com">Stephan Hesmer</a>
35  * @author <a HREF="raphael@apache.org">Raphaël Luta</a>
36  * @see Capability
37  * @version $Id: CapabilityMap.java,v 1.3 2004/02/23 03:11:39 jford Exp $
38  */

39 public interface CapabilityMap
40 {
41
42     /**
43      * Returns an enumeration of all capabilities a client
44      * is capabale of.
45      *
46      * @return an enumeration of all capabilities
47      */

48     public Iterator JavaDoc getCapabilities();
49
50     /**
51      * Adds the given capability
52      *
53      * @param name the name of the new capability
54      */

55     public void addCapability(String JavaDoc name);
56
57     /**
58      * Removes the given capability
59      *
60      * @param name the name of the capability to be removed
61      */

62     public void removeCapability(String JavaDoc name);
63
64     /**
65      * Checks if the argument capability is included in this map
66      *
67      * @param capabiltiy a capability descriptor
68      * @return true if the capability is supported
69      */

70     public boolean contains(String JavaDoc capability);
71
72     /**
73      * Checks if the all the elements of argument capability map
74      * are included in the current one
75      *
76      * @param map a CapabilityMap implementation to test
77      * @return true is all the elements the argument map are included in the
78      * current map.
79      */

80     public boolean containsAll(CapabilityMap map);
81
82 }
83
Popular Tags