KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > source > RestrictableSource


1 /*
2  * Copyright 1999-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 package org.apache.cocoon.components.source;
17
18 import org.apache.cocoon.components.source.helpers.SourceCredential;
19 import org.apache.cocoon.components.source.helpers.SourcePermission;
20
21 import org.apache.excalibur.source.Source;
22 import org.apache.excalibur.source.SourceException;
23
24 /**
25  * A source, which is restrictable, which means you need a username and password.
26  *
27  * @author <a HREF="mailto:stephan@apache.org">Stephan Michels</a>
28  * @version CVS $Id: RestrictableSource.java 30932 2004-07-29 17:35:38Z vgritsenko $
29  */

30 public interface RestrictableSource extends Source {
31
32     /**
33      * Get the current credential for the source
34      */

35     public SourceCredential getSourceCredential() throws SourceException;
36
37     /**
38      * Set the credential for the source
39      */

40     public void setSourceCredential(SourceCredential sourcecredential) throws SourceException;
41
42     /**
43      * Add a permission to this source
44      *
45      * @param sourcepermission Permission, which should be set
46      *
47      * @throws SourceException If an exception occurs during this operation
48      **/

49     public void addSourcePermission(SourcePermission sourcepermission) throws SourceException;
50
51     /**
52      * Remove a permission from this source
53      *
54      * @param sourcepermission Permission, which should be removed
55      *
56      * @throws SourceException If an exception occurs during this operation
57      **/

58     public void removeSourcePermission(SourcePermission sourcepermission) throws SourceException;
59
60     /**
61      * Returns a list of the existing permissions
62      *
63      * @return Array of SourcePermission
64      */

65     public SourcePermission[] getSourcePermissions() throws SourceException;
66 }
67
68
Popular Tags