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.webapps.authentication;
18:
19: import java.io.IOException;
20:
21: import org.apache.cocoon.ProcessingException;
22: import org.apache.cocoon.environment.Redirector;
23: import org.apache.cocoon.webapps.authentication.user.RequestState;
24: import org.apache.cocoon.webapps.authentication.user.UserHandler;
25: import org.apache.cocoon.webapps.session.context.SessionContext;
26: import org.apache.excalibur.source.SourceParameters;
27:
28: /**
29: * This is the authentication manager.
30: * It is used to authenticate (login, logout) a user. Usually, this
31: * component should not be used from custom code. The provided
32: * actions perform all required tasks.
33: *
34: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
35: * @deprecated This block is deprecated and will be removed in future versions.
36: * @version CVS $Id: AuthenticationManager.java 433543 2006-08-22 06:22:54Z crossley $
37: */
38: public interface AuthenticationManager {
39:
40: /** The Avalon Role */
41: String ROLE = AuthenticationManager.class.getName();
42:
43: /**
44: * Is the current user authenticated for the given handler?
45: * @return Returns the corresponding handler if the user is authenticated.
46: */
47: UserHandler isAuthenticated(String handlerName)
48: throws ProcessingException;
49:
50: /**
51: * Is the current user authenticated for the given handler?
52: * If the user is already authenticated, the {@link RequestState}
53: * is updated to the provided information (handler and application).
54: */
55: boolean checkAuthentication(Redirector redirector,
56: String handlerName, String applicationName)
57: throws ProcessingException, IOException;
58:
59: /**
60: * Try to login the user.
61: * If the authentication is successful, the user handler is returned.
62: * If not, <code>null</code> is returned.
63: */
64: UserHandler login(String handlerName, String applicationName,
65: SourceParameters parameters) throws ProcessingException;
66:
67: /**
68: * Perform a logout of the user.
69: */
70: void logout(String handlerName, int mode)
71: throws ProcessingException;
72:
73: /**
74: * Get the current state of authentication
75: */
76: RequestState getState();
77:
78: /**
79: * Create Application Context.
80: * This context is destroyed when the user logs out of the handler
81: */
82: SessionContext createApplicationContext(String name,
83: String loadURI, String saveURI) throws ProcessingException;
84: }
|