01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.components.source;
18:
19: import org.apache.cocoon.components.source.helpers.SourceCredential;
20: import org.apache.cocoon.components.source.helpers.SourcePermission;
21:
22: import org.apache.excalibur.source.Source;
23: import org.apache.excalibur.source.SourceException;
24:
25: /**
26: * A source, which is restrictable, which means you need a username and password.
27: *
28: * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
29: * @version CVS $Id: RestrictableSource.java 433543 2006-08-22 06:22:54Z crossley $
30: */
31: public interface RestrictableSource extends Source {
32:
33: /**
34: * Get the current credential for the source
35: */
36: public SourceCredential getSourceCredential()
37: throws SourceException;
38:
39: /**
40: * Set the credential for the source
41: */
42: public void setSourceCredential(SourceCredential sourcecredential)
43: throws SourceException;
44:
45: /**
46: * Add a permission to this source
47: *
48: * @param sourcepermission Permission, which should be set
49: *
50: * @throws SourceException If an exception occurs during this operation
51: **/
52: public void addSourcePermission(SourcePermission sourcepermission)
53: throws SourceException;
54:
55: /**
56: * Remove a permission from this source
57: *
58: * @param sourcepermission Permission, which should be removed
59: *
60: * @throws SourceException If an exception occurs during this operation
61: **/
62: public void removeSourcePermission(SourcePermission sourcepermission)
63: throws SourceException;
64:
65: /**
66: * Returns a list of the existing permissions
67: *
68: * @return Array of SourcePermission
69: */
70: public SourcePermission[] getSourcePermissions()
71: throws SourceException;
72: }
|